diff --git a/.changeset/plenty-clouds-tie.md b/.changeset/plenty-clouds-tie.md new file mode 100644 index 00000000..adce2f35 --- /dev/null +++ b/.changeset/plenty-clouds-tie.md @@ -0,0 +1,31 @@ +--- +"@fingerprint/python-sdk": major +--- + +Migrate to Server API v4. + +### Breaking Changes + +- Flatten event structure. Access fields directly intead of through `products` wrapper. +- Remove `get_visitors` and `get_releated_visitors` endpoints (use `search_events` instead). +- Remove deprecated v3 models (webhook models, product wrapper models, etc.) + +### Migration Guide + +**Event structure:** +```diff +- event.products.identification.data.visitor_id ++ event.identification.visitor_id +``` + +**Region parameter:** +```diff +- Configuration(api_key="key", region="us") ++ from fingerprint_server_sdk.configuration import Region ++ Configuration(api_key="key", region=Region.US) +``` + +**New Features:** + +- New exception classes: `TooManyRequestsException`, `ConflictException`, `UnprocessableEntityException`, ... +- New v4 models: `BotInfo`, `Canvas`, `Emoji`, `EventRuleAction`, `FontPreferences`, ... diff --git a/.env.example b/.env.example index 706fa91d..b299a925 100644 --- a/.env.example +++ b/.env.example @@ -1,5 +1,9 @@ PRIVATE_KEY= VISITOR_ID_TO_DELETE= # for delete visitor example -REQUEST_ID_TO_UPDATE= # for update event example +EVENT_ID_TO_UPDATE= # for update event example # put 'eu' or 'ap' if necessary, 'us' is default REGION= + +# Sealed Results Example +BASE64_SEALED_RESULT= +BASE64_KEY= \ No newline at end of file diff --git a/.github/workflows/functional_tests.yml b/.github/workflows/functional_tests.yml index 64f2f5b3..f1a2d52a 100644 --- a/.github/workflows/functional_tests.yml +++ b/.github/workflows/functional_tests.yml @@ -17,7 +17,6 @@ jobs: functional_tests: name: Functional tests for Python ${{ matrix.python-version }} runs-on: "ubuntu-latest" - environment: test strategy: fail-fast: false @@ -34,6 +33,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt + pip install -r test-requirements.txt - name: "Try to get data using SDK" run: "python ./run_checks.py" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 48a6001b..d60eb358 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,9 +1,7 @@ name: test on: - push: - branches-ignore: - - main + pull_request: workflow_dispatch: jobs: diff --git a/.openapi-generator-ignore b/.openapi-generator-ignore new file mode 100644 index 00000000..d9101c42 --- /dev/null +++ b/.openapi-generator-ignore @@ -0,0 +1,7 @@ +.gitignore +.gitlab-ci.yml +.travis.yml +git_push.sh +tox.ini +test/*.py +.github/workflows/python.yml \ No newline at end of file diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES new file mode 100644 index 00000000..4fab6971 --- /dev/null +++ b/.openapi-generator/FILES @@ -0,0 +1,115 @@ +README.md +docs/BotInfo.md +docs/BotResult.md +docs/BrowserDetails.md +docs/Canvas.md +docs/DecryptionKey.md +docs/Emoji.md +docs/Error.md +docs/ErrorCode.md +docs/ErrorResponse.md +docs/Event.md +docs/EventRuleAction.md +docs/EventRuleActionAllow.md +docs/EventRuleActionBlock.md +docs/EventSearch.md +docs/EventUpdate.md +docs/FingerprintApi.md +docs/FontPreferences.md +docs/Geolocation.md +docs/GeolocationSubdivisionsInner.md +docs/IPBlockList.md +docs/IPInfo.md +docs/IPInfoV4.md +docs/IPInfoV6.md +docs/Identification.md +docs/IdentificationConfidence.md +docs/Integration.md +docs/IntegrationSubintegration.md +docs/PluginsInner.md +docs/PluginsInnerMimeTypesInner.md +docs/Proximity.md +docs/ProxyConfidence.md +docs/ProxyDetails.md +docs/RawDeviceAttributes.md +docs/RequestHeaderModifications.md +docs/RuleActionHeaderField.md +docs/RuleActionType.md +docs/SDK.md +docs/SealedResults.md +docs/SearchEventsBot.md +docs/SearchEventsSdkPlatform.md +docs/SearchEventsVpnConfidence.md +docs/SupplementaryIDHighRecall.md +docs/TamperingDetails.md +docs/TouchSupport.md +docs/Velocity.md +docs/VelocityData.md +docs/VpnConfidence.md +docs/VpnMethods.md +docs/WebGlBasics.md +docs/WebGlExtensions.md +fingerprint_server_sdk/__init__.py +fingerprint_server_sdk/api/__init__.py +fingerprint_server_sdk/api/fingerprint_api.py +fingerprint_server_sdk/api_client.py +fingerprint_server_sdk/api_response.py +fingerprint_server_sdk/configuration.py +fingerprint_server_sdk/exceptions.py +fingerprint_server_sdk/models/__init__.py +fingerprint_server_sdk/models/bot_info.py +fingerprint_server_sdk/models/bot_result.py +fingerprint_server_sdk/models/browser_details.py +fingerprint_server_sdk/models/canvas.py +fingerprint_server_sdk/models/emoji.py +fingerprint_server_sdk/models/error.py +fingerprint_server_sdk/models/error_code.py +fingerprint_server_sdk/models/error_response.py +fingerprint_server_sdk/models/event.py +fingerprint_server_sdk/models/event_rule_action.py +fingerprint_server_sdk/models/event_rule_action_allow.py +fingerprint_server_sdk/models/event_rule_action_block.py +fingerprint_server_sdk/models/event_search.py +fingerprint_server_sdk/models/event_update.py +fingerprint_server_sdk/models/font_preferences.py +fingerprint_server_sdk/models/geolocation.py +fingerprint_server_sdk/models/geolocation_subdivisions_inner.py +fingerprint_server_sdk/models/identification.py +fingerprint_server_sdk/models/identification_confidence.py +fingerprint_server_sdk/models/integration.py +fingerprint_server_sdk/models/integration_subintegration.py +fingerprint_server_sdk/models/ip_block_list.py +fingerprint_server_sdk/models/ip_info.py +fingerprint_server_sdk/models/ip_info_v4.py +fingerprint_server_sdk/models/ip_info_v6.py +fingerprint_server_sdk/models/plugins_inner.py +fingerprint_server_sdk/models/plugins_inner_mime_types_inner.py +fingerprint_server_sdk/models/proximity.py +fingerprint_server_sdk/models/proxy_confidence.py +fingerprint_server_sdk/models/proxy_details.py +fingerprint_server_sdk/models/raw_device_attributes.py +fingerprint_server_sdk/models/request_header_modifications.py +fingerprint_server_sdk/models/rule_action_header_field.py +fingerprint_server_sdk/models/rule_action_type.py +fingerprint_server_sdk/models/sdk.py +fingerprint_server_sdk/models/search_events_bot.py +fingerprint_server_sdk/models/search_events_sdk_platform.py +fingerprint_server_sdk/models/search_events_vpn_confidence.py +fingerprint_server_sdk/models/supplementary_id_high_recall.py +fingerprint_server_sdk/models/tampering_details.py +fingerprint_server_sdk/models/touch_support.py +fingerprint_server_sdk/models/velocity.py +fingerprint_server_sdk/models/velocity_data.py +fingerprint_server_sdk/models/vpn_confidence.py +fingerprint_server_sdk/models/vpn_methods.py +fingerprint_server_sdk/models/web_gl_basics.py +fingerprint_server_sdk/models/web_gl_extensions.py +fingerprint_server_sdk/py.typed +fingerprint_server_sdk/rest.py +fingerprint_server_sdk/sealed.py +fingerprint_server_sdk/webhook_validation.py +pyproject.toml +requirements.txt +setup.cfg +setup.py +test-requirements.txt diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION new file mode 100644 index 00000000..3821090f --- /dev/null +++ b/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.19.0 diff --git a/.schema-version b/.schema-version index a5db00c8..5e008de3 100644 --- a/.schema-version +++ b/.schema-version @@ -1 +1 @@ -v2.12.0 \ No newline at end of file +v3.0.1 \ No newline at end of file diff --git a/.swagger-codegen-ignore b/.swagger-codegen-ignore deleted file mode 100644 index 41427e89..00000000 --- a/.swagger-codegen-ignore +++ /dev/null @@ -1,32 +0,0 @@ -# Swagger Codegen Ignore -# Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen - -# Use this file to prevent files from being overwritten by the generator. -# The patterns follow closely to .gitignore or .dockerignore. - -# As an example, the C# client generator defines ApiClient.cs. -# You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: -#ApiClient.cs - -# You can match any string of characters against a directory, file or extension with a single asterisk (*): -#foo/*/qux -# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux - -# You can recursively match patterns against a directory, file or extension with a double asterisk (**): -#foo/**/qux -# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux - -# You can also negate patterns with an exclamation (!). -# For example, you can ignore all files in a docs folder with the file extension .md: -#docs/*.md -# Then explicitly reverse the ignore rule for a single file: -#!docs/README.md - -.gitignore -.travis.yml -git_push.sh -tox.ini -test/*.py -fingerprint_server_sdk/models/error_plain_response.py -requirements.txt -test-requirements.txt diff --git a/.swagger-codegen/VERSION b/.swagger-codegen/VERSION deleted file mode 100644 index 10bbf276..00000000 --- a/.swagger-codegen/VERSION +++ /dev/null @@ -1 +0,0 @@ -3.0.34 \ No newline at end of file diff --git a/README.md b/README.md index 9bff4e4f..459ddb23 100644 --- a/README.md +++ b/README.md @@ -23,17 +23,18 @@ The Fingerprint Server Python SDK is an easy way to interact with the Fingerprint [Server API](https://dev.fingerprint.com/reference/pro-server-api) from your Python application. You can retrieve visitor history or individual identification events. -This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: -- API version: 3 +- API version: 4 - Package version: 8.11.0 -- Build package: io.swagger.codegen.v3.generators.python.PythonClientCodegen +- Generator version: 7.19.0 +- Build package: org.openapitools.codegen.languages.PythonClientCodegen ## Requirements The following Python versions are supported: -- Python >= 3.9 +- Python 3.9+ ## Installation & Usage ### pip install @@ -74,132 +75,126 @@ import fingerprint_server_sdk Please follow the [installation procedure](#installation--usage) and then run the following: ```python +import os + import fingerprint_server_sdk +from fingerprint_server_sdk.configuration import Region # Configure API key authorization and region -configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY") -# configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY", region="eu") - +configuration = fingerprint_server_sdk.Configuration( + api_key = os.environ["SECRET_API_KEY"], + region = Region.US +) # create an instance of the API class api_instance = fingerprint_server_sdk.FingerprintApi(configuration) ``` ## Examples -Fetching visits using visitorId: +Delete visitor data using `visitorId`: ```python -import fingerprint_server_sdk -from fingerprint_server_sdk.rest import ApiException, KnownApiException - -configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY") -api_instance = fingerprint_server_sdk.FingerprintApi(configuration) - -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 = api_instance.get_visits(visitor_id, limit=2) - print(api_response) -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->visitors_visitor_id_get: %s\n" % e) -``` +import os -Delete visits using visitorId: -```python import fingerprint_server_sdk -from fingerprint_server_sdk.rest import ApiException, KnownApiException +from fingerprint_server_sdk.rest import ApiException +from fingerprint_server_sdk.configuration import Region -configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY") +# Configure API key authorization and region +configuration = fingerprint_server_sdk.Configuration( + api_key = os.environ["SECRET_API_KEY"], + region = Region.US +) api_instance = fingerprint_server_sdk.FingerprintApi(configuration) -visitor_id = 'visitor_id_example' # str | Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. +visitor_id = 'visitor_id_example' 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: +Fetching event details for `eventId`: ```python +import os + import fingerprint_server_sdk -from fingerprint_server_sdk.rest import ApiException, KnownApiException +from fingerprint_server_sdk.rest import ApiException +from fingerprint_server_sdk.configuration import Region -configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY") +# Configure API key authorization and region +configuration = fingerprint_server_sdk.Configuration( + api_key = os.environ["SECRET_API_KEY"], + region = Region.US +) api_instance = fingerprint_server_sdk.FingerprintApi(configuration) -request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). +event_id = 'event_id_example' try: - events_response = api_instance.get_event(request_id) - -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)) + events_response = api_instance.get_event(event_id) except ApiException as e: print("Exception when calling FingerprintApi->get_event: %s\n" % e) ``` Search events with custom filters: ```python +import os + import fingerprint_server_sdk -from fingerprint_server_sdk.rest import ApiException, KnownApiException +from fingerprint_server_sdk.rest import ApiException +from fingerprint_server_sdk.configuration import Region -configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY") +# Configure API key authorization and region +configuration = fingerprint_server_sdk.Configuration( + api_key = os.environ["SECRET_API_KEY"], + region = Region.US +) api_instance = fingerprint_server_sdk.FingerprintApi(configuration) -limit = 20 # int | Limit the number of events returned. -pagination_key = 'key_example' # str | 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` (optional) -visitor_id = '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) -bot = 'good' # str | Filter events by the bot detection result, specifically: events where <'any'|'good'|'bad'|'none'> kind of bot was detected. (optional) -ip_address = '192.168.0.1/32' # 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) -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) -start = 1738687200000 # int | Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) -end = 1738773600000 # int | Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) -reverse = True # bool | Sort events in reverse timestamp order. (optional) -suspect = False # bool | Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). (optional) +limit = 20 +pagination_key = 'key_example' +visitor_id = 'VISITOR_ID' +bot = 'good' +ip_address = '192.168.0.1/32' +linked_id = 'linked_id_example' +start = 1738687200000 +end = 1738773600000 +reverse = True +suspect = False try: # Get events via search api_response = api_instance.search_events(limit, pagination_key=pagination_key, visitor_id=visitor_id, bot=bot, ip_address=ip_address, linked_id=linked_id, start=start, end=end, reverse=reverse, suspect=suspect) print(api_response) - -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->get_event: %s\n" % e) ``` -Update event for requestId: +Update event for `eventId`: ```python +import os + import fingerprint_server_sdk -from fingerprint_server_sdk import EventsUpdateRequest -from fingerprint_server_sdk.rest import ApiException, KnownApiException +from fingerprint_server_sdk import EventUpdate +from fingerprint_server_sdk.rest import ApiException +from fingerprint_server_sdk.configuration import Region -configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY") +# Configure API key authorization and region +configuration = fingerprint_server_sdk.Configuration( + api_key = os.environ["SECRET_API_KEY"], + region = Region.US +) api_instance = fingerprint_server_sdk.FingerprintApi(configuration) -request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). -body = EventsUpdateRequest(linked_id='foo') # EventsUpdateRequest | -# body = EventsUpdateRequest(tag={'bar': 123}) -# body = EventsUpdateRequest(suspect=True) -# body = EventsUpdateRequest(linked_id='foo', tag={'bar': 123}, suspect=False) +event_id = 'event_id_example' +body = EventUpdate(linked_id='foo') +# body = EventUpdate(tags={'bar': 123}) +# body = EventUpdate(suspect=True) +# body = EventUpdate(linked_id='foo', tags={'bar': 123}, suspect=False) try: - api_instance.update_event(body, request_id) -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)) + api_instance.update_event(event_id, body) except ApiException as e: print("Exception when calling FingerprintApi->update_event: %s\n" % e) ``` @@ -279,152 +274,65 @@ To learn more, refer to example located in [webhook_signature_example.py](webhoo ## Documentation for API Endpoints -All URIs are relative to *https://api.fpjs.io* +All URIs are relative to *https://api.fpjs.io/v4* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *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_related_visitors**](docs/FingerprintApi.md#get_related_visitors) | **GET** /related-visitors | Get Related Visitors -*FingerprintApi* | [**get_visits**](docs/FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID -*FingerprintApi* | [**search_events**](docs/FingerprintApi.md#search_events) | **GET** /events/search | Get events via search -*FingerprintApi* | [**update_event**](docs/FingerprintApi.md#update_event) | **PUT** /events/{request_id} | Update an event with a given request ID +*FingerprintApi* | [**get_event**](docs/FingerprintApi.md#get_event) | **GET** /events/{event_id} | Get an event by event ID +*FingerprintApi* | [**search_events**](docs/FingerprintApi.md#search_events) | **GET** /events | Search events +*FingerprintApi* | [**update_event**](docs/FingerprintApi.md#update_event) | **PATCH** /events/{event_id} | Update an event + ## Documentation For Models - - [Botd](docs/Botd.md) - - [BotdBot](docs/BotdBot.md) - - [BotdBotResult](docs/BotdBotResult.md) + - [BotInfo](docs/BotInfo.md) + - [BotResult](docs/BotResult.md) - [BrowserDetails](docs/BrowserDetails.md) - - [ClonedApp](docs/ClonedApp.md) - - [DeprecatedGeolocation](docs/DeprecatedGeolocation.md) - - [DeveloperTools](docs/DeveloperTools.md) - - [Emulator](docs/Emulator.md) + - [Canvas](docs/Canvas.md) + - [Emoji](docs/Emoji.md) - [Error](docs/Error.md) - [ErrorCode](docs/ErrorCode.md) - - [ErrorPlainResponse](docs/ErrorPlainResponse.md) - [ErrorResponse](docs/ErrorResponse.md) - - [EventsGetResponse](docs/EventsGetResponse.md) - - [EventsUpdateRequest](docs/EventsUpdateRequest.md) - - [FactoryReset](docs/FactoryReset.md) - - [Frida](docs/Frida.md) + - [Event](docs/Event.md) + - [EventRuleAction](docs/EventRuleAction.md) + - [EventRuleActionAllow](docs/EventRuleActionAllow.md) + - [EventRuleActionBlock](docs/EventRuleActionBlock.md) + - [EventSearch](docs/EventSearch.md) + - [EventUpdate](docs/EventUpdate.md) + - [FontPreferences](docs/FontPreferences.md) - [Geolocation](docs/Geolocation.md) - - [GeolocationCity](docs/GeolocationCity.md) - - [GeolocationContinent](docs/GeolocationContinent.md) - - [GeolocationCountry](docs/GeolocationCountry.md) - - [GeolocationSubdivision](docs/GeolocationSubdivision.md) - - [GeolocationSubdivisions](docs/GeolocationSubdivisions.md) - - [HighActivity](docs/HighActivity.md) - - [IPBlocklist](docs/IPBlocklist.md) - - [IPBlocklistDetails](docs/IPBlocklistDetails.md) + - [GeolocationSubdivisionsInner](docs/GeolocationSubdivisionsInner.md) + - [IPBlockList](docs/IPBlockList.md) - [IPInfo](docs/IPInfo.md) - - [IPInfoASN](docs/IPInfoASN.md) - - [IPInfoDataCenter](docs/IPInfoDataCenter.md) - [IPInfoV4](docs/IPInfoV4.md) - [IPInfoV6](docs/IPInfoV6.md) - [Identification](docs/Identification.md) - [IdentificationConfidence](docs/IdentificationConfidence.md) - - [IdentificationSeenAt](docs/IdentificationSeenAt.md) - - [Incognito](docs/Incognito.md) - - [Jailbroken](docs/Jailbroken.md) - - [LocationSpoofing](docs/LocationSpoofing.md) - - [MitMAttack](docs/MitMAttack.md) - - [PrivacySettings](docs/PrivacySettings.md) - - [ProductBotd](docs/ProductBotd.md) - - [ProductClonedApp](docs/ProductClonedApp.md) - - [ProductDeveloperTools](docs/ProductDeveloperTools.md) - - [ProductEmulator](docs/ProductEmulator.md) - - [ProductFactoryReset](docs/ProductFactoryReset.md) - - [ProductFrida](docs/ProductFrida.md) - - [ProductHighActivity](docs/ProductHighActivity.md) - - [ProductIPBlocklist](docs/ProductIPBlocklist.md) - - [ProductIPInfo](docs/ProductIPInfo.md) - - [ProductIdentification](docs/ProductIdentification.md) - - [ProductIncognito](docs/ProductIncognito.md) - - [ProductJailbroken](docs/ProductJailbroken.md) - - [ProductLocationSpoofing](docs/ProductLocationSpoofing.md) - - [ProductMitMAttack](docs/ProductMitMAttack.md) - - [ProductPrivacySettings](docs/ProductPrivacySettings.md) - - [ProductProximity](docs/ProductProximity.md) - - [ProductProxy](docs/ProductProxy.md) - - [ProductRawDeviceAttributes](docs/ProductRawDeviceAttributes.md) - - [ProductRemoteControl](docs/ProductRemoteControl.md) - - [ProductRootApps](docs/ProductRootApps.md) - - [ProductSuspectScore](docs/ProductSuspectScore.md) - - [ProductTampering](docs/ProductTampering.md) - - [ProductTor](docs/ProductTor.md) - - [ProductVPN](docs/ProductVPN.md) - - [ProductVelocity](docs/ProductVelocity.md) - - [ProductVirtualMachine](docs/ProductVirtualMachine.md) - - [Products](docs/Products.md) + - [Integration](docs/Integration.md) + - [IntegrationSubintegration](docs/IntegrationSubintegration.md) + - [PluginsInner](docs/PluginsInner.md) + - [PluginsInnerMimeTypesInner](docs/PluginsInnerMimeTypesInner.md) - [Proximity](docs/Proximity.md) - - [Proxy](docs/Proxy.md) - [ProxyConfidence](docs/ProxyConfidence.md) - [ProxyDetails](docs/ProxyDetails.md) - - [RawDeviceAttribute](docs/RawDeviceAttribute.md) - - [RawDeviceAttributeError](docs/RawDeviceAttributeError.md) - [RawDeviceAttributes](docs/RawDeviceAttributes.md) - - [RelatedVisitor](docs/RelatedVisitor.md) - - [RelatedVisitorsResponse](docs/RelatedVisitorsResponse.md) - - [RemoteControl](docs/RemoteControl.md) - - [RootApps](docs/RootApps.md) + - [RequestHeaderModifications](docs/RequestHeaderModifications.md) + - [RuleActionHeaderField](docs/RuleActionHeaderField.md) + - [RuleActionType](docs/RuleActionType.md) - [SDK](docs/SDK.md) - - [SearchEventsResponse](docs/SearchEventsResponse.md) - - [SearchEventsResponseEvents](docs/SearchEventsResponseEvents.md) - - [SupplementaryID](docs/SupplementaryID.md) - - [SuspectScore](docs/SuspectScore.md) - - [Tag](docs/Tag.md) - - [Tampering](docs/Tampering.md) - - [Tor](docs/Tor.md) - - [VPN](docs/VPN.md) - - [VPNConfidence](docs/VPNConfidence.md) - - [VPNMethods](docs/VPNMethods.md) + - [SearchEventsBot](docs/SearchEventsBot.md) + - [SearchEventsSdkPlatform](docs/SearchEventsSdkPlatform.md) + - [SearchEventsVpnConfidence](docs/SearchEventsVpnConfidence.md) + - [SupplementaryIDHighRecall](docs/SupplementaryIDHighRecall.md) + - [TamperingDetails](docs/TamperingDetails.md) + - [TouchSupport](docs/TouchSupport.md) - [Velocity](docs/Velocity.md) - [VelocityData](docs/VelocityData.md) - - [VelocityIntervals](docs/VelocityIntervals.md) - - [VirtualMachine](docs/VirtualMachine.md) - - [Visit](docs/Visit.md) - - [VisitorsGetResponse](docs/VisitorsGetResponse.md) - - [Webhook](docs/Webhook.md) - - [WebhookClonedApp](docs/WebhookClonedApp.md) - - [WebhookDeveloperTools](docs/WebhookDeveloperTools.md) - - [WebhookEmulator](docs/WebhookEmulator.md) - - [WebhookFactoryReset](docs/WebhookFactoryReset.md) - - [WebhookFrida](docs/WebhookFrida.md) - - [WebhookHighActivity](docs/WebhookHighActivity.md) - - [WebhookIPBlocklist](docs/WebhookIPBlocklist.md) - - [WebhookIPInfo](docs/WebhookIPInfo.md) - - [WebhookJailbroken](docs/WebhookJailbroken.md) - - [WebhookLocationSpoofing](docs/WebhookLocationSpoofing.md) - - [WebhookMitMAttack](docs/WebhookMitMAttack.md) - - [WebhookPrivacySettings](docs/WebhookPrivacySettings.md) - - [WebhookProximity](docs/WebhookProximity.md) - - [WebhookProxy](docs/WebhookProxy.md) - - [WebhookRawDeviceAttributes](docs/WebhookRawDeviceAttributes.md) - - [WebhookRemoteControl](docs/WebhookRemoteControl.md) - - [WebhookRootApps](docs/WebhookRootApps.md) - - [WebhookSupplementaryIDs](docs/WebhookSupplementaryIDs.md) - - [WebhookSuspectScore](docs/WebhookSuspectScore.md) - - [WebhookTampering](docs/WebhookTampering.md) - - [WebhookTor](docs/WebhookTor.md) - - [WebhookVPN](docs/WebhookVPN.md) - - [WebhookVelocity](docs/WebhookVelocity.md) - - [WebhookVirtualMachine](docs/WebhookVirtualMachine.md) - -## Documentation For Authorization - - -## ApiKeyHeader - -- **Type**: API key -- **API key parameter name**: Auth-API-Key -- **Location**: HTTP header - -## ApiKeyQuery - -- **Type**: API key -- **API key parameter name**: api_key -- **Location**: URL query string + - [VpnConfidence](docs/VpnConfidence.md) + - [VpnMethods](docs/VpnMethods.md) + - [WebGlBasics](docs/WebGlBasics.md) + - [WebGlExtensions](docs/WebGlExtensions.md) ## Documentation for sealed results diff --git a/bin/swagger-codegen-cli.jar b/bin/swagger-codegen-cli.jar deleted file mode 100644 index 204e76f7..00000000 Binary files a/bin/swagger-codegen-cli.jar and /dev/null differ diff --git a/config.json b/config.json index 736a40fc..7d153ef7 100644 --- a/config.json +++ b/config.json @@ -2,5 +2,22 @@ "packageName": "fingerprint_server_sdk", "packageUrl": "https://github.com/fingerprintjs/python-sdk", "gitUserId": "fingerprintjs", - "gitRepoId": "python-sdk" + "gitRepoId": "python-sdk", + "packageDescription": "Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. 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.", + "files": { + "sealed.py.mustache": { + "folder": "fingerprint_server_sdk", + "destinationFilename": "sealed.py" + }, + "webhook_validation.py": { + "folder": "fingerprint_server_sdk" + }, + "DecryptionKey.md": { + "folder": "docs" + }, + "SealedResults.md": { + "folder": "docs" + } + }, + "useOneOfDiscriminatorLookup": true } \ No newline at end of file diff --git a/contributing.md b/contributing.md index 2082887c..626d3f42 100644 --- a/contributing.md +++ b/contributing.md @@ -2,16 +2,25 @@ ## Structure -Most files in the project are autogenerated by [swagger-codegen](https://swagger.io/tools/swagger-codegen/) with `urllib3` library for python (default). +Most files in the project are autogenerated by [openapi-generator](https://openapi-generator.tech) with `urllib3` library for python. -- [template](./template) - folder contains redefined templates of `swagger-codegen`. Original templates you can find in [swagger-codegen repo](https://github.com/swagger-api/swagger-codegen/tree/751e59df060b1c3ecf54921e104f2086dfa9f820/modules/swagger-codegen/src/main/resources/python). +- [template](./template) - folder contains redefined templates for OpenAPI Generator. Original templates you can find in [openapi-generator repo](https://github.com/OpenAPITools/openapi-generator/tree/v7.19.0/modules/openapi-generator/src/main/resources/python). - [docs](./docs) - generated documentation for models and [API Client](./docs/FingerprintApi.md). - [fingerprint_server_sdk](./fingerprint_server_sdk) - API Client code is generated automatically. +## Commit messages + +This project follows the [Conventional Commits](https://www.conventionalcommits.org/) standard. Each commit message should be structured as: + +``` +: + +[optional body] +``` + ## Code generation -You need `swagger-codegen` to run code generation. There are many ways described in the [readme](https://github.com/swagger-api/swagger-codegen). -In the project we use local jar file `swagger-codegen-cli.jar`. +You need Docker to run code generation with `openapi-generator`. You can just run `./generate.sh` script and it will do all the work. @@ -22,7 +31,7 @@ To download fresh OpenAPI schema run `./sync.sh` Project configuration is described in `config.json` file. To read about available parameters run the command below: ```shell -java -jar ./bin/swagger-codegen-cli.jar config-help -l python +docker run --rm openapitools/openapi-generator-cli:v7.19.0 config-help -g python ``` ### Testing the local source code of the SDK diff --git a/delete_visitor_example.py b/delete_visitor_example.py index 977ffaf4..a054a674 100644 --- a/delete_visitor_example.py +++ b/delete_visitor_example.py @@ -1,6 +1,7 @@ import os import fingerprint_server_sdk +from fingerprint_server_sdk.configuration import Region from fingerprint_server_sdk.rest import ApiException from dotenv import load_dotenv @@ -8,8 +9,9 @@ load_dotenv() # configure +region_str = os.environ.get("REGION", "us").upper() configuration = fingerprint_server_sdk.Configuration( - api_key=os.environ["PRIVATE_KEY"], region=os.environ.get("REGION", "us")) + api_key=os.environ["PRIVATE_KEY"], region=Region[region_str]) # create an instance of the API class api_instance = fingerprint_server_sdk.FingerprintApi(configuration) diff --git a/docs/BotInfo.md b/docs/BotInfo.md new file mode 100644 index 00000000..87186424 --- /dev/null +++ b/docs/BotInfo.md @@ -0,0 +1,15 @@ +# BotInfo +Extended bot information. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**category** | **str** | The type and purpose of the bot. | +**provider** | **str** | The organization or company operating the bot. | +**provider_url** | **str** | The URL of the bot provider's website. | [optional] +**name** | **str** | The specific name or identifier of the bot. | +**identity** | **str** | The verification status of the bot's identity: * `verified` - well-known bot with publicly verifiable identity, directed by the bot provider. * `signed` - bot that signs its platform via Web Bot Auth, directed by the bot provider’s customers. * `spoofed` - bot that claims a public identity but fails verification. * `unknown` - bot that does not publish a verifiable identity. | +**confidence** | **str** | Confidence level of the bot identification. | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/BotResult.md b/docs/BotResult.md new file mode 100644 index 00000000..bf267065 --- /dev/null +++ b/docs/BotResult.md @@ -0,0 +1,15 @@ +# BotResult +Bot detection result: + * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on + * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on + * `not_detected` - the visitor is not a bot + + +## Enum + +* `BAD` (value: `'bad'`) +* `GOOD` (value: `'good'`) +* `NOT_DETECTED` (value: `'not_detected'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/Botd.md b/docs/Botd.md deleted file mode 100644 index b2164d70..00000000 --- a/docs/Botd.md +++ /dev/null @@ -1,18 +0,0 @@ -# Botd -Contains all the information from Bot Detection product - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**bot** | [**BotdBot**](BotdBot.md) | | -**meta** | [**Tag**](Tag.md) | | [optional] -**linked_id** | **str** | A customer-provided id that was sent with the request. | [optional] -**url** | **str** | Page URL from which the request was sent. | -**ip** | **str** | IP address of the requesting browser or bot. | -**time** | **datetime** | Time in UTC when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. | -**user_agent** | **str** | | -**request_id** | **str** | Unique identifier of the user's request. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/BotdBotResult.md b/docs/BotdBotResult.md deleted file mode 100644 index e13c25db..00000000 --- a/docs/BotdBotResult.md +++ /dev/null @@ -1,7 +0,0 @@ -# BotdBotResult -Bot detection result: - * `notDetected` - the visitor is not a bot - * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on - * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on - - diff --git a/docs/BrowserDetails.md b/docs/BrowserDetails.md index ddcda6cb..151f3942 100644 --- a/docs/BrowserDetails.md +++ b/docs/BrowserDetails.md @@ -1,5 +1,4 @@ # BrowserDetails - ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -9,7 +8,6 @@ Name | Type | Description | Notes **os** | **str** | | **os_version** | **str** | | **device** | **str** | | -**user_agent** | **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) diff --git a/docs/Canvas.md b/docs/Canvas.md new file mode 100644 index 00000000..218a47ab --- /dev/null +++ b/docs/Canvas.md @@ -0,0 +1,12 @@ +# Canvas +Canvas fingerprint containing winding flag plus geometry/text hashes. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**winding** | **bool** | | [optional] +**geometry** | **str** | Hash of geometry rendering output or `unsupported` markers. | [optional] +**text** | **str** | Hash of text rendering output or `unsupported` markers. | [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) + diff --git a/docs/ClonedApp.md b/docs/ClonedApp.md deleted file mode 100644 index 53b59862..00000000 --- a/docs/ClonedApp.md +++ /dev/null @@ -1,9 +0,0 @@ -# ClonedApp - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/DeprecatedGeolocation.md b/docs/DeprecatedGeolocation.md deleted file mode 100644 index 6ef74b32..00000000 --- a/docs/DeprecatedGeolocation.md +++ /dev/null @@ -1,19 +0,0 @@ -# DeprecatedGeolocation -This field is **deprecated** and will not return a result for **applications created after January 23rd, 2024**. Please use the [IP Geolocation Smart signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) for geolocation information. - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**accuracy_radius** | **int** | The IP address is likely to be within this radius (in km) of the specified location. | [optional] -**latitude** | **float** | | [optional] -**longitude** | **float** | | [optional] -**postal_code** | **str** | | [optional] -**timezone** | **str** | | [optional] -**city** | [**GeolocationCity**](GeolocationCity.md) | | [optional] -**country** | [**GeolocationCountry**](GeolocationCountry.md) | | [optional] -**continent** | [**GeolocationContinent**](GeolocationContinent.md) | | [optional] -**subdivisions** | [**GeolocationSubdivisions**](GeolocationSubdivisions.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) - diff --git a/docs/Emoji.md b/docs/Emoji.md new file mode 100644 index 00000000..4f960319 --- /dev/null +++ b/docs/Emoji.md @@ -0,0 +1,18 @@ +# Emoji +Bounding box metrics describing how the emoji glyph renders. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**font** | **str** | Font family reported by the browser when drawing the emoji. | [optional] +**width** | **float** | | [optional] +**height** | **float** | | [optional] +**top** | **float** | | [optional] +**bottom** | **float** | | [optional] +**left** | **float** | | [optional] +**right** | **float** | | [optional] +**x** | **float** | | [optional] +**y** | **float** | | [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) + diff --git a/docs/Emulator.md b/docs/Emulator.md deleted file mode 100644 index 548d8aca..00000000 --- a/docs/Emulator.md +++ /dev/null @@ -1,9 +0,0 @@ -# Emulator - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/Error.md b/docs/Error.md index baef0cfc..2a659db5 100644 --- a/docs/Error.md +++ b/docs/Error.md @@ -1,5 +1,4 @@ # Error - ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/docs/ErrorCode.md b/docs/ErrorCode.md index 8d718997..0c2260bc 100644 --- a/docs/ErrorCode.md +++ b/docs/ErrorCode.md @@ -1,21 +1,50 @@ # ErrorCode Error code: - * `RequestCannotBeParsed` - the query parameters or JSON payload contains some errors - that prevented us from parsing it (wrong type/surpassed limits). - * `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. - * `RequestNotFound` - the specified request ID was not found. It never existed, expired, or it has been deleted. - * `VisitorNotFound` - The specified visitor ID was not found. It never existed or it may have already been deleted. - * `TooManyRequests` - the limit on secret API key requests per second has been exceeded. - * `429 Too Many Requests` - the limit on secret API key requests per second has been exceeded. - * `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. - * `Failed` - internal server error. +* `request_cannot_be_parsed` - The query parameters or JSON payload contains some errors + that prevented us from parsing it (wrong type/surpassed limits). +* `secret_api_key_required` - secret API key in header is missing or empty. +* `secret_api_key_not_found` - No Fingerprint workspace found for specified secret API key. +* `public_api_key_required` - public API key in header is missing or empty. +* `public_api_key_not_found` - No Fingerprint workspace found for specified public API key. +* `subscription_not_active` - Fingerprint workspace is not active. +* `wrong_region` - Server and workspace region differ. +* `feature_not_enabled` - This feature (for example, Delete API) is not enabled for your workspace. +* `request_not_found` - The specified event ID was not found. It never existed, expired, or it has been deleted. +* `visitor_not_found` - The specified visitor ID was not found. It never existed or it may have already been deleted. +* `too_many_requests` - The limit on secret API key requests per second has been exceeded. +* `state_not_ready` - The event specified with event ID is + not ready for updates yet. Try again. + This error happens in rare cases when update API is called immediately + after receiving the event ID on the client. In case you need to send + information right away, we recommend using the JS agent API instead. +* `failed` - Internal server error. +* `event_not_found` - The specified event ID was not found. It never existed, expired, or it has been deleted. +* `missing_module` - The request is invalid because it is missing a required module. +* `payload_too_large` - The request payload is too large and cannot be processed. +* `service_unavailable` - The service was unable to process the request. +* `ruleset_not_found` - The specified ruleset was not found. It never existed or it has been deleted. +## Enum + +* `REQUEST_CANNOT_BE_PARSED` (value: `'request_cannot_be_parsed'`) +* `SECRET_API_KEY_REQUIRED` (value: `'secret_api_key_required'`) +* `SECRET_API_KEY_NOT_FOUND` (value: `'secret_api_key_not_found'`) +* `PUBLIC_API_KEY_REQUIRED` (value: `'public_api_key_required'`) +* `PUBLIC_API_KEY_NOT_FOUND` (value: `'public_api_key_not_found'`) +* `SUBSCRIPTION_NOT_ACTIVE` (value: `'subscription_not_active'`) +* `WRONG_REGION` (value: `'wrong_region'`) +* `FEATURE_NOT_ENABLED` (value: `'feature_not_enabled'`) +* `REQUEST_NOT_FOUND` (value: `'request_not_found'`) +* `VISITOR_NOT_FOUND` (value: `'visitor_not_found'`) +* `TOO_MANY_REQUESTS` (value: `'too_many_requests'`) +* `STATE_NOT_READY` (value: `'state_not_ready'`) +* `FAILED` (value: `'failed'`) +* `EVENT_NOT_FOUND` (value: `'event_not_found'`) +* `MISSING_MODULE` (value: `'missing_module'`) +* `PAYLOAD_TOO_LARGE` (value: `'payload_too_large'`) +* `SERVICE_UNAVAILABLE` (value: `'service_unavailable'`) +* `RULESET_NOT_FOUND` (value: `'ruleset_not_found'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ErrorPlainResponse.md b/docs/ErrorPlainResponse.md deleted file mode 100644 index 046926ac..00000000 --- a/docs/ErrorPlainResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# ErrorPlainResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**error** | **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) - diff --git a/docs/ErrorResponse.md b/docs/ErrorResponse.md index f21b6bea..32db2a06 100644 --- a/docs/ErrorResponse.md +++ b/docs/ErrorResponse.md @@ -1,5 +1,4 @@ # ErrorResponse - ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/docs/Event.md b/docs/Event.md new file mode 100644 index 00000000..9f00e83b --- /dev/null +++ b/docs/Event.md @@ -0,0 +1,59 @@ +# Event +Contains results from Fingerprint Identification and all active Smart Signals. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**event_id** | **str** | Unique identifier of the user's request. The first portion of the event_id is a unix epoch milliseconds timestamp For example: `1758130560902.8tRtrH` | +**timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. | +**linked_id** | **str** | A customer-provided id that was sent with the request. | [optional] +**environment_id** | **str** | Environment Id of the event. For example: `ae_47abaca3db2c7c43` | [optional] +**suspect** | **bool** | Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://docs.fingerprint.com/reference/server-api-v4-update-event). | [optional] +**sdk** | [**SDK**](SDK.md) | | [optional] +**replayed** | **bool** | `true` if we determined that this payload was replayed, `false` otherwise. | [optional] +**identification** | [**Identification**](Identification.md) | | [optional] +**supplementary_id_high_recall** | [**SupplementaryIDHighRecall**](SupplementaryIDHighRecall.md) | | [optional] +**tags** | **Dict[str, object]** | A customer-provided value or an object that was sent with the identification request or updated later. | [optional] +**url** | **str** | Page URL from which the request was sent. For example `https://example.com/` | [optional] +**bundle_id** | **str** | Bundle Id of the iOS application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` | [optional] +**package_name** | **str** | Package name of the Android application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` | [optional] +**ip_address** | **str** | IP address of the requesting browser or bot. | [optional] +**user_agent** | **str** | User Agent of the client, for example: `Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....` | [optional] +**client_referrer** | **str** | Client Referrer field corresponds to the `document.referrer` field gathered during an identification request. The value is an empty string if the user navigated to the page directly (not through a link, but, for example, by using a bookmark) For example: `https://example.com/blog/my-article` | [optional] +**browser_details** | [**BrowserDetails**](BrowserDetails.md) | | [optional] +**proximity** | [**Proximity**](Proximity.md) | | [optional] +**bot** | [**BotResult**](BotResult.md) | | [optional] +**bot_type** | **str** | Additional classification of the bot type if detected. | [optional] +**bot_info** | [**BotInfo**](BotInfo.md) | | [optional] +**cloned_app** | **bool** | Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. | [optional] +**developer_tools** | **bool** | `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. | [optional] +**emulator** | **bool** | Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. | [optional] +**factory_reset_timestamp** | **int** | The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC) as a value of 0. See [Factory Reset Detection](https://docs.fingerprint.com/docs/smart-signals-reference#factory-reset-detection) to learn more about this Smart Signal. | [optional] +**frida** | **bool** | [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. | [optional] +**ip_blocklist** | [**IPBlockList**](IPBlockList.md) | | [optional] +**ip_info** | [**IPInfo**](IPInfo.md) | | [optional] +**proxy** | **bool** | IP address was used by a public proxy provider or belonged to a known recent residential proxy | [optional] +**proxy_confidence** | [**ProxyConfidence**](ProxyConfidence.md) | | [optional] +**proxy_details** | [**ProxyDetails**](ProxyDetails.md) | | [optional] +**incognito** | **bool** | `true` if we detected incognito mode used in the browser, `false` otherwise. | [optional] +**jailbroken** | **bool** | iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. | [optional] +**location_spoofing** | **bool** | Flag indicating whether the request came from a mobile device with location spoofing enabled. | [optional] +**mitm_attack** | **bool** | * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://docs.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. | [optional] +**privacy_settings** | **bool** | `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. | [optional] +**root_apps** | **bool** | Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. | [optional] +**rule_action** | [**EventRuleAction**](EventRuleAction.md) | | [optional] +**suspect_score** | **int** | Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://docs.fingerprint.com/docs/suspect-score | [optional] +**tampering** | **bool** | Flag indicating browser tampering was detected. This happens when either: * There are inconsistencies in the browser configuration that cross internal tampering thresholds (see `tampering_details.anomaly_score`). * The browser signature resembles an \"anti-detect\" browser specifically designed to evade fingerprinting (see `tampering_details.anti_detect_browser`). | [optional] +**tampering_details** | [**TamperingDetails**](TamperingDetails.md) | | [optional] +**velocity** | [**Velocity**](Velocity.md) | | [optional] +**virtual_machine** | **bool** | `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. | [optional] +**vpn** | **bool** | VPN or other anonymizing service has been used when sending the request. | [optional] +**vpn_confidence** | [**VpnConfidence**](VpnConfidence.md) | | [optional] +**vpn_origin_timezone** | **str** | Local timezone which is used in timezone_mismatch method. | [optional] +**vpn_origin_country** | **str** | Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). | [optional] +**vpn_methods** | [**VpnMethods**](VpnMethods.md) | | [optional] +**high_activity_device** | **bool** | Flag indicating if the request came from a high-activity visitor. | [optional] +**raw_device_attributes** | [**RawDeviceAttributes**](RawDeviceAttributes.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) + diff --git a/docs/EventRuleAction.md b/docs/EventRuleAction.md new file mode 100644 index 00000000..d66a705c --- /dev/null +++ b/docs/EventRuleAction.md @@ -0,0 +1,17 @@ +# EventRuleAction +Describes the action the client should take, according to the rule in the ruleset that matched the event. When getting an event by event ID, the rule_action will only be included when the ruleset_id query parameter is specified. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ruleset_id** | **str** | The ID of the evaluated ruleset. | +**rule_id** | **str** | The ID of the rule that matched the identification event. | [optional] +**rule_expression** | **str** | The expression of the rule that matched the identification event. | [optional] +**type** | [**RuleActionType**](RuleActionType.md) | | +**request_header_modifications** | [**RequestHeaderModifications**](RequestHeaderModifications.md) | | [optional] +**status_code** | **int** | A valid HTTP status code. | [optional] +**headers** | [**List[RuleActionHeaderField]**](RuleActionHeaderField.md) | A list of headers to send. | [optional] +**body** | **str** | The response body to send to the client. | [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) + diff --git a/docs/EventRuleActionAllow.md b/docs/EventRuleActionAllow.md new file mode 100644 index 00000000..e1397422 --- /dev/null +++ b/docs/EventRuleActionAllow.md @@ -0,0 +1,14 @@ +# EventRuleActionAllow +Informs the client that the request should be forwarded to the origin with optional request header modifications. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ruleset_id** | **str** | The ID of the evaluated ruleset. | +**rule_id** | **str** | The ID of the rule that matched the identification event. | [optional] +**rule_expression** | **str** | The expression of the rule that matched the identification event. | [optional] +**type** | [**RuleActionType**](RuleActionType.md) | | +**request_header_modifications** | [**RequestHeaderModifications**](RequestHeaderModifications.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) + diff --git a/docs/EventRuleActionBlock.md b/docs/EventRuleActionBlock.md new file mode 100644 index 00000000..3c23f8c0 --- /dev/null +++ b/docs/EventRuleActionBlock.md @@ -0,0 +1,16 @@ +# EventRuleActionBlock +Informs the client the request should be blocked using the response described by this rule action. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**ruleset_id** | **str** | The ID of the evaluated ruleset. | +**rule_id** | **str** | The ID of the rule that matched the identification event. | [optional] +**rule_expression** | **str** | The expression of the rule that matched the identification event. | [optional] +**type** | [**RuleActionType**](RuleActionType.md) | | +**status_code** | **int** | A valid HTTP status code. | [optional] +**headers** | [**List[RuleActionHeaderField]**](RuleActionHeaderField.md) | A list of headers to send. | [optional] +**body** | **str** | The response body to send to the client. | [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) + diff --git a/docs/EventSearch.md b/docs/EventSearch.md new file mode 100644 index 00000000..5904c216 --- /dev/null +++ b/docs/EventSearch.md @@ -0,0 +1,12 @@ +# EventSearch +Contains a list of all identification events matching the specified search criteria. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**events** | [**List[Event]**](Event.md) | | +**pagination_key** | **str** | Use this value in the `pagination_key` parameter to request the next page of search results. | [optional] +**total_hits** | **int** | This value represents the total number of events matching the search query, up to the limit provided in the `total_hits` query parameter. Only present if the `total_hits` query parameter was provided. | [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) + diff --git a/docs/EventsUpdateRequest.md b/docs/EventUpdate.md similarity index 59% rename from docs/EventsUpdateRequest.md rename to docs/EventUpdate.md index 34272642..eb5726b9 100644 --- a/docs/EventsUpdateRequest.md +++ b/docs/EventUpdate.md @@ -1,10 +1,9 @@ -# EventsUpdateRequest - +# EventUpdate ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**linked_id** | **str** | LinkedID value to assign to the existing event | [optional] -**tag** | [**Tag**](Tag.md) | | [optional] +**linked_id** | **str** | Linked Id value to assign to the existing event | [optional] +**tags** | **Dict[str, object]** | A customer-provided value or an object that was sent with the identification request or updated later. | [optional] **suspect** | **bool** | Suspect flag indicating observed suspicious or fraudulent event | [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) diff --git a/docs/FactoryReset.md b/docs/FactoryReset.md deleted file mode 100644 index a9db9469..00000000 --- a/docs/FactoryReset.md +++ /dev/null @@ -1,10 +0,0 @@ -# FactoryReset - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**time** | **datetime** | Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. | -**timestamp** | **int** | This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/FingerprintApi.md b/docs/FingerprintApi.md index 122f6e69..fcee5c58 100644 --- a/docs/FingerprintApi.md +++ b/docs/FingerprintApi.md @@ -1,41 +1,70 @@ # fingerprint_server_sdk.FingerprintApi -All URIs are relative to *https://api.fpjs.io* +All URIs are relative to *https://api.fpjs.io/v4* Method | HTTP request | Description ------------- | ------------- | ------------- [**delete_visitor_data**](FingerprintApi.md#delete_visitor_data) | **DELETE** /visitors/{visitor_id} | Delete data by visitor ID -[**get_event**](FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by request ID -[**get_related_visitors**](FingerprintApi.md#get_related_visitors) | **GET** /related-visitors | Get Related Visitors -[**get_visits**](FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID -[**search_events**](FingerprintApi.md#search_events) | **GET** /events/search | Get events via search -[**update_event**](FingerprintApi.md#update_event) | **PUT** /events/{request_id} | Update an event with a given request ID +[**get_event**](FingerprintApi.md#get_event) | **GET** /events/{event_id} | Get an event by event ID +[**search_events**](FingerprintApi.md#search_events) | **GET** /events | Search events +[**update_event**](FingerprintApi.md#update_event) | **PATCH** /events/{event_id} | Update an event + # **delete_visitor_data** > delete_visitor_data(visitor_id) Delete data by visitor ID -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. +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://docs.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://docs.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 [`/v4/events` API](https://docs.fingerprint.com/reference/server-api-v4-get-event) with an `event_id` that was made outside of the 10 days, you will still receive a valid response. + +### Interested? +Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + ### Example + ```python +import os + import fingerprint_server_sdk from fingerprint_server_sdk.rest import ApiException +from fingerprint_server_sdk.configuration import Region +from pprint import pprint # Configure API key authorization and region -configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY") -# configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY", region="eu") +configuration = fingerprint_server_sdk.Configuration( + api_key = os.environ["SECRET_API_KEY"], + region = Region.US +) -# create an instance of the API class +# Create an instance of the API class api_instance = fingerprint_server_sdk.FingerprintApi(configuration) -visitor_id = 'visitor_id_example' # str | The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. +visitor_id: str = 'visitor_id_example' # The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. try: # Delete data by visitor ID api_instance.delete_visitor_data(visitor_id) -except ApiException as e: +except Exception as e: print("Exception when calling FingerprintApi->delete_visitor_data: %s\n" % e) ``` @@ -43,243 +72,197 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **visitor_id** | **str**| The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. | + **visitor_id** | **str**| The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. | ### Return type void (empty response body) -### Authorization - -[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery) - ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json -[[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) - -# **get_event** -> EventsGetResponse get_event(request_id) - -Get event by request ID - -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`. - -### Example -```python -import fingerprint_server_sdk -from fingerprint_server_sdk.rest import ApiException - -# Configure API key authorization and region -configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY") -# configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY", region="eu") - -# create an instance of the API class -api_instance = fingerprint_server_sdk.FingerprintApi(configuration) - -request_id = 'request_id_example' # str | The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request. - -try: - # Get event by request ID - api_response = api_instance.get_event(request_id) - print(api_response) -except ApiException as e: - print("Exception when calling FingerprintApi->get_event: %s\n" % e) -``` - -### Parameters +### HTTP response details -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **request_id** | **str**| The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request. | +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK. The visitor ID is scheduled for deletion. | - | +**400** | Bad request. The visitor ID parameter is missing or in the wrong format. | - | +**403** | Forbidden. Access to this API is denied. | - | +**404** | Not found. The visitor ID cannot be found in this workspace's data. | - | +**429** | Too Many Requests. The request is throttled. | - | -### Return type - -[**EventsGetResponse**](EventsGetResponse.md) - -### Authorization - -[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery) - -### HTTP request headers +[[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) - - **Content-Type**: Not defined - - **Accept**: application/json +# **get_event** +> Event get_event(event_id, ruleset_id=ruleset_id) -[[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) +Get an event by event ID -# **get_related_visitors** -> RelatedVisitorsResponse get_related_visitors(visitor_id) +Get a detailed analysis of an individual identification event, including Smart Signals. -Get Related Visitors +Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. -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). ### Example + ```python +import os + import fingerprint_server_sdk +from fingerprint_server_sdk.models.event import Event from fingerprint_server_sdk.rest import ApiException +from fingerprint_server_sdk.configuration import Region +from pprint import pprint # Configure API key authorization and region -configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY") -# configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY", region="eu") +configuration = fingerprint_server_sdk.Configuration( + api_key = os.environ["SECRET_API_KEY"], + region = Region.US +) -# create an instance of the API class +# Create an instance of the API class api_instance = fingerprint_server_sdk.FingerprintApi(configuration) -visitor_id = 'visitor_id_example' # str | 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. +event_id: str = 'event_id_example' # The unique [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) of each identification request (`requestId` can be used in its place). +ruleset_id: str = 'ruleset_id_example' # The ID of the ruleset to evaluate against the event, producing the action to take for this event. The resulting action is returned in the `rule_action` attribute of the response. (optional) try: - # Get Related Visitors - api_response = api_instance.get_related_visitors(visitor_id) - print(api_response) -except ApiException as e: - print("Exception when calling FingerprintApi->get_related_visitors: %s\n" % e) + # Get an event by event ID + api_response = api_instance.get_event(event_id, ruleset_id=ruleset_id) + print("The response of FingerprintApi->get_event:\n") + pprint(api_response) +except Exception as e: + print("Exception when calling FingerprintApi->get_event: %s\n" % e) ``` ### Parameters Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **visitor_id** | **str**| 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. | + **event_id** | **str**| The unique [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) of each identification request (`requestId` can be used in its place). | + **ruleset_id** | **str**| The ID of the ruleset to evaluate against the event, producing the action to take for this event. The resulting action is returned in the `rule_action` attribute of the response. | [optional] ### Return type -[**RelatedVisitorsResponse**](RelatedVisitorsResponse.md) - -### Authorization - -[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery) +[**Event**](Event.md) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json -[[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) +### HTTP response details -# **get_visits** -> VisitorsGetResponse get_visits(visitor_id, request_id=request_id, linked_id=linked_id, limit=limit, pagination_key=pagination_key, before=before) +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK. | - | +**400** | Bad request. The event Id provided is not valid. | - | +**403** | Forbidden. Access to this API is denied. | - | +**404** | Not found. The event Id cannot be found in this workspace's data. | - | +**429** | Too Many Requests. The request is throttled. | - | +**500** | Workspace error. | - | -Get visits by visitor ID +[[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) -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. +# **search_events** +> EventSearch search_events(limit=limit, pagination_key=pagination_key, visitor_id=visitor_id, bot=bot, ip_address=ip_address, asn=asn, linked_id=linked_id, url=url, bundle_id=bundle_id, package_name=package_name, origin=origin, start=start, end=end, reverse=reverse, suspect=suspect, vpn=vpn, virtual_machine=virtual_machine, tampering=tampering, anti_detect_browser=anti_detect_browser, incognito=incognito, privacy_settings=privacy_settings, jailbroken=jailbroken, frida=frida, factory_reset=factory_reset, cloned_app=cloned_app, emulator=emulator, root_apps=root_apps, vpn_confidence=vpn_confidence, min_suspect_score=min_suspect_score, developer_tools=developer_tools, location_spoofing=location_spoofing, mitm_attack=mitm_attack, proxy=proxy, sdk_version=sdk_version, sdk_platform=sdk_platform, environment=environment, proximity_id=proximity_id, total_hits=total_hits, tor_node=tor_node) -### Example -```python -import fingerprint_server_sdk -from fingerprint_server_sdk.rest import ApiException +Search events -# Configure API key authorization and region -configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY") -# configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY", region="eu") +## Search -# create an instance of the API class -api_instance = fingerprint_server_sdk.FingerprintApi(configuration) +The `/v4/events` endpoint provides a convenient way to search for past events based on specific parameters. Typical use cases and queries include: -visitor_id = 'visitor_id_example' # str | Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. -request_id = 'request_id_example' # str | 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. (optional) -linked_id = 'linked_id_example' # str | 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. (optional) -limit = 56 # 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) -before = 789 # int | ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. (optional) +- Searching for events associated with a single `visitor_id` within a time range to get historical behavior of a visitor. +- Searching for events associated with a single `linked_id` within a time range to get all events associated with your internal account identifier. +- Excluding all bot traffic from the query (`good` and `bad` bots) -try: - # Get visits by visitor ID - api_response = api_instance.get_visits(visitor_id, request_id=request_id, linked_id=linked_id, limit=limit, pagination_key=pagination_key, before=before) - print(api_response) -except ApiException as e: - print("Exception when calling FingerprintApi->get_visits: %s\n" % e) -``` +If you don't provide `start` or `end` parameters, the default search range is the **last 7 days**. -### Parameters +### Filtering events with the `suspect` flag -Name | Type | Description | Notes -------------- | ------------- | ------------- | ------------- - **visitor_id** | **str**| Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. | - **request_id** | **str**| 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. | [optional] - **linked_id** | **str**| 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. | [optional] - **limit** | **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** | **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] - **before** | **int**| ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. | [optional] +The `/v4/events` endpoint unlocks a powerful method for fraud protection analytics. The `suspect` flag is exposed in all events where it was previously set by the update API. -### Return type - -[**VisitorsGetResponse**](VisitorsGetResponse.md) +You can also apply the `suspect` query parameter as a filter to find all potentially fraudulent activity that you previously marked as `suspect`. This helps identify patterns of fraudulent behavior. -### Authorization +### Environment scoping -[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery) +If you use a secret key that is scoped to an environment, you will only get events associated with the same environment. With a workspace-scoped environment, you will get events from all environments. -### HTTP request headers +Smart Signals not activated for your workspace or are not included in the response. - - **Content-Type**: Not defined - - **Accept**: application/json - -[[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) - -# **search_events** -> SearchEventsResponse search_events(limit, pagination_key=pagination_key, visitor_id=visitor_id, bot=bot, ip_address=ip_address, linked_id=linked_id, start=start, end=end, reverse=reverse, suspect=suspect, vpn=vpn, virtual_machine=virtual_machine, tampering=tampering, anti_detect_browser=anti_detect_browser, incognito=incognito, privacy_settings=privacy_settings, jailbroken=jailbroken, frida=frida, factory_reset=factory_reset, cloned_app=cloned_app, emulator=emulator, root_apps=root_apps, vpn_confidence=vpn_confidence, min_suspect_score=min_suspect_score, ip_blocklist=ip_blocklist, datacenter=datacenter, developer_tools=developer_tools, location_spoofing=location_spoofing, mitm_attack=mitm_attack, proxy=proxy, sdk_version=sdk_version, sdk_platform=sdk_platform, environment=environment, proximity_id=proximity_id, proximity_precision_radius=proximity_precision_radius) - -Get events via search - -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. ### Example + ```python +import os + import fingerprint_server_sdk +from fingerprint_server_sdk.models.event_search import EventSearch +from fingerprint_server_sdk.models.search_events_bot import SearchEventsBot +from fingerprint_server_sdk.models.search_events_sdk_platform import SearchEventsSdkPlatform +from fingerprint_server_sdk.models.search_events_vpn_confidence import SearchEventsVpnConfidence from fingerprint_server_sdk.rest import ApiException +from fingerprint_server_sdk.configuration import Region +from pprint import pprint # Configure API key authorization and region -configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY") -# configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY", region="eu") +configuration = fingerprint_server_sdk.Configuration( + api_key = os.environ["SECRET_API_KEY"], + region = Region.US +) -# create an instance of the API class +# Create an instance of the API class api_instance = fingerprint_server_sdk.FingerprintApi(configuration) -limit = 56 # int | Limit the number of events returned. -pagination_key = 'pagination_key_example' # str | 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` (optional) -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) -bot = 'bot_example' # str | 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. (optional) -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) -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) -start = 789 # int | Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) -end = 789 # int | Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) -reverse = True # bool | Sort events in reverse timestamp order. (optional) -suspect = True # bool | 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. (optional) -vpn = True # bool | 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. (optional) -virtual_machine = True # bool | 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. (optional) -tampering = True # bool | 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. (optional) -anti_detect_browser = True # bool | 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. (optional) -incognito = True # bool | 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. (optional) -privacy_settings = True # bool | 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. (optional) -jailbroken = True # bool | 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. (optional) -frida = True # bool | 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. (optional) -factory_reset = True # bool | 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. (optional) -cloned_app = True # bool | 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. (optional) -emulator = True # bool | 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. (optional) -root_apps = True # bool | 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. (optional) -vpn_confidence = 'vpn_confidence_example' # str | 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. (optional) -min_suspect_score = 3.4 # float | 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. (optional) -ip_blocklist = True # bool | 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. (optional) -datacenter = True # bool | 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. (optional) -developer_tools = True # bool | 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. (optional) -location_spoofing = True # bool | 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. (optional) -mitm_attack = True # bool | 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. (optional) -proxy = True # bool | 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. (optional) -sdk_version = 'sdk_version_example' # str | Filter events by a specific SDK version associated with the identification event. Example: `3.11.14` (optional) -sdk_platform = 'sdk_platform_example' # str | Filter events by the SDK Platform associated with the identification event. `js` - JavaScript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. (optional) -environment = ['environment_example'] # list[str] | Filter for events by providing one or more environment IDs. (optional) -proximity_id = 'proximity_id_example' # str | 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. (optional) -proximity_precision_radius = 56 # int | 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. (optional) +limit: int = 10 # Limit the number of events returned. (optional) (default to 10) +pagination_key: str = 'pagination_key_example' # Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The pagination key is an arbitrary string that should not be interpreted in any way and should be passed as-is. 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?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=1740815825085` (optional) +visitor_id: str = 'visitor_id_example' # Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. (optional) +bot: SearchEventsBot = fingerprint_server_sdk.SearchEventsBot() # 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 `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. (optional) +ip_address: str = 'ip_address_example' # Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 (optional) +asn: str = 'asn_example' # Filter events by the ASN associated with the event's IP address. This corresponds to the `ip_info.(v4|v6).asn` property in the response. (optional) +linked_id: str = 'linked_id_example' # Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-v4-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) +url: str = 'url_example' # Filter events by the URL (`url` property) associated with the event. (optional) +bundle_id: str = 'bundle_id_example' # Filter events by the Bundle ID (iOS) associated with the event. (optional) +package_name: str = 'package_name_example' # Filter events by the Package Name (Android) associated with the event. (optional) +origin: str = 'origin_example' # Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) (optional) +start: int = 56 # Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) +end: int = 56 # Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) +reverse: bool = True # Sort events in reverse timestamp order. (optional) +suspect: bool = True # Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > 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. (optional) +vpn: bool = True # Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. (optional) +virtual_machine: bool = True # Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. (optional) +tampering: bool = True # Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. (optional) +anti_detect_browser: bool = True # Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. (optional) +incognito: bool = True # Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. (optional) +privacy_settings: bool = True # Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. (optional) +jailbroken: bool = True # Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. (optional) +frida: bool = True # Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. (optional) +factory_reset: bool = True # Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. (optional) +cloned_app: bool = True # Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. (optional) +emulator: bool = True # Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. (optional) +root_apps: bool = True # Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. (optional) +vpn_confidence: SearchEventsVpnConfidence = fingerprint_server_sdk.SearchEventsVpnConfidence() # 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 `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. (optional) +min_suspect_score: float = 3.4 # Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. (optional) +developer_tools: bool = True # Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. (optional) +location_spoofing: bool = True # Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. (optional) +mitm_attack: bool = True # Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. (optional) +proxy: bool = True # Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. (optional) +sdk_version: str = 'sdk_version_example' # Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` (optional) +sdk_platform: SearchEventsSdkPlatform = fingerprint_server_sdk.SearchEventsSdkPlatform() # Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. (optional) +environment: List[str] = ['environment_example'] # Filter for events by providing one or more environment IDs (`environment_id` property). (optional) +proximity_id: str = 'proximity_id_example' # Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `proximity.id` property matching the provided ID are returned. Events without a `proximity` result are left out of the response. (optional) +total_hits: int = 56 # When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. (optional) +tor_node: bool = True # Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. (optional) try: - # Get events via search - api_response = api_instance.search_events(limit, pagination_key=pagination_key, visitor_id=visitor_id, bot=bot, ip_address=ip_address, linked_id=linked_id, start=start, end=end, reverse=reverse, suspect=suspect, vpn=vpn, virtual_machine=virtual_machine, tampering=tampering, anti_detect_browser=anti_detect_browser, incognito=incognito, privacy_settings=privacy_settings, jailbroken=jailbroken, frida=frida, factory_reset=factory_reset, cloned_app=cloned_app, emulator=emulator, root_apps=root_apps, vpn_confidence=vpn_confidence, min_suspect_score=min_suspect_score, ip_blocklist=ip_blocklist, datacenter=datacenter, developer_tools=developer_tools, location_spoofing=location_spoofing, mitm_attack=mitm_attack, proxy=proxy, sdk_version=sdk_version, sdk_platform=sdk_platform, environment=environment, proximity_id=proximity_id, proximity_precision_radius=proximity_precision_radius) - print(api_response) -except ApiException as e: + # Search events + api_response = api_instance.search_events(limit=limit, pagination_key=pagination_key, visitor_id=visitor_id, bot=bot, ip_address=ip_address, asn=asn, linked_id=linked_id, url=url, bundle_id=bundle_id, package_name=package_name, origin=origin, start=start, end=end, reverse=reverse, suspect=suspect, vpn=vpn, virtual_machine=virtual_machine, tampering=tampering, anti_detect_browser=anti_detect_browser, incognito=incognito, privacy_settings=privacy_settings, jailbroken=jailbroken, frida=frida, factory_reset=factory_reset, cloned_app=cloned_app, emulator=emulator, root_apps=root_apps, vpn_confidence=vpn_confidence, min_suspect_score=min_suspect_score, developer_tools=developer_tools, location_spoofing=location_spoofing, mitm_attack=mitm_attack, proxy=proxy, sdk_version=sdk_version, sdk_platform=sdk_platform, environment=environment, proximity_id=proximity_id, total_hits=total_hits, tor_node=tor_node) + print("The response of FingerprintApi->search_events:\n") + pprint(api_response) +except Exception as e: print("Exception when calling FingerprintApi->search_events: %s\n" % e) ``` @@ -287,83 +270,109 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **limit** | **int**| Limit the number of events returned. | - **pagination_key** | **str**| 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` | [optional] - **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] - **bot** | **str**| 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. | [optional] - **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] - **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] + **limit** | **int**| Limit the number of events returned. | [optional] [default to 10] + **pagination_key** | **str**| Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The pagination key is an arbitrary string that should not be interpreted in any way and should be passed as-is. 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?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=1740815825085` | [optional] + **visitor_id** | **str**| Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. | [optional] + **bot** | [**SearchEventsBot**](.md)| 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 `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. | [optional] + **ip_address** | **str**| Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 | [optional] + **asn** | **str**| Filter events by the ASN associated with the event's IP address. This corresponds to the `ip_info.(v4|v6).asn` property in the response. | [optional] + **linked_id** | **str**| Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-v4-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] + **url** | **str**| Filter events by the URL (`url` property) associated with the event. | [optional] + **bundle_id** | **str**| Filter events by the Bundle ID (iOS) associated with the event. | [optional] + **package_name** | **str**| Filter events by the Package Name (Android) associated with the event. | [optional] + **origin** | **str**| Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) | [optional] **start** | **int**| Filter events with a timestamp greater than the start time, in Unix time (milliseconds). | [optional] **end** | **int**| Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). | [optional] **reverse** | **bool**| Sort events in reverse timestamp order. | [optional] - **suspect** | **bool**| 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. | [optional] - **vpn** | **bool**| 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. | [optional] - **virtual_machine** | **bool**| 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. | [optional] - **tampering** | **bool**| 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. | [optional] - **anti_detect_browser** | **bool**| 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. | [optional] - **incognito** | **bool**| 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. | [optional] - **privacy_settings** | **bool**| 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. | [optional] - **jailbroken** | **bool**| 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. | [optional] - **frida** | **bool**| 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. | [optional] - **factory_reset** | **bool**| 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. | [optional] - **cloned_app** | **bool**| 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. | [optional] - **emulator** | **bool**| 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. | [optional] - **root_apps** | **bool**| 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. | [optional] - **vpn_confidence** | **str**| 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. | [optional] - **min_suspect_score** | **float**| 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. | [optional] - **ip_blocklist** | **bool**| 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. | [optional] - **datacenter** | **bool**| 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. | [optional] - **developer_tools** | **bool**| 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. | [optional] - **location_spoofing** | **bool**| 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. | [optional] - **mitm_attack** | **bool**| 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. | [optional] - **proxy** | **bool**| 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. | [optional] - **sdk_version** | **str**| Filter events by a specific SDK version associated with the identification event. Example: `3.11.14` | [optional] - **sdk_platform** | **str**| Filter events by the SDK Platform associated with the identification event. `js` - JavaScript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. | [optional] - **environment** | [**list[str]**](str.md)| Filter for events by providing one or more environment IDs. | [optional] - **proximity_id** | **str**| 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. | [optional] - **proximity_precision_radius** | **int**| 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. | [optional] + **suspect** | **bool**| Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > 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. | [optional] + **vpn** | **bool**| Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. | [optional] + **virtual_machine** | **bool**| Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. | [optional] + **tampering** | **bool**| Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. | [optional] + **anti_detect_browser** | **bool**| Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. | [optional] + **incognito** | **bool**| Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. | [optional] + **privacy_settings** | **bool**| Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. | [optional] + **jailbroken** | **bool**| Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. | [optional] + **frida** | **bool**| Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. | [optional] + **factory_reset** | **bool**| Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. | [optional] + **cloned_app** | **bool**| Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. | [optional] + **emulator** | **bool**| Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. | [optional] + **root_apps** | **bool**| Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. | [optional] + **vpn_confidence** | [**SearchEventsVpnConfidence**](.md)| 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 `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. | [optional] + **min_suspect_score** | **float**| Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. | [optional] + **developer_tools** | **bool**| Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. | [optional] + **location_spoofing** | **bool**| Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. | [optional] + **mitm_attack** | **bool**| Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. | [optional] + **proxy** | **bool**| Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. | [optional] + **sdk_version** | **str**| Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` | [optional] + **sdk_platform** | [**SearchEventsSdkPlatform**](.md)| Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. | [optional] + **environment** | [**List[str]**](str.md)| Filter for events by providing one or more environment IDs (`environment_id` property). | [optional] + **proximity_id** | **str**| Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `proximity.id` property matching the provided ID are returned. Events without a `proximity` result are left out of the response. | [optional] + **total_hits** | **int**| When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. | [optional] + **tor_node** | **bool**| Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. | [optional] ### Return type -[**SearchEventsResponse**](SearchEventsResponse.md) - -### Authorization - -[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery) +[**EventSearch**](EventSearch.md) ### HTTP request headers - **Content-Type**: Not defined - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | Events matching the filter(s). | - | +**400** | Bad request. One or more supplied search parameters are invalid, or a required parameter is missing. | - | +**403** | Forbidden. Access to this API is denied. | - | +**500** | Workspace error. | - | + [[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) # **update_event** -> update_event(body, request_id) +> update_event(event_id, event_update) + +Update an event + +Change information in existing events specified by `event_id` or *flag suspicious events*. -Update an event with a given request ID +When an event is created, it can be assigned `linked_id` and `tags` submitted through the JS agent parameters. +This information might not have been available on the client initially, so the Server API permits updating these attributes after the fact. + +**Warning** It's not possible to update events older than one month. + +**Warning** Trying to update an event immediately after creation may temporarily result in an +error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully propagated across our systems. In such a case, simply retry the request. -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. ### Example + ```python +import os + import fingerprint_server_sdk +from fingerprint_server_sdk.models.event_update import EventUpdate from fingerprint_server_sdk.rest import ApiException +from fingerprint_server_sdk.configuration import Region +from pprint import pprint # Configure API key authorization and region -configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY") -# configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY", region="eu") +configuration = fingerprint_server_sdk.Configuration( + api_key = os.environ["SECRET_API_KEY"], + region = Region.US +) -# create an instance of the API class +# Create an instance of the API class api_instance = fingerprint_server_sdk.FingerprintApi(configuration) -body = fingerprint_server_sdk.EventsUpdateRequest() # EventsUpdateRequest | -request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). +event_id: str = 'event_id_example' # The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). +event_update: EventUpdate = fingerprint_server_sdk.EventUpdate() # try: - # Update an event with a given request ID - api_instance.update_event(body, request_id) -except ApiException as e: + # Update an event + api_instance.update_event(event_id, event_update) +except Exception as e: print("Exception when calling FingerprintApi->update_event: %s\n" % e) ``` @@ -371,21 +380,27 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **body** | [**EventsUpdateRequest**](EventsUpdateRequest.md)| | - **request_id** | **str**| The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). | + **event_id** | **str**| The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). | + **event_update** | [**EventUpdate**](EventUpdate.md)| | ### Return type void (empty response body) -### Authorization - -[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery) - ### HTTP request headers - **Content-Type**: application/json - **Accept**: application/json +### HTTP response details + +| Status code | Description | Response headers | +|-------------|-------------|------------------| +**200** | OK. | - | +**400** | Bad request. The request payload is not valid. | - | +**403** | Forbidden. Access to this API is denied. | - | +**404** | Not found. The event Id cannot be found in this workspace's data. | - | +**409** | Conflict. The event is not mutable yet. | - | + [[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) diff --git a/docs/FontPreferences.md b/docs/FontPreferences.md new file mode 100644 index 00000000..8a0e71bd --- /dev/null +++ b/docs/FontPreferences.md @@ -0,0 +1,17 @@ +# FontPreferences +Baseline measurement of canonical fonts rendered on the device. Numeric width metrics, in CSS pixels, for the canonical fonts collected by the agent. + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**default** | **float** | | [optional] +**serif** | **float** | | [optional] +**sans** | **float** | | [optional] +**mono** | **float** | | [optional] +**apple** | **float** | | [optional] +**min** | **float** | | [optional] +**system** | **float** | | [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) + diff --git a/docs/Frida.md b/docs/Frida.md deleted file mode 100644 index 3dbf6eba..00000000 --- a/docs/Frida.md +++ /dev/null @@ -1,9 +0,0 @@ -# Frida - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/Geolocation.md b/docs/Geolocation.md index 071eb60f..4514ec8e 100644 --- a/docs/Geolocation.md +++ b/docs/Geolocation.md @@ -1,5 +1,4 @@ # Geolocation - ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- @@ -8,10 +7,12 @@ Name | Type | Description | Notes **longitude** | **float** | | [optional] **postal_code** | **str** | | [optional] **timezone** | **str** | | [optional] -**city** | [**GeolocationCity**](GeolocationCity.md) | | [optional] -**country** | [**GeolocationCountry**](GeolocationCountry.md) | | [optional] -**continent** | [**GeolocationContinent**](GeolocationContinent.md) | | [optional] -**subdivisions** | [**GeolocationSubdivisions**](GeolocationSubdivisions.md) | | [optional] +**city_name** | **str** | | [optional] +**country_code** | **str** | | [optional] +**country_name** | **str** | | [optional] +**continent_code** | **str** | | [optional] +**continent_name** | **str** | | [optional] +**subdivisions** | [**List[GeolocationSubdivisionsInner]**](GeolocationSubdivisionsInner.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) diff --git a/docs/GeolocationContinent.md b/docs/GeolocationContinent.md deleted file mode 100644 index e85fb74d..00000000 --- a/docs/GeolocationContinent.md +++ /dev/null @@ -1,10 +0,0 @@ -# GeolocationContinent - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**code** | **str** | | -**name** | **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) - diff --git a/docs/GeolocationSubdivision.md b/docs/GeolocationSubdivisionsInner.md similarity index 91% rename from docs/GeolocationSubdivision.md rename to docs/GeolocationSubdivisionsInner.md index 4a80e68f..7530a2da 100644 --- a/docs/GeolocationSubdivision.md +++ b/docs/GeolocationSubdivisionsInner.md @@ -1,5 +1,4 @@ -# GeolocationSubdivision - +# GeolocationSubdivisionsInner ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/docs/HighActivity.md b/docs/HighActivity.md deleted file mode 100644 index 0ca36855..00000000 --- a/docs/HighActivity.md +++ /dev/null @@ -1,10 +0,0 @@ -# HighActivity - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | Flag indicating if the request came from a high-activity visitor. | -**daily_requests** | **int** | Number of requests from the same visitor in the previous day. | [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) - diff --git a/docs/IPBlocklistDetails.md b/docs/IPBlockList.md similarity index 69% rename from docs/IPBlocklistDetails.md rename to docs/IPBlockList.md index 129499fc..043e050a 100644 --- a/docs/IPBlocklistDetails.md +++ b/docs/IPBlockList.md @@ -1,10 +1,10 @@ -# IPBlocklistDetails - +# IPBlockList ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**email_spam** | **bool** | IP address was part of a known email spam attack (SMTP). | -**attack_source** | **bool** | IP address was part of a known network attack (SSH/HTTPS). | +**email_spam** | **bool** | IP address was part of a known email spam attack (SMTP). | [optional] +**attack_source** | **bool** | IP address was part of a known network attack (SSH/HTTPS). | [optional] +**tor_node** | **bool** | IP address was part of known TOR network activity. | [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) diff --git a/docs/IPBlocklist.md b/docs/IPBlocklist.md deleted file mode 100644 index 3252d292..00000000 --- a/docs/IPBlocklist.md +++ /dev/null @@ -1,10 +0,0 @@ -# IPBlocklist - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. | -**details** | [**IPBlocklistDetails**](IPBlocklistDetails.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/IPInfo.md b/docs/IPInfo.md index 0da65626..34ccd37d 100644 --- a/docs/IPInfo.md +++ b/docs/IPInfo.md @@ -1,7 +1,6 @@ # IPInfo Details about the request IP address. Has separate fields for v4 and v6 IP address versions. - ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- diff --git a/docs/IPInfoASN.md b/docs/IPInfoASN.md deleted file mode 100644 index e5ab653f..00000000 --- a/docs/IPInfoASN.md +++ /dev/null @@ -1,11 +0,0 @@ -# IPInfoASN - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**asn** | **str** | | -**name** | **str** | | -**network** | **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) - diff --git a/docs/IPInfoDataCenter.md b/docs/IPInfoDataCenter.md deleted file mode 100644 index 7eecff67..00000000 --- a/docs/IPInfoDataCenter.md +++ /dev/null @@ -1,10 +0,0 @@ -# IPInfoDataCenter - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | | -**name** | **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) - diff --git a/docs/IPInfoV4.md b/docs/IPInfoV4.md index f8413286..3d07164b 100644 --- a/docs/IPInfoV4.md +++ b/docs/IPInfoV4.md @@ -1,12 +1,15 @@ # IPInfoV4 - ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **address** | **str** | | -**geolocation** | [**Geolocation**](Geolocation.md) | | -**asn** | [**IPInfoASN**](IPInfoASN.md) | | [optional] -**datacenter** | [**IPInfoDataCenter**](IPInfoDataCenter.md) | | [optional] +**geolocation** | [**Geolocation**](Geolocation.md) | | [optional] +**asn** | **str** | | [optional] +**asn_name** | **str** | | [optional] +**asn_network** | **str** | | [optional] +**asn_type** | **str** | | [optional] +**datacenter_result** | **bool** | | [optional] +**datacenter_name** | **str** | | [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) diff --git a/docs/IPInfoV6.md b/docs/IPInfoV6.md index 4f4f7aca..b7a08f12 100644 --- a/docs/IPInfoV6.md +++ b/docs/IPInfoV6.md @@ -1,12 +1,15 @@ # IPInfoV6 - ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **address** | **str** | | -**geolocation** | [**Geolocation**](Geolocation.md) | | -**asn** | [**IPInfoASN**](IPInfoASN.md) | | [optional] -**datacenter** | [**IPInfoDataCenter**](IPInfoDataCenter.md) | | [optional] +**geolocation** | [**Geolocation**](Geolocation.md) | | [optional] +**asn** | **str** | | [optional] +**asn_name** | **str** | | [optional] +**asn_network** | **str** | | [optional] +**asn_type** | **str** | | [optional] +**datacenter_result** | **bool** | | [optional] +**datacenter_name** | **str** | | [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) diff --git a/docs/Identification.md b/docs/Identification.md index 8a65a670..6cd2b33a 100644 --- a/docs/Identification.md +++ b/docs/Identification.md @@ -1,28 +1,12 @@ # Identification - ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**visitor_id** | **str** | String of 20 characters that uniquely identifies the visitor's browser or mobile device. | -**request_id** | **str** | Unique identifier of the user's request. | -**browser_details** | [**BrowserDetails**](BrowserDetails.md) | | -**incognito** | **bool** | Flag if user used incognito session. | -**ip** | **str** | IP address of the requesting browser or bot. | -**ip_location** | [**DeprecatedGeolocation**](DeprecatedGeolocation.md) | | [optional] -**linked_id** | **str** | A customer-provided id that was sent with the request. | [optional] -**suspect** | **bool** | Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent). | [optional] -**timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. | -**time** | **datetime** | Time expressed according to ISO 8601 in UTC format, when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. | -**url** | **str** | Page URL from which the request was sent. | -**tag** | [**Tag**](Tag.md) | | +**visitor_id** | **str** | String of 20 characters that uniquely identifies the visitor's browser or mobile device. | **confidence** | [**IdentificationConfidence**](IdentificationConfidence.md) | | [optional] **visitor_found** | **bool** | Attribute represents if a visitor had been identified before. | -**first_seen_at** | [**IdentificationSeenAt**](IdentificationSeenAt.md) | | -**last_seen_at** | [**IdentificationSeenAt**](IdentificationSeenAt.md) | | -**components** | [**RawDeviceAttributes**](RawDeviceAttributes.md) | | [optional] -**replayed** | **bool** | `true` if we determined that this payload was replayed, `false` otherwise. | -**sdk** | [**SDK**](SDK.md) | | [optional] -**environment_id** | **str** | Environment ID associated with the event | [optional] +**first_seen_at** | **int** | Unix epoch time milliseconds timestamp indicating the time at which this visitor ID was first seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 | [optional] +**last_seen_at** | **int** | Unix epoch time milliseconds timestamp indicating the time at which this visitor ID was last seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 | [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) diff --git a/docs/IdentificationConfidence.md b/docs/IdentificationConfidence.md index 8ff4f4d7..055d47a3 100644 --- a/docs/IdentificationConfidence.md +++ b/docs/IdentificationConfidence.md @@ -1,10 +1,9 @@ # IdentificationConfidence - ## Properties 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] +**version** | **str** | The version 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] **comment** | **str** | | [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) diff --git a/docs/IdentificationSeenAt.md b/docs/IdentificationSeenAt.md deleted file mode 100644 index ffe6ba36..00000000 --- a/docs/IdentificationSeenAt.md +++ /dev/null @@ -1,10 +0,0 @@ -# IdentificationSeenAt - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_global** | **datetime** | | -**subscription** | **datetime** | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/Incognito.md b/docs/Incognito.md deleted file mode 100644 index 41b87cb5..00000000 --- a/docs/Incognito.md +++ /dev/null @@ -1,9 +0,0 @@ -# Incognito - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | `true` if we detected incognito mode used in the browser, `false` otherwise. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/Integration.md b/docs/Integration.md new file mode 100644 index 00000000..5cc16fd9 --- /dev/null +++ b/docs/Integration.md @@ -0,0 +1,10 @@ +# Integration +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **str** | The name of the specific integration, e.g. \"fingerprint-pro-react\". | [optional] +**version** | **str** | The version of the specific integration, e.g. \"3.11.10\". | [optional] +**subintegration** | [**IntegrationSubintegration**](IntegrationSubintegration.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) + diff --git a/docs/DeveloperTools.md b/docs/IntegrationSubintegration.md similarity index 53% rename from docs/DeveloperTools.md rename to docs/IntegrationSubintegration.md index 0eebf37f..8bb510a8 100644 --- a/docs/DeveloperTools.md +++ b/docs/IntegrationSubintegration.md @@ -1,9 +1,9 @@ -# DeveloperTools - +# IntegrationSubintegration ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**result** | **bool** | `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. | +**name** | **str** | The name of the specific subintegration, e.g. \"preact\". | [optional] +**version** | **str** | The version of the specific subintegration, e.g. \"10.21.0\". | [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) diff --git a/docs/Jailbroken.md b/docs/Jailbroken.md deleted file mode 100644 index 981499b2..00000000 --- a/docs/Jailbroken.md +++ /dev/null @@ -1,9 +0,0 @@ -# Jailbroken - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/LocationSpoofing.md b/docs/LocationSpoofing.md deleted file mode 100644 index 8c22f98d..00000000 --- a/docs/LocationSpoofing.md +++ /dev/null @@ -1,9 +0,0 @@ -# LocationSpoofing - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | Flag indicating whether the request came from a mobile device with location spoofing enabled. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/MitMAttack.md b/docs/MitMAttack.md deleted file mode 100644 index 7168f1b5..00000000 --- a/docs/MitMAttack.md +++ /dev/null @@ -1,9 +0,0 @@ -# MitMAttack - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/GeolocationCity.md b/docs/PluginsInner.md similarity index 64% rename from docs/GeolocationCity.md rename to docs/PluginsInner.md index f67531bc..478e3d82 100644 --- a/docs/GeolocationCity.md +++ b/docs/PluginsInner.md @@ -1,9 +1,10 @@ -# GeolocationCity - +# PluginsInner ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | +**description** | **str** | | [optional] +**mime_types** | [**List[PluginsInnerMimeTypesInner]**](PluginsInnerMimeTypesInner.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) diff --git a/docs/BotdBot.md b/docs/PluginsInnerMimeTypesInner.md similarity index 73% rename from docs/BotdBot.md rename to docs/PluginsInnerMimeTypesInner.md index 570d9089..ee2a4189 100644 --- a/docs/BotdBot.md +++ b/docs/PluginsInnerMimeTypesInner.md @@ -1,12 +1,10 @@ -# BotdBot -Stores bot detection result - - +# PluginsInnerMimeTypesInner ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**result** | [**BotdBotResult**](BotdBotResult.md) | | **type** | **str** | | [optional] +**suffixes** | **str** | | [optional] +**description** | **str** | | [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) diff --git a/docs/PrivacySettings.md b/docs/PrivacySettings.md deleted file mode 100644 index a242542a..00000000 --- a/docs/PrivacySettings.md +++ /dev/null @@ -1,9 +0,0 @@ -# PrivacySettings - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/ProductBotd.md b/docs/ProductBotd.md deleted file mode 100644 index 42cde921..00000000 --- a/docs/ProductBotd.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductBotd - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**Botd**](Botd.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductClonedApp.md b/docs/ProductClonedApp.md deleted file mode 100644 index da6a4eb3..00000000 --- a/docs/ProductClonedApp.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductClonedApp - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**ClonedApp**](ClonedApp.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductDeveloperTools.md b/docs/ProductDeveloperTools.md deleted file mode 100644 index 044a3756..00000000 --- a/docs/ProductDeveloperTools.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductDeveloperTools - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**DeveloperTools**](DeveloperTools.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductEmulator.md b/docs/ProductEmulator.md deleted file mode 100644 index 4c3730cf..00000000 --- a/docs/ProductEmulator.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductEmulator - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**Emulator**](Emulator.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductFactoryReset.md b/docs/ProductFactoryReset.md deleted file mode 100644 index 913da56f..00000000 --- a/docs/ProductFactoryReset.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductFactoryReset - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**FactoryReset**](FactoryReset.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductFrida.md b/docs/ProductFrida.md deleted file mode 100644 index 57189ac0..00000000 --- a/docs/ProductFrida.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductFrida - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**Frida**](Frida.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductHighActivity.md b/docs/ProductHighActivity.md deleted file mode 100644 index 7de47147..00000000 --- a/docs/ProductHighActivity.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductHighActivity - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**HighActivity**](HighActivity.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductIPBlocklist.md b/docs/ProductIPBlocklist.md deleted file mode 100644 index 29dd754c..00000000 --- a/docs/ProductIPBlocklist.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductIPBlocklist - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**IPBlocklist**](IPBlocklist.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductIPInfo.md b/docs/ProductIPInfo.md deleted file mode 100644 index 328c0279..00000000 --- a/docs/ProductIPInfo.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductIPInfo - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**IPInfo**](IPInfo.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductIdentification.md b/docs/ProductIdentification.md deleted file mode 100644 index 7b8c09a0..00000000 --- a/docs/ProductIdentification.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductIdentification - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**Identification**](Identification.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductIncognito.md b/docs/ProductIncognito.md deleted file mode 100644 index fe40ef02..00000000 --- a/docs/ProductIncognito.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductIncognito - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**Incognito**](Incognito.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductJailbroken.md b/docs/ProductJailbroken.md deleted file mode 100644 index 27b46e22..00000000 --- a/docs/ProductJailbroken.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductJailbroken - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**Jailbroken**](Jailbroken.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductLocationSpoofing.md b/docs/ProductLocationSpoofing.md deleted file mode 100644 index 5906c1de..00000000 --- a/docs/ProductLocationSpoofing.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductLocationSpoofing - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**LocationSpoofing**](LocationSpoofing.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductMitMAttack.md b/docs/ProductMitMAttack.md deleted file mode 100644 index 91ad8c7e..00000000 --- a/docs/ProductMitMAttack.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductMitMAttack - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**MitMAttack**](MitMAttack.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductPrivacySettings.md b/docs/ProductPrivacySettings.md deleted file mode 100644 index d2619cb9..00000000 --- a/docs/ProductPrivacySettings.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductPrivacySettings - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**PrivacySettings**](PrivacySettings.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductProximity.md b/docs/ProductProximity.md deleted file mode 100644 index 9b32c827..00000000 --- a/docs/ProductProximity.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductProximity - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**Proximity**](Proximity.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductProxy.md b/docs/ProductProxy.md deleted file mode 100644 index b58c2ab7..00000000 --- a/docs/ProductProxy.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductProxy - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**Proxy**](Proxy.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductRawDeviceAttributes.md b/docs/ProductRawDeviceAttributes.md deleted file mode 100644 index 602a36eb..00000000 --- a/docs/ProductRawDeviceAttributes.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductRawDeviceAttributes - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**RawDeviceAttributes**](RawDeviceAttributes.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductRemoteControl.md b/docs/ProductRemoteControl.md deleted file mode 100644 index e04f0e09..00000000 --- a/docs/ProductRemoteControl.md +++ /dev/null @@ -1,13 +0,0 @@ -# ProductRemoteControl -This product is deprecated. - - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**RemoteControl**](RemoteControl.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductRootApps.md b/docs/ProductRootApps.md deleted file mode 100644 index 29e676b9..00000000 --- a/docs/ProductRootApps.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductRootApps - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**RootApps**](RootApps.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductSuspectScore.md b/docs/ProductSuspectScore.md deleted file mode 100644 index 8c8dfbdb..00000000 --- a/docs/ProductSuspectScore.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductSuspectScore - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**SuspectScore**](SuspectScore.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductTampering.md b/docs/ProductTampering.md deleted file mode 100644 index bdd9cfc6..00000000 --- a/docs/ProductTampering.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductTampering - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**Tampering**](Tampering.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductTor.md b/docs/ProductTor.md deleted file mode 100644 index 0c3fd864..00000000 --- a/docs/ProductTor.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductTor - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**Tor**](Tor.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductVPN.md b/docs/ProductVPN.md deleted file mode 100644 index f809b9d4..00000000 --- a/docs/ProductVPN.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductVPN - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**VPN**](VPN.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductVelocity.md b/docs/ProductVelocity.md deleted file mode 100644 index e220a2e5..00000000 --- a/docs/ProductVelocity.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductVelocity - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**Velocity**](Velocity.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/ProductVirtualMachine.md b/docs/ProductVirtualMachine.md deleted file mode 100644 index aacff530..00000000 --- a/docs/ProductVirtualMachine.md +++ /dev/null @@ -1,10 +0,0 @@ -# ProductVirtualMachine - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**data** | [**VirtualMachine**](VirtualMachine.md) | | [optional] -**error** | [**Error**](Error.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) - diff --git a/docs/Products.md b/docs/Products.md deleted file mode 100644 index 428c28be..00000000 --- a/docs/Products.md +++ /dev/null @@ -1,36 +0,0 @@ -# Products -Contains all information about the request identified by `requestId`, depending on the pricing plan (Pro, Pro Plus, Enterprise) - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**identification** | [**ProductIdentification**](ProductIdentification.md) | | [optional] -**botd** | [**ProductBotd**](ProductBotd.md) | | [optional] -**root_apps** | [**ProductRootApps**](ProductRootApps.md) | | [optional] -**emulator** | [**ProductEmulator**](ProductEmulator.md) | | [optional] -**ip_info** | [**ProductIPInfo**](ProductIPInfo.md) | | [optional] -**ip_blocklist** | [**ProductIPBlocklist**](ProductIPBlocklist.md) | | [optional] -**tor** | [**ProductTor**](ProductTor.md) | | [optional] -**vpn** | [**ProductVPN**](ProductVPN.md) | | [optional] -**proxy** | [**ProductProxy**](ProductProxy.md) | | [optional] -**incognito** | [**ProductIncognito**](ProductIncognito.md) | | [optional] -**tampering** | [**ProductTampering**](ProductTampering.md) | | [optional] -**cloned_app** | [**ProductClonedApp**](ProductClonedApp.md) | | [optional] -**factory_reset** | [**ProductFactoryReset**](ProductFactoryReset.md) | | [optional] -**jailbroken** | [**ProductJailbroken**](ProductJailbroken.md) | | [optional] -**frida** | [**ProductFrida**](ProductFrida.md) | | [optional] -**privacy_settings** | [**ProductPrivacySettings**](ProductPrivacySettings.md) | | [optional] -**virtual_machine** | [**ProductVirtualMachine**](ProductVirtualMachine.md) | | [optional] -**raw_device_attributes** | [**ProductRawDeviceAttributes**](ProductRawDeviceAttributes.md) | | [optional] -**high_activity** | [**ProductHighActivity**](ProductHighActivity.md) | | [optional] -**location_spoofing** | [**ProductLocationSpoofing**](ProductLocationSpoofing.md) | | [optional] -**suspect_score** | [**ProductSuspectScore**](ProductSuspectScore.md) | | [optional] -**remote_control** | [**ProductRemoteControl**](ProductRemoteControl.md) | | [optional] -**velocity** | [**ProductVelocity**](ProductVelocity.md) | | [optional] -**developer_tools** | [**ProductDeveloperTools**](ProductDeveloperTools.md) | | [optional] -**mitm_attack** | [**ProductMitMAttack**](ProductMitMAttack.md) | | [optional] -**proximity** | [**ProductProximity**](ProductProximity.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) - diff --git a/docs/Proximity.md b/docs/Proximity.md index dddb7c76..137adfd1 100644 --- a/docs/Proximity.md +++ b/docs/Proximity.md @@ -2,13 +2,12 @@ Proximity ID represents a fixed geographical zone in a discrete global grid within which the device is observed. - ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | A stable privacy-preserving identifier for a given proximity zone. | **precision_radius** | **int** | The radius of the proximity zone’s precision level, in meters. | -**confidence** | **float** | A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. | +**confidence** | **float** | A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/Proxy.md b/docs/Proxy.md deleted file mode 100644 index 6b194376..00000000 --- a/docs/Proxy.md +++ /dev/null @@ -1,11 +0,0 @@ -# Proxy - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | IP address was used by a public proxy provider or belonged to a known recent residential proxy | -**confidence** | [**ProxyConfidence**](ProxyConfidence.md) | | -**details** | [**ProxyDetails**](ProxyDetails.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) - diff --git a/docs/ProxyConfidence.md b/docs/ProxyConfidence.md index 9bf10ad9..663a8edb 100644 --- a/docs/ProxyConfidence.md +++ b/docs/ProxyConfidence.md @@ -1,6 +1,12 @@ # ProxyConfidence -Confidence level of the proxy detection. -If a proxy is not detected, confidence is "high". -If it's detected, can be "low", "medium", or "high". +Confidence level of the proxy detection. If a proxy is not detected, confidence is "high". If it's detected, can be "low", "medium", or "high". +## Enum + +* `LOW` (value: `'low'`) +* `MEDIUM` (value: `'medium'`) +* `HIGH` (value: `'high'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/ProxyDetails.md b/docs/ProxyDetails.md index cd06b640..eebc662f 100644 --- a/docs/ProxyDetails.md +++ b/docs/ProxyDetails.md @@ -1,12 +1,12 @@ # ProxyDetails -Proxy detection details (present if proxy is detected) - +Proxy detection details (present if `proxy` is `true`) ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **proxy_type** | **str** | Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers | -**last_seen_at** | **datetime** | ISO 8601 formatted timestamp in UTC with hourly resolution of when this IP was last seen as a proxy when available. | [optional] +**last_seen_at** | **int** | Unix millisecond timestamp with hourly resolution of when this IP was last seen as a proxy | [optional] +**provider** | **str** | String representing the last proxy service provider detected when this IP was synced. An IP can be shared by multiple service providers. | [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) diff --git a/docs/RawDeviceAttribute.md b/docs/RawDeviceAttribute.md deleted file mode 100644 index 529fc66a..00000000 --- a/docs/RawDeviceAttribute.md +++ /dev/null @@ -1,10 +0,0 @@ -# RawDeviceAttribute - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**value** | **object** | | [optional] -**error** | [**RawDeviceAttributeError**](RawDeviceAttributeError.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) - diff --git a/docs/RawDeviceAttributeError.md b/docs/RawDeviceAttributeError.md deleted file mode 100644 index 327b5338..00000000 --- a/docs/RawDeviceAttributeError.md +++ /dev/null @@ -1,10 +0,0 @@ -# RawDeviceAttributeError - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**name** | **str** | | [optional] -**message** | **str** | | [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) - diff --git a/docs/RawDeviceAttributes.md b/docs/RawDeviceAttributes.md index ce3ae71e..a6def102 100644 --- a/docs/RawDeviceAttributes.md +++ b/docs/RawDeviceAttributes.md @@ -1,11 +1,35 @@ # RawDeviceAttributes -It includes 35+ raw browser identification attributes to provide Fingerprint users with even more information than our standard visitor ID provides. This enables Fingerprint users to not have to run our open-source product in conjunction with Fingerprint Pro Plus and Enterprise to get those additional attributes. -Warning: The raw signals data can change at any moment as we improve the product. We cannot guarantee the internal shape of raw device attributes to be stable, so typical semantic versioning rules do not apply here. Use this data with caution without assuming a specific structure beyond the generic type provided here. - +A curated subset of raw browser/device attributes that the API surface exposes. Each property contains a value or object with the data for the collected signal. ## Properties -The rawAttributes object follows this general shape: `{ value: any } | { error: { name: string; message: string; } }` +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**font_preferences** | [**FontPreferences**](FontPreferences.md) | | [optional] +**emoji** | [**Emoji**](Emoji.md) | | [optional] +**fonts** | **List[str]** | List of fonts detected on the device. | [optional] +**device_memory** | **int** | Rounded amount of RAM (in gigabytes) reported by the browser. | [optional] +**timezone** | **str** | Timezone identifier detected on the client. | [optional] +**canvas** | [**Canvas**](Canvas.md) | | [optional] +**languages** | **List[List[str]]** | Navigator languages reported by the agent including fallbacks. Each inner array represents ordered language preferences reported by different APIs. | [optional] +**webgl_extensions** | [**WebGlExtensions**](WebGlExtensions.md) | | [optional] +**webgl_basics** | [**WebGlBasics**](WebGlBasics.md) | | [optional] +**screen_resolution** | **List[int]** | Current screen resolution. | [optional] +**touch_support** | [**TouchSupport**](TouchSupport.md) | | [optional] +**oscpu** | **str** | Navigator `oscpu` string. | [optional] +**architecture** | **int** | Integer representing the CPU architecture exposed by the browser. | [optional] +**cookies_enabled** | **bool** | Whether the cookies are enabled in the browser. | [optional] +**hardware_concurrency** | **int** | Number of logical CPU cores reported by the browser. | [optional] +**date_time_locale** | **str** | Locale derived from the Intl.DateTimeFormat API. Negative values indicate known error states. The negative statuses can be: - \"-1\": A permanent status for browsers that don't support Intl API. - \"-2\": A permanent status for browsers that don't supportDateTimeFormat constructor. - \"-3\": A permanent status for browsers in which DateTimeFormat locale is undefined or null. | [optional] +**vendor** | **str** | Navigator vendor string. | [optional] +**color_depth** | **int** | Screen color depth in bits. | [optional] +**platform** | **str** | Navigator platform string. | [optional] +**session_storage** | **bool** | Whether sessionStorage is available. | [optional] +**local_storage** | **bool** | Whether localStorage is available. | [optional] +**audio** | **float** | AudioContext fingerprint or negative status when unavailable. The negative statuses can be: - -1: A permanent status for those browsers which are known to always suspend audio context - -2: A permanent status for browsers that don't support the signal - -3: A temporary status that means that an unexpected timeout has happened | [optional] +**plugins** | [**List[PluginsInner]**](PluginsInner.md) | Browser plugins reported by `navigator.plugins`. | [optional] +**indexed_db** | **bool** | Whether IndexedDB is available. | [optional] +**math** | **str** | Hash of Math APIs used for entropy collection. | [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) diff --git a/docs/RelatedVisitor.md b/docs/RelatedVisitor.md deleted file mode 100644 index 27365db7..00000000 --- a/docs/RelatedVisitor.md +++ /dev/null @@ -1,9 +0,0 @@ -# RelatedVisitor - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**visitor_id** | **str** | Visitor ID of a browser that originates from the same mobile device as the input visitor ID. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/RelatedVisitorsResponse.md b/docs/RelatedVisitorsResponse.md deleted file mode 100644 index 210b6a63..00000000 --- a/docs/RelatedVisitorsResponse.md +++ /dev/null @@ -1,9 +0,0 @@ -# RelatedVisitorsResponse - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**related_visitors** | [**list[RelatedVisitor]**](RelatedVisitor.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/RemoteControl.md b/docs/RemoteControl.md deleted file mode 100644 index ef4a2504..00000000 --- a/docs/RemoteControl.md +++ /dev/null @@ -1,12 +0,0 @@ -# RemoteControl -This signal is deprecated. - - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/RequestHeaderModifications.md b/docs/RequestHeaderModifications.md new file mode 100644 index 00000000..8f1c6059 --- /dev/null +++ b/docs/RequestHeaderModifications.md @@ -0,0 +1,12 @@ +# RequestHeaderModifications +The set of header modifications to apply, in the following order: remove, set, append. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**remove** | **List[str]** | The list of headers to remove. | [optional] +**set** | [**List[RuleActionHeaderField]**](RuleActionHeaderField.md) | The list of headers to set, overwriting any existing headers with the same name. | [optional] +**append** | [**List[RuleActionHeaderField]**](RuleActionHeaderField.md) | The list of headers to append. | [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) + diff --git a/docs/RootApps.md b/docs/RootApps.md deleted file mode 100644 index cc995045..00000000 --- a/docs/RootApps.md +++ /dev/null @@ -1,9 +0,0 @@ -# RootApps - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/GeolocationCountry.md b/docs/RuleActionHeaderField.md similarity index 68% rename from docs/GeolocationCountry.md rename to docs/RuleActionHeaderField.md index be825425..2f5ec55c 100644 --- a/docs/GeolocationCountry.md +++ b/docs/RuleActionHeaderField.md @@ -1,10 +1,9 @@ -# GeolocationCountry - +# RuleActionHeaderField ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **str** | | -**name** | **str** | | +**name** | **str** | The header field name. | +**value** | **str** | The value of the header field. | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/GeolocationSubdivisions.md b/docs/RuleActionType.md similarity index 55% rename from docs/GeolocationSubdivisions.md rename to docs/RuleActionType.md index 2b661b3d..239be334 100644 --- a/docs/GeolocationSubdivisions.md +++ b/docs/RuleActionType.md @@ -1,8 +1,10 @@ -# GeolocationSubdivisions +# RuleActionType +Describes the action to take with the request. -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- +## Enum + +* `ALLOW` (value: `'allow'`) +* `BLOCK` (value: `'block'`) [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/SDK.md b/docs/SDK.md index e4f5265f..e5504c25 100644 --- a/docs/SDK.md +++ b/docs/SDK.md @@ -1,12 +1,12 @@ # SDK Contains information about the SDK used to perform the request. - ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**platform** | **str** | Platform of the SDK. | -**version** | **str** | SDK version string. | +**platform** | **str** | Platform of the SDK used for the identification request. | +**version** | **str** | Version string of the SDK used for the identification request. For example: `\"3.12.1\"` | +**integrations** | [**List[Integration]**](Integration.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) diff --git a/docs/SealedResults.md b/docs/SealedResults.md index fe687922..132de92a 100644 --- a/docs/SealedResults.md +++ b/docs/SealedResults.md @@ -1,7 +1,7 @@ # Sealed results ## **UnsealEventResponse** -> unseal_event_response(sealed: bytes, keys: DecryptionKey[]) -> EventsGetResponse +> unseal_event_response(sealed: bytes, keys: DecryptionKey[]) -> Event Decrypts the sealed response with provided keys. ### Required Parameters diff --git a/docs/SearchEventsBot.md b/docs/SearchEventsBot.md new file mode 100644 index 00000000..99130367 --- /dev/null +++ b/docs/SearchEventsBot.md @@ -0,0 +1,18 @@ +# SearchEventsBot +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 `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. + + +## Enum + +* `ALL` (value: `'all'`) +* `GOOD` (value: `'good'`) +* `BAD` (value: `'bad'`) +* `NONE` (value: `'none'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SearchEventsResponse.md b/docs/SearchEventsResponse.md deleted file mode 100644 index 6ba2a8c1..00000000 --- a/docs/SearchEventsResponse.md +++ /dev/null @@ -1,12 +0,0 @@ -# SearchEventsResponse -Contains a list of all identification events matching the specified search criteria. - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**events** | [**list[SearchEventsResponseEvents]**](SearchEventsResponseEvents.md) | | [optional] -**pagination_key** | **str** | Use this value in the `pagination_key` parameter to request the next page of search results. | [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) - diff --git a/docs/SearchEventsResponseEvents.md b/docs/SearchEventsResponseEvents.md deleted file mode 100644 index 410d5188..00000000 --- a/docs/SearchEventsResponseEvents.md +++ /dev/null @@ -1,11 +0,0 @@ -# SearchEventsResponseEvents -Device intelligence results for the identification event. - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**products** | [**Products**](Products.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/SearchEventsSdkPlatform.md b/docs/SearchEventsSdkPlatform.md new file mode 100644 index 00000000..372571ca --- /dev/null +++ b/docs/SearchEventsSdkPlatform.md @@ -0,0 +1,15 @@ +# SearchEventsSdkPlatform +Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . +`js` - Javascript agent (Web). +`ios` - Apple iOS based devices. +`android` - Android based devices. + + +## Enum + +* `JS` (value: `'js'`) +* `ANDROID` (value: `'android'`) +* `IOS` (value: `'ios'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SearchEventsVpnConfidence.md b/docs/SearchEventsVpnConfidence.md new file mode 100644 index 00000000..679e3e88 --- /dev/null +++ b/docs/SearchEventsVpnConfidence.md @@ -0,0 +1,16 @@ +# SearchEventsVpnConfidence +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 `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. + + +## Enum + +* `HIGH` (value: `'high'`) +* `MEDIUM` (value: `'medium'`) +* `LOW` (value: `'low'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/SupplementaryID.md b/docs/SupplementaryID.md deleted file mode 100644 index a1cffed4..00000000 --- a/docs/SupplementaryID.md +++ /dev/null @@ -1,13 +0,0 @@ -# SupplementaryID - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**visitor_id** | **str** | String of 20 characters that uniquely identifies the visitor's browser or mobile device. | [optional] -**visitor_found** | **bool** | Attribute represents if a visitor had been identified before. | [optional] -**confidence** | [**IdentificationConfidence**](IdentificationConfidence.md) | | [optional] -**first_seen_at** | [**IdentificationSeenAt**](IdentificationSeenAt.md) | | [optional] -**last_seen_at** | [**IdentificationSeenAt**](IdentificationSeenAt.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) - diff --git a/docs/SupplementaryIDHighRecall.md b/docs/SupplementaryIDHighRecall.md new file mode 100644 index 00000000..9ab0413f --- /dev/null +++ b/docs/SupplementaryIDHighRecall.md @@ -0,0 +1,14 @@ +# SupplementaryIDHighRecall +A supplementary browser identifier that prioritizes coverage over precision. The High Recall ID algorithm matches more generously, i.e., this identifier will remain the same even when there are subtle differences between two requests. This algorithm does not create as many new visitor IDs as the standard algorithms do, but there could be an increase in false-positive identification. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**visitor_id** | **str** | String of 20 characters that uniquely identifies the visitor's browser or mobile device. | +**visitor_found** | **bool** | Attribute represents if a visitor had been identified before. | +**confidence** | [**IdentificationConfidence**](IdentificationConfidence.md) | | [optional] +**first_seen_at** | **int** | Unix epoch time milliseconds timestamp indicating the time at which this ID was first seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 | [optional] +**last_seen_at** | **int** | Unix epoch time milliseconds timestamp indicating the time at which this ID was last seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 | [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) + diff --git a/docs/SuspectScore.md b/docs/SuspectScore.md deleted file mode 100644 index 089173f9..00000000 --- a/docs/SuspectScore.md +++ /dev/null @@ -1,9 +0,0 @@ -# SuspectScore - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **int** | Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/Tag.md b/docs/Tag.md deleted file mode 100644 index 75c75c31..00000000 --- a/docs/Tag.md +++ /dev/null @@ -1,10 +0,0 @@ -# Tag -A customer-provided value or an object that was sent with identification request. - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/Tampering.md b/docs/Tampering.md deleted file mode 100644 index ddf8d492..00000000 --- a/docs/Tampering.md +++ /dev/null @@ -1,11 +0,0 @@ -# Tampering - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. | -**anomaly_score** | **float** | A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. | -**anti_detect_browser** | **bool** | Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/TamperingDetails.md b/docs/TamperingDetails.md new file mode 100644 index 00000000..42fde4e4 --- /dev/null +++ b/docs/TamperingDetails.md @@ -0,0 +1,9 @@ +# TamperingDetails +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**anomaly_score** | **float** | Confidence score (`0.0 - 1.0`) for tampering detection: * Values above `0.5` indicate tampering. * Values below `0.5` indicate genuine browsers. | [optional] +**anti_detect_browser** | **bool** | True if the identified browser resembles an \"anti-detect\" browser, such as Incognition, which attempts to evade identification by manipulating its fingerprint. | [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) + diff --git a/docs/Tor.md b/docs/Tor.md deleted file mode 100644 index dd4053e8..00000000 --- a/docs/Tor.md +++ /dev/null @@ -1,9 +0,0 @@ -# Tor - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | `true` if the request IP address is a known tor exit node, `false` otherwise. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/EventsGetResponse.md b/docs/TouchSupport.md similarity index 59% rename from docs/EventsGetResponse.md rename to docs/TouchSupport.md index b60ffe1d..5debb890 100644 --- a/docs/EventsGetResponse.md +++ b/docs/TouchSupport.md @@ -1,11 +1,12 @@ -# EventsGetResponse -Contains results from all activated products - Fingerprint Pro, Bot Detection, and others. - +# TouchSupport +Browser-reported touch capabilities. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**products** | [**Products**](Products.md) | | +**touch_event** | **bool** | | [optional] +**touch_start** | **bool** | | [optional] +**max_touch_points** | **int** | | [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) diff --git a/docs/VPN.md b/docs/VPN.md deleted file mode 100644 index 0b2a789d..00000000 --- a/docs/VPN.md +++ /dev/null @@ -1,13 +0,0 @@ -# VPN - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | VPN or other anonymizing service has been used when sending the request. | -**confidence** | [**VPNConfidence**](VPNConfidence.md) | | -**origin_timezone** | **str** | Local timezone which is used in timezoneMismatch method. | -**origin_country** | **str** | Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). | -**methods** | [**VPNMethods**](VPNMethods.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/VPNConfidence.md b/docs/VPNConfidence.md deleted file mode 100644 index bc6faed5..00000000 --- a/docs/VPNConfidence.md +++ /dev/null @@ -1,3 +0,0 @@ -# VPNConfidence -A confidence rating for the VPN detection result — "low", "medium", or "high". Depends on the combination of results returned from all VPN detection methods. - diff --git a/docs/Velocity.md b/docs/Velocity.md index 302c93af..d04c4003 100644 --- a/docs/Velocity.md +++ b/docs/Velocity.md @@ -1,32 +1,34 @@ # Velocity -Sums key data points for a specific `visitorId`, `ipAddress` and `linkedId` at three distinct time +Sums key data points for a specific `visitor_id`, `ip_address` and `linked_id` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: -- Number of distinct IP addresses associated to the visitor ID. -- Number of distinct linked IDs associated with the visitor ID. -- Number of distinct countries associated with the visitor ID. -- Number of identification events associated with the visitor ID. +- Number of distinct IP addresses associated to the visitor Id. +- Number of distinct linked Ids associated with the visitor Id. +- Number of distinct countries associated with the visitor Id. +- Number of identification events associated with the visitor Id. - Number of identification events associated with the detected IP address. -- Number of distinct IP addresses associated with the provided linked ID. -- Number of distinct visitor IDs associated with the provided linked ID. +- Number of distinct IP addresses associated with the provided linked Id. +- Number of distinct visitor Ids associated with the provided linked Id. -The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, -`distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted -if the number of `events` for the visitor ID in the last 24 -hours (`events.intervals.['24h']`) is higher than 20.000. +The `24h` interval of `distinct_ip`, `distinct_linked_id`, `distinct_country`, +`distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will be omitted +if the number of `events` for the visitor Id in the last 24 +hours (`events.['24h']`) is higher than 20.000. +All will not necessarily be returned in a response, some may be omitted if the +associated event does not have the required data, such as a linked_id. ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**distinct_ip** | [**VelocityData**](VelocityData.md) | | -**distinct_linked_id** | [**VelocityData**](VelocityData.md) | | -**distinct_country** | [**VelocityData**](VelocityData.md) | | -**events** | [**VelocityData**](VelocityData.md) | | -**ip_events** | [**VelocityData**](VelocityData.md) | | -**distinct_ip_by_linked_id** | [**VelocityData**](VelocityData.md) | | -**distinct_visitor_id_by_linked_id** | [**VelocityData**](VelocityData.md) | | +**distinct_ip** | [**VelocityData**](VelocityData.md) | | [optional] +**distinct_linked_id** | [**VelocityData**](VelocityData.md) | | [optional] +**distinct_country** | [**VelocityData**](VelocityData.md) | | [optional] +**events** | [**VelocityData**](VelocityData.md) | | [optional] +**ip_events** | [**VelocityData**](VelocityData.md) | | [optional] +**distinct_ip_by_linked_id** | [**VelocityData**](VelocityData.md) | | [optional] +**distinct_visitor_id_by_linked_id** | [**VelocityData**](VelocityData.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) diff --git a/docs/VelocityData.md b/docs/VelocityData.md index 4246a3a1..bd5adb7f 100644 --- a/docs/VelocityData.md +++ b/docs/VelocityData.md @@ -1,9 +1,13 @@ # VelocityData +Is absent if the velocity data could not be generated for the visitor Id. + ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**intervals** | [**VelocityIntervals**](VelocityIntervals.md) | | [optional] +**var_5_minutes** | **int** | Count for the last 5 minutes of velocity data, from the time of the event. | +**var_1_hour** | **int** | Count for the last 1 hour of velocity data, from the time of the event. | +**var_24_hours** | **int** | The `24_hours` interval of `distinct_ip`, `distinct_linked_id`, `distinct_country`, `distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will be omitted if the number of `events` for the visitor Id in the last 24 hours (`events.['24_hours']`) is higher than 20.000. | [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) diff --git a/docs/VelocityIntervals.md b/docs/VelocityIntervals.md deleted file mode 100644 index 35915a92..00000000 --- a/docs/VelocityIntervals.md +++ /dev/null @@ -1,14 +0,0 @@ -# VelocityIntervals -Is absent if the velocity data could not be generated for the visitor ID. - - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**_5m** | **int** | | -**_1h** | **int** | | -**_24h** | **int** | The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. | [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) - diff --git a/docs/VirtualMachine.md b/docs/VirtualMachine.md deleted file mode 100644 index cdee06e3..00000000 --- a/docs/VirtualMachine.md +++ /dev/null @@ -1,9 +0,0 @@ -# VirtualMachine - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/Visit.md b/docs/Visit.md deleted file mode 100644 index ad7e0a4b..00000000 --- a/docs/Visit.md +++ /dev/null @@ -1,23 +0,0 @@ -# Visit - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**request_id** | **str** | Unique identifier of the user's request. | -**browser_details** | [**BrowserDetails**](BrowserDetails.md) | | -**incognito** | **bool** | Flag if user used incognito session. | -**ip** | **str** | IP address of the requesting browser or bot. | -**ip_location** | [**DeprecatedGeolocation**](DeprecatedGeolocation.md) | | [optional] -**linked_id** | **str** | A customer-provided id that was sent with the request. | [optional] -**timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. | -**time** | **datetime** | Time expressed according to ISO 8601 in UTC format, when the request from the client agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. | -**url** | **str** | Page URL from which the request was sent. | -**tag** | [**Tag**](Tag.md) | | -**confidence** | [**IdentificationConfidence**](IdentificationConfidence.md) | | [optional] -**visitor_found** | **bool** | Attribute represents if a visitor had been identified before. | -**first_seen_at** | [**IdentificationSeenAt**](IdentificationSeenAt.md) | | -**last_seen_at** | [**IdentificationSeenAt**](IdentificationSeenAt.md) | | -**components** | [**RawDeviceAttributes**](RawDeviceAttributes.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) - diff --git a/docs/VisitorsGetResponse.md b/docs/VisitorsGetResponse.md deleted file mode 100644 index dc39069f..00000000 --- a/docs/VisitorsGetResponse.md +++ /dev/null @@ -1,14 +0,0 @@ -# VisitorsGetResponse -Pagination-related fields `lastTimestamp` and `paginationKey` are included if you use a pagination parameter like `limit` or `before` and there is more data available on the next page. - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**visitor_id** | **str** | | -**visits** | [**list[Visit]**](Visit.md) | | -**last_timestamp** | **int** | ⚠️ Deprecated paging attribute, please use `paginationKey` instead. Timestamp of the last visit in the current page of results. | [optional] -**pagination_key** | **str** | Request ID of the last visit in the current page of results. Use this value in the following request as the `paginationKey` parameter to get the next page of results. | [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) - diff --git a/docs/VpnConfidence.md b/docs/VpnConfidence.md new file mode 100644 index 00000000..47dd95af --- /dev/null +++ b/docs/VpnConfidence.md @@ -0,0 +1,11 @@ +# VpnConfidence +A confidence rating for the VPN detection result — "low", "medium", or "high". Depends on the combination of results returned from all VPN detection methods. + +## Enum + +* `LOW` (value: `'low'`) +* `MEDIUM` (value: `'medium'`) +* `HIGH` (value: `'high'`) + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/docs/VPNMethods.md b/docs/VpnMethods.md similarity index 53% rename from docs/VPNMethods.md rename to docs/VpnMethods.md index e2981041..af60502d 100644 --- a/docs/VPNMethods.md +++ b/docs/VpnMethods.md @@ -1,13 +1,12 @@ -# VPNMethods - +# VpnMethods ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**timezone_mismatch** | **bool** | The browser timezone doesn't match the timezone inferred from the request IP address. | -**public_vpn** | **bool** | Request IP address is owned and used by a public VPN service provider. | -**auxiliary_mobile** | **bool** | This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. | -**os_mismatch** | **bool** | The browser runs on a different operating system than the operating system inferred from the request network signature. | -**relay** | **bool** | Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. | +**timezone_mismatch** | **bool** | The browser timezone doesn't match the timezone inferred from the request IP address. | [optional] +**public_vpn** | **bool** | Request IP address is owned and used by a public VPN service provider. | [optional] +**auxiliary_mobile** | **bool** | This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. | [optional] +**os_mismatch** | **bool** | The browser runs on a different operating system than the operating system inferred from the request network signature. | [optional] +**relay** | **bool** | Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. | [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) diff --git a/docs/WebGlBasics.md b/docs/WebGlBasics.md new file mode 100644 index 00000000..1fc868ae --- /dev/null +++ b/docs/WebGlBasics.md @@ -0,0 +1,15 @@ +# WebGlBasics +Render and vendor strings reported by the WebGL context. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**version** | **str** | | [optional] +**vendor** | **str** | | [optional] +**vendor_unmasked** | **str** | | [optional] +**renderer** | **str** | | [optional] +**renderer_unmasked** | **str** | | [optional] +**shading_language_version** | **str** | | [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) + diff --git a/docs/WebGlExtensions.md b/docs/WebGlExtensions.md new file mode 100644 index 00000000..c8e774d4 --- /dev/null +++ b/docs/WebGlExtensions.md @@ -0,0 +1,15 @@ +# WebGlExtensions +Hashes of WebGL context attributes and extension support. + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**context_attributes** | **str** | | [optional] +**parameters** | **str** | | [optional] +**shader_precisions** | **str** | | [optional] +**extensions** | **str** | | [optional] +**extension_parameters** | **str** | | [optional] +**unsupported_extensions** | **List[str]** | | [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) + diff --git a/docs/Webhook.md b/docs/Webhook.md deleted file mode 100644 index 7b1051de..00000000 --- a/docs/Webhook.md +++ /dev/null @@ -1,54 +0,0 @@ -# Webhook - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**request_id** | **str** | Unique identifier of the user's request. | -**url** | **str** | Page URL from which the request was sent. | -**ip** | **str** | IP address of the requesting browser or bot. | -**environment_id** | **str** | Environment ID of the event. | [optional] -**tag** | [**Tag**](Tag.md) | | [optional] -**time** | **datetime** | Time expressed according to ISO 8601 in UTC format, when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. | -**timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. | -**ip_location** | [**DeprecatedGeolocation**](DeprecatedGeolocation.md) | | [optional] -**linked_id** | **str** | A customer-provided id that was sent with the request. | [optional] -**visitor_id** | **str** | String of 20 characters that uniquely identifies the visitor's browser or mobile device. | [optional] -**visitor_found** | **bool** | Attribute represents if a visitor had been identified before. | [optional] -**confidence** | [**IdentificationConfidence**](IdentificationConfidence.md) | | [optional] -**first_seen_at** | [**IdentificationSeenAt**](IdentificationSeenAt.md) | | [optional] -**last_seen_at** | [**IdentificationSeenAt**](IdentificationSeenAt.md) | | [optional] -**browser_details** | [**BrowserDetails**](BrowserDetails.md) | | [optional] -**incognito** | **bool** | Flag if user used incognito session. | [optional] -**client_referrer** | **str** | | [optional] -**components** | [**RawDeviceAttributes**](RawDeviceAttributes.md) | | [optional] -**bot** | [**BotdBot**](BotdBot.md) | | [optional] -**user_agent** | **str** | | [optional] -**root_apps** | [**WebhookRootApps**](WebhookRootApps.md) | | [optional] -**emulator** | [**WebhookEmulator**](WebhookEmulator.md) | | [optional] -**ip_info** | [**WebhookIPInfo**](WebhookIPInfo.md) | | [optional] -**ip_blocklist** | [**WebhookIPBlocklist**](WebhookIPBlocklist.md) | | [optional] -**tor** | [**WebhookTor**](WebhookTor.md) | | [optional] -**vpn** | [**WebhookVPN**](WebhookVPN.md) | | [optional] -**proxy** | [**WebhookProxy**](WebhookProxy.md) | | [optional] -**tampering** | [**WebhookTampering**](WebhookTampering.md) | | [optional] -**cloned_app** | [**WebhookClonedApp**](WebhookClonedApp.md) | | [optional] -**factory_reset** | [**WebhookFactoryReset**](WebhookFactoryReset.md) | | [optional] -**jailbroken** | [**WebhookJailbroken**](WebhookJailbroken.md) | | [optional] -**frida** | [**WebhookFrida**](WebhookFrida.md) | | [optional] -**privacy_settings** | [**WebhookPrivacySettings**](WebhookPrivacySettings.md) | | [optional] -**virtual_machine** | [**WebhookVirtualMachine**](WebhookVirtualMachine.md) | | [optional] -**raw_device_attributes** | [**WebhookRawDeviceAttributes**](WebhookRawDeviceAttributes.md) | | [optional] -**high_activity** | [**WebhookHighActivity**](WebhookHighActivity.md) | | [optional] -**location_spoofing** | [**WebhookLocationSpoofing**](WebhookLocationSpoofing.md) | | [optional] -**suspect_score** | [**WebhookSuspectScore**](WebhookSuspectScore.md) | | [optional] -**remote_control** | [**WebhookRemoteControl**](WebhookRemoteControl.md) | | [optional] -**velocity** | [**WebhookVelocity**](WebhookVelocity.md) | | [optional] -**developer_tools** | [**WebhookDeveloperTools**](WebhookDeveloperTools.md) | | [optional] -**mitm_attack** | [**WebhookMitMAttack**](WebhookMitMAttack.md) | | [optional] -**replayed** | **bool** | `true` if we determined that this payload was replayed, `false` otherwise. | [optional] -**sdk** | [**SDK**](SDK.md) | | -**supplementary_ids** | [**WebhookSupplementaryIDs**](WebhookSupplementaryIDs.md) | | [optional] -**proximity** | [**WebhookProximity**](WebhookProximity.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) - diff --git a/docs/WebhookClonedApp.md b/docs/WebhookClonedApp.md deleted file mode 100644 index ea91a58e..00000000 --- a/docs/WebhookClonedApp.md +++ /dev/null @@ -1,9 +0,0 @@ -# WebhookClonedApp - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. | [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) - diff --git a/docs/WebhookDeveloperTools.md b/docs/WebhookDeveloperTools.md deleted file mode 100644 index 70cf9e2f..00000000 --- a/docs/WebhookDeveloperTools.md +++ /dev/null @@ -1,9 +0,0 @@ -# WebhookDeveloperTools - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. | [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) - diff --git a/docs/WebhookEmulator.md b/docs/WebhookEmulator.md deleted file mode 100644 index cde292d4..00000000 --- a/docs/WebhookEmulator.md +++ /dev/null @@ -1,9 +0,0 @@ -# WebhookEmulator - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. | [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) - diff --git a/docs/WebhookFactoryReset.md b/docs/WebhookFactoryReset.md deleted file mode 100644 index b4fcb010..00000000 --- a/docs/WebhookFactoryReset.md +++ /dev/null @@ -1,10 +0,0 @@ -# WebhookFactoryReset - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**time** | **datetime** | Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. | [optional] -**timestamp** | **int** | This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. | [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) - diff --git a/docs/WebhookFrida.md b/docs/WebhookFrida.md deleted file mode 100644 index 5a70b240..00000000 --- a/docs/WebhookFrida.md +++ /dev/null @@ -1,9 +0,0 @@ -# WebhookFrida - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. | [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) - diff --git a/docs/WebhookHighActivity.md b/docs/WebhookHighActivity.md deleted file mode 100644 index 6b5b5fd3..00000000 --- a/docs/WebhookHighActivity.md +++ /dev/null @@ -1,10 +0,0 @@ -# WebhookHighActivity - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | Flag indicating if the request came from a high-activity visitor. | -**daily_requests** | **int** | Number of requests from the same visitor in the previous day. | [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) - diff --git a/docs/WebhookIPBlocklist.md b/docs/WebhookIPBlocklist.md deleted file mode 100644 index 53d0eb8f..00000000 --- a/docs/WebhookIPBlocklist.md +++ /dev/null @@ -1,10 +0,0 @@ -# WebhookIPBlocklist - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. | [optional] -**details** | [**IPBlocklistDetails**](IPBlocklistDetails.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) - diff --git a/docs/WebhookIPInfo.md b/docs/WebhookIPInfo.md deleted file mode 100644 index abd8174c..00000000 --- a/docs/WebhookIPInfo.md +++ /dev/null @@ -1,12 +0,0 @@ -# WebhookIPInfo -Details about the request IP address. Has separate fields for v4 and v6 IP address versions. - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**v4** | [**IPInfoV4**](IPInfoV4.md) | | [optional] -**v6** | [**IPInfoV6**](IPInfoV6.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) - diff --git a/docs/WebhookJailbroken.md b/docs/WebhookJailbroken.md deleted file mode 100644 index 9e375559..00000000 --- a/docs/WebhookJailbroken.md +++ /dev/null @@ -1,9 +0,0 @@ -# WebhookJailbroken - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. | [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) - diff --git a/docs/WebhookLocationSpoofing.md b/docs/WebhookLocationSpoofing.md deleted file mode 100644 index b9a1a3d5..00000000 --- a/docs/WebhookLocationSpoofing.md +++ /dev/null @@ -1,9 +0,0 @@ -# WebhookLocationSpoofing - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | Flag indicating whether the request came from a mobile device with location spoofing enabled. | [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) - diff --git a/docs/WebhookMitMAttack.md b/docs/WebhookMitMAttack.md deleted file mode 100644 index 3ff714c6..00000000 --- a/docs/WebhookMitMAttack.md +++ /dev/null @@ -1,9 +0,0 @@ -# WebhookMitMAttack - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-overview#mitm-attack-detection) to learn more about this Smart Signal. | [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) - diff --git a/docs/WebhookPrivacySettings.md b/docs/WebhookPrivacySettings.md deleted file mode 100644 index 9c93aef5..00000000 --- a/docs/WebhookPrivacySettings.md +++ /dev/null @@ -1,9 +0,0 @@ -# WebhookPrivacySettings - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. | [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) - diff --git a/docs/WebhookProximity.md b/docs/WebhookProximity.md deleted file mode 100644 index 8637f9d4..00000000 --- a/docs/WebhookProximity.md +++ /dev/null @@ -1,14 +0,0 @@ -# WebhookProximity -Proximity ID represents a fixed geographical zone in a discrete global grid within which the device is observed. - - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**id** | **str** | A stable privacy-preserving identifier for a given proximity zone. | -**precision_radius** | **int** | The radius of the proximity zone’s precision level, in meters. | -**confidence** | **float** | A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/WebhookProxy.md b/docs/WebhookProxy.md deleted file mode 100644 index a6516094..00000000 --- a/docs/WebhookProxy.md +++ /dev/null @@ -1,11 +0,0 @@ -# WebhookProxy - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | IP address was used by a public proxy provider or belonged to a known recent residential proxy | [optional] -**confidence** | [**ProxyConfidence**](ProxyConfidence.md) | | [optional] -**details** | [**ProxyDetails**](ProxyDetails.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) - diff --git a/docs/WebhookRawDeviceAttributes.md b/docs/WebhookRawDeviceAttributes.md deleted file mode 100644 index 0809d908..00000000 --- a/docs/WebhookRawDeviceAttributes.md +++ /dev/null @@ -1,12 +0,0 @@ -# WebhookRawDeviceAttributes -It includes 35+ raw browser identification attributes to provide Fingerprint users with even more information than our standard visitor ID provides. This enables Fingerprint users to not have to run our open-source product in conjunction with Fingerprint Pro Plus and Enterprise to get those additional attributes. -Warning: The raw signals data can change at any moment as we improve the product. We cannot guarantee the internal shape of raw device attributes to be stable, so typical semantic versioning rules do not apply here. Use this data with caution without assuming a specific structure beyond the generic type provided here. - - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/WebhookRemoteControl.md b/docs/WebhookRemoteControl.md deleted file mode 100644 index 0d247c41..00000000 --- a/docs/WebhookRemoteControl.md +++ /dev/null @@ -1,12 +0,0 @@ -# WebhookRemoteControl -This signal is deprecated. - - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. | [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) - diff --git a/docs/WebhookRootApps.md b/docs/WebhookRootApps.md deleted file mode 100644 index 0d312ee4..00000000 --- a/docs/WebhookRootApps.md +++ /dev/null @@ -1,9 +0,0 @@ -# WebhookRootApps - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. | [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) - diff --git a/docs/WebhookSupplementaryIDs.md b/docs/WebhookSupplementaryIDs.md deleted file mode 100644 index a1185291..00000000 --- a/docs/WebhookSupplementaryIDs.md +++ /dev/null @@ -1,12 +0,0 @@ -# WebhookSupplementaryIDs -Other identities that have been established for a given Visitor. - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**standard** | [**SupplementaryID**](SupplementaryID.md) | | -**high_recall** | [**SupplementaryID**](SupplementaryID.md) | | - -[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) - diff --git a/docs/WebhookSuspectScore.md b/docs/WebhookSuspectScore.md deleted file mode 100644 index 578c18cd..00000000 --- a/docs/WebhookSuspectScore.md +++ /dev/null @@ -1,9 +0,0 @@ -# WebhookSuspectScore - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **int** | Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score | [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) - diff --git a/docs/WebhookTampering.md b/docs/WebhookTampering.md deleted file mode 100644 index e1b5a5da..00000000 --- a/docs/WebhookTampering.md +++ /dev/null @@ -1,11 +0,0 @@ -# WebhookTampering - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. | [optional] -**anomaly_score** | **float** | A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. | [optional] -**anti_detect_browser** | **bool** | Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. | [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) - diff --git a/docs/WebhookTor.md b/docs/WebhookTor.md deleted file mode 100644 index 3862d918..00000000 --- a/docs/WebhookTor.md +++ /dev/null @@ -1,9 +0,0 @@ -# WebhookTor - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | `true` if the request IP address is a known tor exit node, `false` otherwise. | [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) - diff --git a/docs/WebhookVPN.md b/docs/WebhookVPN.md deleted file mode 100644 index d050117f..00000000 --- a/docs/WebhookVPN.md +++ /dev/null @@ -1,13 +0,0 @@ -# WebhookVPN - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | VPN or other anonymizing service has been used when sending the request. | [optional] -**confidence** | [**VPNConfidence**](VPNConfidence.md) | | [optional] -**origin_timezone** | **str** | Local timezone which is used in timezoneMismatch method. | [optional] -**origin_country** | **str** | Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). | [optional] -**methods** | [**VPNMethods**](VPNMethods.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) - diff --git a/docs/WebhookVelocity.md b/docs/WebhookVelocity.md deleted file mode 100644 index 8429b68d..00000000 --- a/docs/WebhookVelocity.md +++ /dev/null @@ -1,32 +0,0 @@ -# WebhookVelocity -Sums key data points for a specific `visitorId`, `ipAddress` and `linkedId` at three distinct time -intervals: 5 minutes, 1 hour, and 24 hours as follows: - -- Number of distinct IP addresses associated to the visitor ID. -- Number of distinct linked IDs associated with the visitor ID. -- Number of distinct countries associated with the visitor ID. -- Number of identification events associated with the visitor ID. -- Number of identification events associated with the detected IP address. -- Number of distinct IP addresses associated with the provided linked ID. -- Number of distinct visitor IDs associated with the provided linked ID. - -The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, -`distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted -if the number of `events` for the visitor ID in the last 24 -hours (`events.intervals.['24h']`) is higher than 20.000. - - - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**distinct_ip** | [**VelocityData**](VelocityData.md) | | [optional] -**distinct_linked_id** | [**VelocityData**](VelocityData.md) | | [optional] -**distinct_country** | [**VelocityData**](VelocityData.md) | | [optional] -**events** | [**VelocityData**](VelocityData.md) | | [optional] -**ip_events** | [**VelocityData**](VelocityData.md) | | [optional] -**distinct_ip_by_linked_id** | [**VelocityData**](VelocityData.md) | | [optional] -**distinct_visitor_id_by_linked_id** | [**VelocityData**](VelocityData.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) - diff --git a/docs/WebhookVirtualMachine.md b/docs/WebhookVirtualMachine.md deleted file mode 100644 index 3ab8faf2..00000000 --- a/docs/WebhookVirtualMachine.md +++ /dev/null @@ -1,9 +0,0 @@ -# WebhookVirtualMachine - -## Properties -Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- -**result** | **bool** | `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. | [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) - diff --git a/fingerprint_server_sdk/__init__.py b/fingerprint_server_sdk/__init__.py index 70a85654..0689f7a9 100644 --- a/fingerprint_server_sdk/__init__.py +++ b/fingerprint_server_sdk/__init__.py @@ -3,142 +3,167 @@ # flake8: noqa """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +__version__ = "8.11.0" + +# Define package exports +__all__ = [ + "__version__", + "FingerprintApi", + "ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "BadRequestException", + "UnauthorizedException", + "ForbiddenException", + "NotFoundException", + "ConflictException", + "UnprocessableEntityException", + "TooManyRequestsException", + "ServiceException", + "WebhookValidation", + "DecryptionKey", + "DecryptionAlgorithm", + "UnsealError", + "UnsealAggregateError", + "unseal_event_response", + "BotInfo", + "BotResult", + "BrowserDetails", + "Canvas", + "Emoji", + "Error", + "ErrorCode", + "ErrorResponse", + "Event", + "EventRuleAction", + "EventRuleActionAllow", + "EventRuleActionBlock", + "EventSearch", + "EventUpdate", + "FontPreferences", + "Geolocation", + "GeolocationSubdivisionsInner", + "IPBlockList", + "IPInfo", + "IPInfoV4", + "IPInfoV6", + "Identification", + "IdentificationConfidence", + "Integration", + "IntegrationSubintegration", + "PluginsInner", + "PluginsInnerMimeTypesInner", + "Proximity", + "ProxyConfidence", + "ProxyDetails", + "RawDeviceAttributes", + "RequestHeaderModifications", + "RuleActionHeaderField", + "RuleActionType", + "SDK", + "SearchEventsBot", + "SearchEventsSdkPlatform", + "SearchEventsVpnConfidence", + "SupplementaryIDHighRecall", + "TamperingDetails", + "TouchSupport", + "Velocity", + "VelocityData", + "VpnConfidence", + "VpnMethods", + "WebGlBasics", + "WebGlExtensions", +] # import apis into sdk package from fingerprint_server_sdk.api.fingerprint_api import FingerprintApi + # import ApiClient +from fingerprint_server_sdk.api_response import ApiResponse from fingerprint_server_sdk.api_client import ApiClient from fingerprint_server_sdk.configuration import Configuration -# import BaseModel -from fingerprint_server_sdk.base_model import BaseModel +from fingerprint_server_sdk.exceptions import OpenApiException +from fingerprint_server_sdk.exceptions import ApiTypeError +from fingerprint_server_sdk.exceptions import ApiValueError +from fingerprint_server_sdk.exceptions import ApiKeyError +from fingerprint_server_sdk.exceptions import ApiAttributeError +from fingerprint_server_sdk.exceptions import ApiException +from fingerprint_server_sdk.exceptions import BadRequestException +from fingerprint_server_sdk.exceptions import NotFoundException +from fingerprint_server_sdk.exceptions import UnauthorizedException +from fingerprint_server_sdk.exceptions import ForbiddenException +from fingerprint_server_sdk.exceptions import ServiceException +from fingerprint_server_sdk.exceptions import ConflictException +from fingerprint_server_sdk.exceptions import UnprocessableEntityException +from fingerprint_server_sdk.exceptions import TooManyRequestsException + # import models into sdk package -from fingerprint_server_sdk.models.botd import Botd -from fingerprint_server_sdk.models.botd_bot import BotdBot -from fingerprint_server_sdk.models.botd_bot_result import BotdBotResult +from fingerprint_server_sdk.models.bot_info import BotInfo +from fingerprint_server_sdk.models.bot_result import BotResult from fingerprint_server_sdk.models.browser_details import BrowserDetails -from fingerprint_server_sdk.models.cloned_app import ClonedApp -from fingerprint_server_sdk.models.deprecated_geolocation import DeprecatedGeolocation -from fingerprint_server_sdk.models.developer_tools import DeveloperTools -from fingerprint_server_sdk.models.emulator import Emulator +from fingerprint_server_sdk.models.canvas import Canvas +from fingerprint_server_sdk.models.emoji import Emoji from fingerprint_server_sdk.models.error import Error from fingerprint_server_sdk.models.error_code import ErrorCode -from fingerprint_server_sdk.models.error_plain_response import ErrorPlainResponse from fingerprint_server_sdk.models.error_response import ErrorResponse -from fingerprint_server_sdk.models.events_get_response import EventsGetResponse -from fingerprint_server_sdk.models.events_update_request import EventsUpdateRequest -from fingerprint_server_sdk.models.factory_reset import FactoryReset -from fingerprint_server_sdk.models.frida import Frida +from fingerprint_server_sdk.models.event import Event +from fingerprint_server_sdk.models.event_rule_action import EventRuleAction +from fingerprint_server_sdk.models.event_rule_action_allow import EventRuleActionAllow +from fingerprint_server_sdk.models.event_rule_action_block import EventRuleActionBlock +from fingerprint_server_sdk.models.event_search import EventSearch +from fingerprint_server_sdk.models.event_update import EventUpdate +from fingerprint_server_sdk.models.font_preferences import FontPreferences from fingerprint_server_sdk.models.geolocation import Geolocation -from fingerprint_server_sdk.models.geolocation_city import GeolocationCity -from fingerprint_server_sdk.models.geolocation_continent import GeolocationContinent -from fingerprint_server_sdk.models.geolocation_country import GeolocationCountry -from fingerprint_server_sdk.models.geolocation_subdivision import GeolocationSubdivision -from fingerprint_server_sdk.models.geolocation_subdivisions import GeolocationSubdivisions -from fingerprint_server_sdk.models.high_activity import HighActivity -from fingerprint_server_sdk.models.ip_blocklist import IPBlocklist -from fingerprint_server_sdk.models.ip_blocklist_details import IPBlocklistDetails +from fingerprint_server_sdk.models.geolocation_subdivisions_inner import GeolocationSubdivisionsInner +from fingerprint_server_sdk.models.ip_block_list import IPBlockList from fingerprint_server_sdk.models.ip_info import IPInfo -from fingerprint_server_sdk.models.ip_info_asn import IPInfoASN -from fingerprint_server_sdk.models.ip_info_data_center import IPInfoDataCenter from fingerprint_server_sdk.models.ip_info_v4 import IPInfoV4 from fingerprint_server_sdk.models.ip_info_v6 import IPInfoV6 from fingerprint_server_sdk.models.identification import Identification from fingerprint_server_sdk.models.identification_confidence import IdentificationConfidence -from fingerprint_server_sdk.models.identification_seen_at import IdentificationSeenAt -from fingerprint_server_sdk.models.incognito import Incognito -from fingerprint_server_sdk.models.jailbroken import Jailbroken -from fingerprint_server_sdk.models.location_spoofing import LocationSpoofing -from fingerprint_server_sdk.models.mit_m_attack import MitMAttack -from fingerprint_server_sdk.models.privacy_settings import PrivacySettings -from fingerprint_server_sdk.models.product_botd import ProductBotd -from fingerprint_server_sdk.models.product_cloned_app import ProductClonedApp -from fingerprint_server_sdk.models.product_developer_tools import ProductDeveloperTools -from fingerprint_server_sdk.models.product_emulator import ProductEmulator -from fingerprint_server_sdk.models.product_factory_reset import ProductFactoryReset -from fingerprint_server_sdk.models.product_frida import ProductFrida -from fingerprint_server_sdk.models.product_high_activity import ProductHighActivity -from fingerprint_server_sdk.models.product_ip_blocklist import ProductIPBlocklist -from fingerprint_server_sdk.models.product_ip_info import ProductIPInfo -from fingerprint_server_sdk.models.product_identification import ProductIdentification -from fingerprint_server_sdk.models.product_incognito import ProductIncognito -from fingerprint_server_sdk.models.product_jailbroken import ProductJailbroken -from fingerprint_server_sdk.models.product_location_spoofing import ProductLocationSpoofing -from fingerprint_server_sdk.models.product_mit_m_attack import ProductMitMAttack -from fingerprint_server_sdk.models.product_privacy_settings import ProductPrivacySettings -from fingerprint_server_sdk.models.product_proximity import ProductProximity -from fingerprint_server_sdk.models.product_proxy import ProductProxy -from fingerprint_server_sdk.models.product_raw_device_attributes import ProductRawDeviceAttributes -from fingerprint_server_sdk.models.product_remote_control import ProductRemoteControl -from fingerprint_server_sdk.models.product_root_apps import ProductRootApps -from fingerprint_server_sdk.models.product_suspect_score import ProductSuspectScore -from fingerprint_server_sdk.models.product_tampering import ProductTampering -from fingerprint_server_sdk.models.product_tor import ProductTor -from fingerprint_server_sdk.models.product_vpn import ProductVPN -from fingerprint_server_sdk.models.product_velocity import ProductVelocity -from fingerprint_server_sdk.models.product_virtual_machine import ProductVirtualMachine -from fingerprint_server_sdk.models.products import Products +from fingerprint_server_sdk.models.integration import Integration +from fingerprint_server_sdk.models.integration_subintegration import IntegrationSubintegration +from fingerprint_server_sdk.models.plugins_inner import PluginsInner +from fingerprint_server_sdk.models.plugins_inner_mime_types_inner import PluginsInnerMimeTypesInner from fingerprint_server_sdk.models.proximity import Proximity -from fingerprint_server_sdk.models.proxy import Proxy from fingerprint_server_sdk.models.proxy_confidence import ProxyConfidence from fingerprint_server_sdk.models.proxy_details import ProxyDetails -from fingerprint_server_sdk.models.raw_device_attribute import RawDeviceAttribute -from fingerprint_server_sdk.models.raw_device_attribute_error import RawDeviceAttributeError from fingerprint_server_sdk.models.raw_device_attributes import RawDeviceAttributes -from fingerprint_server_sdk.models.related_visitor import RelatedVisitor -from fingerprint_server_sdk.models.related_visitors_response import RelatedVisitorsResponse -from fingerprint_server_sdk.models.remote_control import RemoteControl -from fingerprint_server_sdk.models.root_apps import RootApps +from fingerprint_server_sdk.models.request_header_modifications import RequestHeaderModifications +from fingerprint_server_sdk.models.rule_action_header_field import RuleActionHeaderField +from fingerprint_server_sdk.models.rule_action_type import RuleActionType from fingerprint_server_sdk.models.sdk import SDK -from fingerprint_server_sdk.models.search_events_response import SearchEventsResponse -from fingerprint_server_sdk.models.search_events_response_events import SearchEventsResponseEvents -from fingerprint_server_sdk.models.supplementary_id import SupplementaryID -from fingerprint_server_sdk.models.suspect_score import SuspectScore -from fingerprint_server_sdk.models.tag import Tag -from fingerprint_server_sdk.models.tampering import Tampering -from fingerprint_server_sdk.models.tor import Tor -from fingerprint_server_sdk.models.vpn import VPN -from fingerprint_server_sdk.models.vpn_confidence import VPNConfidence -from fingerprint_server_sdk.models.vpn_methods import VPNMethods +from fingerprint_server_sdk.models.search_events_bot import SearchEventsBot +from fingerprint_server_sdk.models.search_events_sdk_platform import SearchEventsSdkPlatform +from fingerprint_server_sdk.models.search_events_vpn_confidence import SearchEventsVpnConfidence +from fingerprint_server_sdk.models.supplementary_id_high_recall import SupplementaryIDHighRecall +from fingerprint_server_sdk.models.tampering_details import TamperingDetails +from fingerprint_server_sdk.models.touch_support import TouchSupport from fingerprint_server_sdk.models.velocity import Velocity from fingerprint_server_sdk.models.velocity_data import VelocityData -from fingerprint_server_sdk.models.velocity_intervals import VelocityIntervals -from fingerprint_server_sdk.models.virtual_machine import VirtualMachine -from fingerprint_server_sdk.models.visit import Visit -from fingerprint_server_sdk.models.visitors_get_response import VisitorsGetResponse -from fingerprint_server_sdk.models.webhook import Webhook -from fingerprint_server_sdk.models.webhook_cloned_app import WebhookClonedApp -from fingerprint_server_sdk.models.webhook_developer_tools import WebhookDeveloperTools -from fingerprint_server_sdk.models.webhook_emulator import WebhookEmulator -from fingerprint_server_sdk.models.webhook_factory_reset import WebhookFactoryReset -from fingerprint_server_sdk.models.webhook_frida import WebhookFrida -from fingerprint_server_sdk.models.webhook_high_activity import WebhookHighActivity -from fingerprint_server_sdk.models.webhook_ip_blocklist import WebhookIPBlocklist -from fingerprint_server_sdk.models.webhook_ip_info import WebhookIPInfo -from fingerprint_server_sdk.models.webhook_jailbroken import WebhookJailbroken -from fingerprint_server_sdk.models.webhook_location_spoofing import WebhookLocationSpoofing -from fingerprint_server_sdk.models.webhook_mit_m_attack import WebhookMitMAttack -from fingerprint_server_sdk.models.webhook_privacy_settings import WebhookPrivacySettings -from fingerprint_server_sdk.models.webhook_proximity import WebhookProximity -from fingerprint_server_sdk.models.webhook_proxy import WebhookProxy -from fingerprint_server_sdk.models.webhook_raw_device_attributes import WebhookRawDeviceAttributes -from fingerprint_server_sdk.models.webhook_remote_control import WebhookRemoteControl -from fingerprint_server_sdk.models.webhook_root_apps import WebhookRootApps -from fingerprint_server_sdk.models.webhook_supplementary_i_ds import WebhookSupplementaryIDs -from fingerprint_server_sdk.models.webhook_suspect_score import WebhookSuspectScore -from fingerprint_server_sdk.models.webhook_tampering import WebhookTampering -from fingerprint_server_sdk.models.webhook_tor import WebhookTor -from fingerprint_server_sdk.models.webhook_vpn import WebhookVPN -from fingerprint_server_sdk.models.webhook_velocity import WebhookVelocity -from fingerprint_server_sdk.models.webhook_virtual_machine import WebhookVirtualMachine +from fingerprint_server_sdk.models.vpn_confidence import VpnConfidence +from fingerprint_server_sdk.models.vpn_methods import VpnMethods +from fingerprint_server_sdk.models.web_gl_basics import WebGlBasics +from fingerprint_server_sdk.models.web_gl_extensions import WebGlExtensions # import custom methods into sdk package from fingerprint_server_sdk.webhook_validation import WebhookValidation -from fingerprint_server_sdk.sealed import ApiClientDeserializer, DecryptionAlgorithm, DecryptionKey, \ +from fingerprint_server_sdk.sealed import DecryptionAlgorithm, DecryptionKey, \ UnsealError, UnsealAggregateError, unseal_event_response diff --git a/fingerprint_server_sdk/api/fingerprint_api.py b/fingerprint_server_sdk/api/fingerprint_api.py index 89bc1ed4..996c960d 100644 --- a/fingerprint_server_sdk/api/fingerprint_api.py +++ b/fingerprint_server_sdk/api/fingerprint_api.py @@ -1,894 +1,1871 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) -import re # noqa: F401 -from multiprocessing import Pool -from multiprocessing.pool import ApplyResult as AsyncResult -from typing import Optional, Union + Do not edit the class manually. +""" # noqa: E501 + +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated + +from pydantic import Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import List, Optional, Union +from typing_extensions import Annotated +from fingerprint_server_sdk.models.event import Event +from fingerprint_server_sdk.models.event_search import EventSearch +from fingerprint_server_sdk.models.event_update import EventUpdate +from fingerprint_server_sdk.models.search_events_bot import SearchEventsBot +from fingerprint_server_sdk.models.search_events_sdk_platform import SearchEventsSdkPlatform +from fingerprint_server_sdk.models.search_events_vpn_confidence import SearchEventsVpnConfidence from fingerprint_server_sdk.configuration import Configuration -from fingerprint_server_sdk.api_client import ApiClient -from fingerprint_server_sdk.extend_exception import extend_exception -from fingerprint_server_sdk.rest import ApiException -from fingerprint_server_sdk.models.error_plain_response import ErrorPlainResponse # noqa: F401 -from fingerprint_server_sdk.models.error_response import ErrorResponse # noqa: F401 -from fingerprint_server_sdk.models.events_get_response import EventsGetResponse # noqa: F401 -from fingerprint_server_sdk.models.events_update_request import EventsUpdateRequest # noqa: F401 -from fingerprint_server_sdk.models.related_visitors_response import RelatedVisitorsResponse # noqa: F401 -from fingerprint_server_sdk.models.search_events_response import SearchEventsResponse # noqa: F401 -from fingerprint_server_sdk.models.visitors_get_response import VisitorsGetResponse # noqa: F401 +from fingerprint_server_sdk.api_client import ApiClient, RequestSerialized +from fingerprint_server_sdk.api_response import ApiResponse +from fingerprint_server_sdk.rest import RESTResponseType class FingerprintApi: - """NOTE: This class is auto generated by the swagger code generator program. + """Fingerprint Python Server SDK - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen + Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. 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. + + :param configuration: API client configuration. """ - def __init__(self, configuration: Optional[Configuration] = None, pool: Optional[Pool] = None): - if configuration is None: - raise ValueError("Missing the required parameter `configuration` when calling `FingerprintApi`") # noqa: E501 - self.api_client = ApiClient(configuration, pool=pool) - - def delete_visitor_data(self, visitor_id: str, **kwargs) -> Union[None, AsyncResult[None]]: # noqa: E501 - """Delete data by visitor ID # noqa: E501 - - 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 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_visitor_data(visitor_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param visitor_id: The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.delete_visitor_data_with_http_info(visitor_id, **kwargs) # noqa: E501 - else: - (data) = self.delete_visitor_data_with_http_info(visitor_id, **kwargs) # noqa: E501 - return data - - def delete_visitor_data_with_http_info(self, visitor_id: str, **kwargs): # noqa: E501 - """Delete data by visitor ID # noqa: E501 - - 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 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_visitor_data_with_http_info(visitor_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str visitor_id: The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [ - 'visitor_id', - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout'] - - params = locals() - for key, val in params['kwargs'].items(): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_visitor_data" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'visitor_id' is set - if 'visitor_id' not in params or params['visitor_id'] is None: - raise ValueError("Missing the required parameter `visitor_id` when calling `delete_visitor_data`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'visitor_id' in params: - path_params['visitor_id'] = params['visitor_id'] # noqa: E501 - - query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.11.0')] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501 - - try: - return self.api_client.call_api( - '/visitors/{visitor_id}', 'DELETE', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - except ApiException as e: - if e.status == 400: - error = self.api_client.deserialize(e, 'ErrorResponse', True) - raise extend_exception(e, error) - if e.status == 403: - error = self.api_client.deserialize(e, 'ErrorResponse', True) - raise extend_exception(e, error) - if e.status == 404: - error = self.api_client.deserialize(e, 'ErrorResponse', True) - raise extend_exception(e, error) - if e.status == 429: - error = self.api_client.deserialize(e, 'ErrorResponse', True) - raise extend_exception(e, error) - raise e - - def get_event(self, request_id: str, **kwargs) -> Union[EventsGetResponse, AsyncResult[EventsGetResponse]]: # noqa: E501 - """Get event by request ID # noqa: E501 - - 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 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_event(request_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param request_id: The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request. (required) - :return: EventsGetResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_event_with_http_info(request_id, **kwargs) # noqa: E501 - else: - (data) = self.get_event_with_http_info(request_id, **kwargs) # noqa: E501 - return data - - def get_event_with_http_info(self, request_id: str, **kwargs): # noqa: E501 - """Get event by request ID # noqa: E501 - - 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 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_event_with_http_info(request_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str request_id: The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request. (required) - :return: EventsGetResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [ - 'request_id', - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout'] - - params = locals() - for key, val in params['kwargs'].items(): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_event" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'request_id' is set - if 'request_id' not in params or params['request_id'] is None: - raise ValueError("Missing the required parameter `request_id` when calling `get_event`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'request_id' in params: - path_params['request_id'] = params['request_id'] # noqa: E501 - - query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.11.0')] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501 - - try: - return self.api_client.call_api( - '/events/{request_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='EventsGetResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - except ApiException as e: - if e.status == 403: - error = self.api_client.deserialize(e, 'ErrorResponse', True) - raise extend_exception(e, error) - if e.status == 404: - error = self.api_client.deserialize(e, 'ErrorResponse', True) - raise extend_exception(e, error) - raise e - - def get_related_visitors(self, visitor_id: str, **kwargs) -> Union[RelatedVisitorsResponse, AsyncResult[RelatedVisitorsResponse]]: # noqa: E501 - """Get Related Visitors # noqa: E501 - - 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 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_related_visitors(visitor_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :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) - :return: RelatedVisitorsResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_related_visitors_with_http_info(visitor_id, **kwargs) # noqa: E501 - else: - (data) = self.get_related_visitors_with_http_info(visitor_id, **kwargs) # noqa: E501 - return data - - def get_related_visitors_with_http_info(self, visitor_id: str, **kwargs): # noqa: E501 - """Get Related Visitors # noqa: E501 - - 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 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_related_visitors_with_http_info(visitor_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :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) - :return: RelatedVisitorsResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [ - 'visitor_id', - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout'] - - params = locals() - for key, val in params['kwargs'].items(): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_related_visitors" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'visitor_id' is set - if 'visitor_id' not in params or params['visitor_id'] is None: - raise ValueError("Missing the required parameter `visitor_id` when calling `get_related_visitors`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.11.0')] - if 'visitor_id' in params: - query_params.append(('visitor_id', params['visitor_id'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501 - - try: - return self.api_client.call_api( - '/related-visitors', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='RelatedVisitorsResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - except ApiException as e: - if e.status == 400: - error = self.api_client.deserialize(e, 'ErrorResponse', True) - raise extend_exception(e, error) - if e.status == 403: - error = self.api_client.deserialize(e, 'ErrorResponse', True) - raise extend_exception(e, error) - if e.status == 404: - error = self.api_client.deserialize(e, 'ErrorResponse', True) - raise extend_exception(e, error) - if e.status == 429: - error = self.api_client.deserialize(e, 'ErrorResponse', True) - raise extend_exception(e, error) - raise e - - def get_visits(self, visitor_id: str, **kwargs) -> Union[VisitorsGetResponse, AsyncResult[VisitorsGetResponse]]: # noqa: E501 - """Get visits by visitor ID # noqa: E501 - - 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 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_visits(visitor_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param visitor_id: Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. (required) - :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. - :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. - :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. - :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. - :param before: ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. - :return: VisitorsGetResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.get_visits_with_http_info(visitor_id, **kwargs) # noqa: E501 - else: - (data) = self.get_visits_with_http_info(visitor_id, **kwargs) # noqa: E501 - return data - - def get_visits_with_http_info(self, visitor_id: str, **kwargs): # noqa: E501 - """Get visits by visitor ID # noqa: E501 - - 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 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_visits_with_http_info(visitor_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param str visitor_id: Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. (required) - :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. - :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. - :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. - :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. - :param int before: ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. - :return: VisitorsGetResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [ - 'visitor_id', - 'request_id', - 'linked_id', - 'limit', - 'pagination_key', - 'before', - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout'] - - params = locals() - for key, val in params['kwargs'].items(): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method get_visits" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'visitor_id' is set - if 'visitor_id' not in params or params['visitor_id'] is None: - raise ValueError("Missing the required parameter `visitor_id` when calling `get_visits`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'visitor_id' in params: - path_params['visitor_id'] = params['visitor_id'] # noqa: E501 - - query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.11.0')] - if 'request_id' in params: - query_params.append(('request_id', params['request_id'])) # noqa: E501 - if 'linked_id' in params: - query_params.append(('linked_id', params['linked_id'])) # noqa: E501 - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'pagination_key' in params: - query_params.append(('paginationKey', params['pagination_key'])) # noqa: E501 - if 'before' in params: - query_params.append(('before', params['before'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501 - - try: - return self.api_client.call_api( - '/visitors/{visitor_id}', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='VisitorsGetResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - except ApiException as e: - if e.status == 400: - error = self.api_client.deserialize(e, 'ErrorPlainResponse', True) - raise extend_exception(e, error) - if e.status == 403: - error = self.api_client.deserialize(e, 'ErrorPlainResponse', True) - raise extend_exception(e, error) - if e.status == 429: - error = self.api_client.deserialize(e, 'ErrorPlainResponse', True) - raise extend_exception(e, error) - raise e - - def search_events(self, limit: int, **kwargs) -> Union[SearchEventsResponse, AsyncResult[SearchEventsResponse]]: # noqa: E501 - """Get events via search # noqa: E501 - - 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 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_events(limit, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param limit: Limit the number of events returned. (required) - :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` - :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`. - :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. - :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 - :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. + def __init__(self, configuration: Configuration) -> None: + self.api_client = ApiClient(configuration) + + + @validate_call + def delete_visitor_data( + self, + visitor_id: Annotated[StrictStr, Field(description="The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete data by visitor ID + + 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://docs.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://docs.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 [`/v4/events` API](https://docs.fingerprint.com/reference/server-api-v4-get-event) with an `event_id` that was made outside of the 10 days, you will still receive a valid response. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + + :param visitor_id: The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. (required) + :type visitor_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_visitor_data_serialize( + visitor_id=visitor_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_visitor_data_with_http_info( + self, + visitor_id: Annotated[StrictStr, Field(description="The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete data by visitor ID + + 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://docs.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://docs.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 [`/v4/events` API](https://docs.fingerprint.com/reference/server-api-v4-get-event) with an `event_id` that was made outside of the 10 days, you will still receive a valid response. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + + :param visitor_id: The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. (required) + :type visitor_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_visitor_data_serialize( + visitor_id=visitor_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_visitor_data_without_preload_content( + self, + visitor_id: Annotated[StrictStr, Field(description="The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete.")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete data by visitor ID + + 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://docs.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://docs.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 [`/v4/events` API](https://docs.fingerprint.com/reference/server-api-v4-get-event) with an `event_id` that was made outside of the 10 days, you will still receive a valid response. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + + :param visitor_id: The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. (required) + :type visitor_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_visitor_data_serialize( + visitor_id=visitor_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '429': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_visitor_data_serialize( + self, + visitor_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if visitor_id is not None: + _path_params['visitor_id'] = visitor_id + + + + + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/visitors/{visitor_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def get_event( + self, + event_id: Annotated[StrictStr, Field(description="The unique [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) of each identification request (`requestId` can be used in its place).")], + ruleset_id: Annotated[Optional[StrictStr], Field(description="The ID of the ruleset to evaluate against the event, producing the action to take for this event. The resulting action is returned in the `rule_action` attribute of the response. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Event: + """Get an event by event ID + + Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. + + :param event_id: The unique [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) of each identification request (`requestId` can be used in its place). (required) + :type event_id: str + :param ruleset_id: The ID of the ruleset to evaluate against the event, producing the action to take for this event. The resulting action is returned in the `rule_action` attribute of the response. + :type ruleset_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_event_serialize( + event_id=event_id, + ruleset_id=ruleset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '400': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_event_with_http_info( + self, + event_id: Annotated[StrictStr, Field(description="The unique [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) of each identification request (`requestId` can be used in its place).")], + ruleset_id: Annotated[Optional[StrictStr], Field(description="The ID of the ruleset to evaluate against the event, producing the action to take for this event. The resulting action is returned in the `rule_action` attribute of the response. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Event]: + """Get an event by event ID + + Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. + + :param event_id: The unique [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) of each identification request (`requestId` can be used in its place). (required) + :type event_id: str + :param ruleset_id: The ID of the ruleset to evaluate against the event, producing the action to take for this event. The resulting action is returned in the `rule_action` attribute of the response. + :type ruleset_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_event_serialize( + event_id=event_id, + ruleset_id=ruleset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '400': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_event_without_preload_content( + self, + event_id: Annotated[StrictStr, Field(description="The unique [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) of each identification request (`requestId` can be used in its place).")], + ruleset_id: Annotated[Optional[StrictStr], Field(description="The ID of the ruleset to evaluate against the event, producing the action to take for this event. The resulting action is returned in the `rule_action` attribute of the response. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get an event by event ID + + Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. + + :param event_id: The unique [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) of each identification request (`requestId` can be used in its place). (required) + :type event_id: str + :param ruleset_id: The ID of the ruleset to evaluate against the event, producing the action to take for this event. The resulting action is returned in the `rule_action` attribute of the response. + :type ruleset_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_event_serialize( + event_id=event_id, + ruleset_id=ruleset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Event", + '400': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '429': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_event_serialize( + self, + event_id, + ruleset_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if event_id is not None: + _path_params['event_id'] = event_id + + # process the query parameters + if ruleset_id is not None: + + _query_params.append(('ruleset_id', ruleset_id)) + + + + + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/events/{event_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def search_events( + self, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Limit the number of events returned. ")] = None, + pagination_key: Annotated[Optional[StrictStr], Field(description="Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The pagination key is an arbitrary string that should not be interpreted in any way and should be passed as-is. 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?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=1740815825085` ")] = None, + visitor_id: Annotated[Optional[StrictStr], Field(description="Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. ")] = None, + bot: Annotated[Optional[SearchEventsBot], Field(description="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 `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. ")] = None, + ip_address: Annotated[Optional[StrictStr], Field(description="Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 ")] = None, + asn: Annotated[Optional[StrictStr], Field(description="Filter events by the ASN associated with the event's IP address. This corresponds to the `ip_info.(v4|v6).asn` property in the response. ")] = None, + linked_id: Annotated[Optional[StrictStr], Field(description="Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-v4-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. ")] = None, + url: Annotated[Optional[StrictStr], Field(description="Filter events by the URL (`url` property) associated with the event. ")] = None, + bundle_id: Annotated[Optional[StrictStr], Field(description="Filter events by the Bundle ID (iOS) associated with the event. ")] = None, + package_name: Annotated[Optional[StrictStr], Field(description="Filter events by the Package Name (Android) associated with the event. ")] = None, + origin: Annotated[Optional[StrictStr], Field(description="Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) ")] = None, + start: Annotated[Optional[StrictInt], Field(description="Filter events with a timestamp greater than the start time, in Unix time (milliseconds). ")] = None, + end: Annotated[Optional[StrictInt], Field(description="Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). ")] = None, + reverse: Annotated[Optional[StrictBool], Field(description="Sort events in reverse timestamp order. ")] = None, + suspect: Annotated[Optional[StrictBool], Field(description="Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > 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. ")] = None, + vpn: Annotated[Optional[StrictBool], Field(description="Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. ")] = None, + virtual_machine: Annotated[Optional[StrictBool], Field(description="Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. ")] = None, + tampering: Annotated[Optional[StrictBool], Field(description="Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. ")] = None, + anti_detect_browser: Annotated[Optional[StrictBool], Field(description="Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. ")] = None, + incognito: Annotated[Optional[StrictBool], Field(description="Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. ")] = None, + privacy_settings: Annotated[Optional[StrictBool], Field(description="Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. ")] = None, + jailbroken: Annotated[Optional[StrictBool], Field(description="Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. ")] = None, + frida: Annotated[Optional[StrictBool], Field(description="Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. ")] = None, + factory_reset: Annotated[Optional[StrictBool], Field(description="Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. ")] = None, + cloned_app: Annotated[Optional[StrictBool], Field(description="Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. ")] = None, + emulator: Annotated[Optional[StrictBool], Field(description="Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. ")] = None, + root_apps: Annotated[Optional[StrictBool], Field(description="Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. ")] = None, + vpn_confidence: Annotated[Optional[SearchEventsVpnConfidence], Field(description="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 `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. ")] = None, + min_suspect_score: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. ")] = None, + developer_tools: Annotated[Optional[StrictBool], Field(description="Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. ")] = None, + location_spoofing: Annotated[Optional[StrictBool], Field(description="Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. ")] = None, + mitm_attack: Annotated[Optional[StrictBool], Field(description="Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. ")] = None, + proxy: Annotated[Optional[StrictBool], Field(description="Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. ")] = None, + sdk_version: Annotated[Optional[StrictStr], Field(description="Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` ")] = None, + sdk_platform: Annotated[Optional[SearchEventsSdkPlatform], Field(description="Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. ")] = None, + environment: Annotated[Optional[List[StrictStr]], Field(description="Filter for events by providing one or more environment IDs (`environment_id` property). ")] = None, + proximity_id: Annotated[Optional[StrictStr], Field(description="Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `proximity.id` property matching the provided ID are returned. Events without a `proximity` result are left out of the response. ")] = None, + total_hits: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. ")] = None, + tor_node: Annotated[Optional[StrictBool], Field(description="Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> EventSearch: + """Search events + + ## Search The `/v4/events` endpoint provides a convenient way to search for past events based on specific parameters. Typical use cases and queries include: - Searching for events associated with a single `visitor_id` within a time range to get historical behavior of a visitor. - Searching for events associated with a single `linked_id` within a time range to get all events associated with your internal account identifier. - Excluding all bot traffic from the query (`good` and `bad` bots) If you don't provide `start` or `end` parameters, the default search range is the **last 7 days**. ### Filtering events with the `suspect` flag The `/v4/events` endpoint unlocks a powerful method for fraud protection analytics. The `suspect` flag is exposed in all events where it was previously set by the update API. You can also apply the `suspect` query parameter as a filter to find all potentially fraudulent activity that you previously marked as `suspect`. This helps identify patterns of fraudulent behavior. ### Environment scoping If you use a secret key that is scoped to an environment, you will only get events associated with the same environment. With a workspace-scoped environment, you will get events from all environments. Smart Signals not activated for your workspace or are not included in the response. + + :param limit: Limit the number of events returned. + :type limit: int + :param pagination_key: Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The pagination key is an arbitrary string that should not be interpreted in any way and should be passed as-is. 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?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=1740815825085` + :type pagination_key: str + :param visitor_id: Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. + :type visitor_id: str + :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 `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. + :type bot: SearchEventsBot + :param ip_address: Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 + :type ip_address: str + :param asn: Filter events by the ASN associated with the event's IP address. This corresponds to the `ip_info.(v4|v6).asn` property in the response. + :type asn: str + :param linked_id: Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-v4-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. + :type linked_id: str + :param url: Filter events by the URL (`url` property) associated with the event. + :type url: str + :param bundle_id: Filter events by the Bundle ID (iOS) associated with the event. + :type bundle_id: str + :param package_name: Filter events by the Package Name (Android) associated with the event. + :type package_name: str + :param origin: Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) + :type origin: str :param start: Filter events with a timestamp greater than the start time, in Unix time (milliseconds). + :type start: int :param end: Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). + :type end: int :param reverse: Sort events in reverse timestamp order. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :param sdk_version: Filter events by a specific SDK version associated with the identification event. Example: `3.11.14` - :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. - :param environment: Filter for events by providing one or more environment IDs. - :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. - :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. - :return: SearchEventsResponse - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.search_events_with_http_info(limit, **kwargs) # noqa: E501 - else: - (data) = self.search_events_with_http_info(limit, **kwargs) # noqa: E501 - return data - - def search_events_with_http_info(self, limit: int, **kwargs): # noqa: E501 - """Get events via search # noqa: E501 - - 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 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_events_with_http_info(limit, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param int limit: Limit the number of events returned. (required) - :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` - :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`. - :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. - :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 - :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. - :param int start: Filter events with a timestamp greater than the start time, in Unix time (milliseconds). - :param int end: Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). - :param bool reverse: Sort events in reverse timestamp order. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :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. - :param str sdk_version: Filter events by a specific SDK version associated with the identification event. Example: `3.11.14` - :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. - :param list[str] environment: Filter for events by providing one or more environment IDs. - :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. - :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. - :return: SearchEventsResponse - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [ - 'limit', - 'pagination_key', - 'visitor_id', - 'bot', - 'ip_address', - 'linked_id', - 'start', - 'end', - 'reverse', - 'suspect', - 'vpn', - 'virtual_machine', - 'tampering', - 'anti_detect_browser', - 'incognito', - 'privacy_settings', - 'jailbroken', - 'frida', - 'factory_reset', - 'cloned_app', - 'emulator', - 'root_apps', - 'vpn_confidence', - 'min_suspect_score', - 'ip_blocklist', - 'datacenter', - 'developer_tools', - 'location_spoofing', - 'mitm_attack', - 'proxy', - 'sdk_version', - 'sdk_platform', - 'environment', - 'proximity_id', - 'proximity_precision_radius', - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout'] - - params = locals() - for key, val in params['kwargs'].items(): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method search_events" % key - ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'limit' is set - if 'limit' not in params or params['limit'] is None: - raise ValueError("Missing the required parameter `limit` when calling `search_events`") # noqa: E501 - - collection_formats = {} - - path_params = {} - - query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.11.0')] - if 'limit' in params: - query_params.append(('limit', params['limit'])) # noqa: E501 - if 'pagination_key' in params: - query_params.append(('pagination_key', params['pagination_key'])) # noqa: E501 - if 'visitor_id' in params: - query_params.append(('visitor_id', params['visitor_id'])) # noqa: E501 - if 'bot' in params: - query_params.append(('bot', params['bot'])) # noqa: E501 - if 'ip_address' in params: - query_params.append(('ip_address', params['ip_address'])) # noqa: E501 - if 'linked_id' in params: - query_params.append(('linked_id', params['linked_id'])) # noqa: E501 - if 'start' in params: - query_params.append(('start', params['start'])) # noqa: E501 - if 'end' in params: - query_params.append(('end', params['end'])) # noqa: E501 - if 'reverse' in params: - query_params.append(('reverse', params['reverse'])) # noqa: E501 - if 'suspect' in params: - query_params.append(('suspect', params['suspect'])) # noqa: E501 - if 'vpn' in params: - query_params.append(('vpn', params['vpn'])) # noqa: E501 - if 'virtual_machine' in params: - query_params.append(('virtual_machine', params['virtual_machine'])) # noqa: E501 - if 'tampering' in params: - query_params.append(('tampering', params['tampering'])) # noqa: E501 - if 'anti_detect_browser' in params: - query_params.append(('anti_detect_browser', params['anti_detect_browser'])) # noqa: E501 - if 'incognito' in params: - query_params.append(('incognito', params['incognito'])) # noqa: E501 - if 'privacy_settings' in params: - query_params.append(('privacy_settings', params['privacy_settings'])) # noqa: E501 - if 'jailbroken' in params: - query_params.append(('jailbroken', params['jailbroken'])) # noqa: E501 - if 'frida' in params: - query_params.append(('frida', params['frida'])) # noqa: E501 - if 'factory_reset' in params: - query_params.append(('factory_reset', params['factory_reset'])) # noqa: E501 - if 'cloned_app' in params: - query_params.append(('cloned_app', params['cloned_app'])) # noqa: E501 - if 'emulator' in params: - query_params.append(('emulator', params['emulator'])) # noqa: E501 - if 'root_apps' in params: - query_params.append(('root_apps', params['root_apps'])) # noqa: E501 - if 'vpn_confidence' in params: - query_params.append(('vpn_confidence', params['vpn_confidence'])) # noqa: E501 - if 'min_suspect_score' in params: - query_params.append(('min_suspect_score', params['min_suspect_score'])) # noqa: E501 - if 'ip_blocklist' in params: - query_params.append(('ip_blocklist', params['ip_blocklist'])) # noqa: E501 - if 'datacenter' in params: - query_params.append(('datacenter', params['datacenter'])) # noqa: E501 - if 'developer_tools' in params: - query_params.append(('developer_tools', params['developer_tools'])) # noqa: E501 - if 'location_spoofing' in params: - query_params.append(('location_spoofing', params['location_spoofing'])) # noqa: E501 - if 'mitm_attack' in params: - query_params.append(('mitm_attack', params['mitm_attack'])) # noqa: E501 - if 'proxy' in params: - query_params.append(('proxy', params['proxy'])) # noqa: E501 - if 'sdk_version' in params: - query_params.append(('sdk_version', params['sdk_version'])) # noqa: E501 - if 'sdk_platform' in params: - query_params.append(('sdk_platform', params['sdk_platform'])) # noqa: E501 - if 'environment' in params: - query_params.append(('environment', params['environment'])) # noqa: E501 - collection_formats['environment'] = 'multi' # noqa: E501 - if 'proximity_id' in params: - query_params.append(('proximity_id', params['proximity_id'])) # noqa: E501 - if 'proximity_precision_radius' in params: - query_params.append(('proximity_precision_radius', params['proximity_precision_radius'])) # noqa: E501 - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501 - - try: - return self.api_client.call_api( - '/events/search', 'GET', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type='SearchEventsResponse', # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - except ApiException as e: - if e.status == 400: - error = self.api_client.deserialize(e, 'ErrorResponse', True) - raise extend_exception(e, error) - if e.status == 403: - error = self.api_client.deserialize(e, 'ErrorResponse', True) - raise extend_exception(e, error) - raise e - - def update_event(self, body: EventsUpdateRequest, request_id: str, **kwargs) -> Union[None, AsyncResult[None]]: # noqa: E501 - """Update an event with a given request ID # noqa: E501 - - 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 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_event(body, request_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param body: (required) - :param request_id: The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.update_event_with_http_info(body, request_id, **kwargs) # noqa: E501 + :type reverse: bool + :param suspect: Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > 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. + :type suspect: bool + :param vpn: Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. + :type vpn: bool + :param virtual_machine: Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. + :type virtual_machine: bool + :param tampering: Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. + :type tampering: bool + :param anti_detect_browser: Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. + :type anti_detect_browser: bool + :param incognito: Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. + :type incognito: bool + :param privacy_settings: Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. + :type privacy_settings: bool + :param jailbroken: Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. + :type jailbroken: bool + :param frida: Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. + :type frida: bool + :param factory_reset: Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. + :type factory_reset: bool + :param cloned_app: Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. + :type cloned_app: bool + :param emulator: Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. + :type emulator: bool + :param root_apps: Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. + :type root_apps: bool + :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 `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. + :type vpn_confidence: SearchEventsVpnConfidence + :param min_suspect_score: Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. + :type min_suspect_score: float + :param developer_tools: Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. + :type developer_tools: bool + :param location_spoofing: Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. + :type location_spoofing: bool + :param mitm_attack: Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. + :type mitm_attack: bool + :param proxy: Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. + :type proxy: bool + :param sdk_version: Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` + :type sdk_version: str + :param sdk_platform: Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. + :type sdk_platform: SearchEventsSdkPlatform + :param environment: Filter for events by providing one or more environment IDs (`environment_id` property). + :type environment: List[str] + :param proximity_id: Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `proximity.id` property matching the provided ID are returned. Events without a `proximity` result are left out of the response. + :type proximity_id: str + :param total_hits: When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. + :type total_hits: int + :param tor_node: Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. + :type tor_node: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_events_serialize( + limit=limit, + pagination_key=pagination_key, + visitor_id=visitor_id, + bot=bot, + ip_address=ip_address, + asn=asn, + linked_id=linked_id, + url=url, + bundle_id=bundle_id, + package_name=package_name, + origin=origin, + start=start, + end=end, + reverse=reverse, + suspect=suspect, + vpn=vpn, + virtual_machine=virtual_machine, + tampering=tampering, + anti_detect_browser=anti_detect_browser, + incognito=incognito, + privacy_settings=privacy_settings, + jailbroken=jailbroken, + frida=frida, + factory_reset=factory_reset, + cloned_app=cloned_app, + emulator=emulator, + root_apps=root_apps, + vpn_confidence=vpn_confidence, + min_suspect_score=min_suspect_score, + developer_tools=developer_tools, + location_spoofing=location_spoofing, + mitm_attack=mitm_attack, + proxy=proxy, + sdk_version=sdk_version, + sdk_platform=sdk_platform, + environment=environment, + proximity_id=proximity_id, + total_hits=total_hits, + tor_node=tor_node, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventSearch", + '400': "ErrorResponse", + '403': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def search_events_with_http_info( + self, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Limit the number of events returned. ")] = None, + pagination_key: Annotated[Optional[StrictStr], Field(description="Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The pagination key is an arbitrary string that should not be interpreted in any way and should be passed as-is. 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?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=1740815825085` ")] = None, + visitor_id: Annotated[Optional[StrictStr], Field(description="Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. ")] = None, + bot: Annotated[Optional[SearchEventsBot], Field(description="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 `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. ")] = None, + ip_address: Annotated[Optional[StrictStr], Field(description="Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 ")] = None, + asn: Annotated[Optional[StrictStr], Field(description="Filter events by the ASN associated with the event's IP address. This corresponds to the `ip_info.(v4|v6).asn` property in the response. ")] = None, + linked_id: Annotated[Optional[StrictStr], Field(description="Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-v4-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. ")] = None, + url: Annotated[Optional[StrictStr], Field(description="Filter events by the URL (`url` property) associated with the event. ")] = None, + bundle_id: Annotated[Optional[StrictStr], Field(description="Filter events by the Bundle ID (iOS) associated with the event. ")] = None, + package_name: Annotated[Optional[StrictStr], Field(description="Filter events by the Package Name (Android) associated with the event. ")] = None, + origin: Annotated[Optional[StrictStr], Field(description="Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) ")] = None, + start: Annotated[Optional[StrictInt], Field(description="Filter events with a timestamp greater than the start time, in Unix time (milliseconds). ")] = None, + end: Annotated[Optional[StrictInt], Field(description="Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). ")] = None, + reverse: Annotated[Optional[StrictBool], Field(description="Sort events in reverse timestamp order. ")] = None, + suspect: Annotated[Optional[StrictBool], Field(description="Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > 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. ")] = None, + vpn: Annotated[Optional[StrictBool], Field(description="Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. ")] = None, + virtual_machine: Annotated[Optional[StrictBool], Field(description="Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. ")] = None, + tampering: Annotated[Optional[StrictBool], Field(description="Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. ")] = None, + anti_detect_browser: Annotated[Optional[StrictBool], Field(description="Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. ")] = None, + incognito: Annotated[Optional[StrictBool], Field(description="Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. ")] = None, + privacy_settings: Annotated[Optional[StrictBool], Field(description="Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. ")] = None, + jailbroken: Annotated[Optional[StrictBool], Field(description="Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. ")] = None, + frida: Annotated[Optional[StrictBool], Field(description="Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. ")] = None, + factory_reset: Annotated[Optional[StrictBool], Field(description="Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. ")] = None, + cloned_app: Annotated[Optional[StrictBool], Field(description="Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. ")] = None, + emulator: Annotated[Optional[StrictBool], Field(description="Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. ")] = None, + root_apps: Annotated[Optional[StrictBool], Field(description="Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. ")] = None, + vpn_confidence: Annotated[Optional[SearchEventsVpnConfidence], Field(description="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 `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. ")] = None, + min_suspect_score: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. ")] = None, + developer_tools: Annotated[Optional[StrictBool], Field(description="Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. ")] = None, + location_spoofing: Annotated[Optional[StrictBool], Field(description="Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. ")] = None, + mitm_attack: Annotated[Optional[StrictBool], Field(description="Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. ")] = None, + proxy: Annotated[Optional[StrictBool], Field(description="Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. ")] = None, + sdk_version: Annotated[Optional[StrictStr], Field(description="Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` ")] = None, + sdk_platform: Annotated[Optional[SearchEventsSdkPlatform], Field(description="Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. ")] = None, + environment: Annotated[Optional[List[StrictStr]], Field(description="Filter for events by providing one or more environment IDs (`environment_id` property). ")] = None, + proximity_id: Annotated[Optional[StrictStr], Field(description="Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `proximity.id` property matching the provided ID are returned. Events without a `proximity` result are left out of the response. ")] = None, + total_hits: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. ")] = None, + tor_node: Annotated[Optional[StrictBool], Field(description="Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[EventSearch]: + """Search events + + ## Search The `/v4/events` endpoint provides a convenient way to search for past events based on specific parameters. Typical use cases and queries include: - Searching for events associated with a single `visitor_id` within a time range to get historical behavior of a visitor. - Searching for events associated with a single `linked_id` within a time range to get all events associated with your internal account identifier. - Excluding all bot traffic from the query (`good` and `bad` bots) If you don't provide `start` or `end` parameters, the default search range is the **last 7 days**. ### Filtering events with the `suspect` flag The `/v4/events` endpoint unlocks a powerful method for fraud protection analytics. The `suspect` flag is exposed in all events where it was previously set by the update API. You can also apply the `suspect` query parameter as a filter to find all potentially fraudulent activity that you previously marked as `suspect`. This helps identify patterns of fraudulent behavior. ### Environment scoping If you use a secret key that is scoped to an environment, you will only get events associated with the same environment. With a workspace-scoped environment, you will get events from all environments. Smart Signals not activated for your workspace or are not included in the response. + + :param limit: Limit the number of events returned. + :type limit: int + :param pagination_key: Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The pagination key is an arbitrary string that should not be interpreted in any way and should be passed as-is. 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?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=1740815825085` + :type pagination_key: str + :param visitor_id: Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. + :type visitor_id: str + :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 `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. + :type bot: SearchEventsBot + :param ip_address: Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 + :type ip_address: str + :param asn: Filter events by the ASN associated with the event's IP address. This corresponds to the `ip_info.(v4|v6).asn` property in the response. + :type asn: str + :param linked_id: Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-v4-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. + :type linked_id: str + :param url: Filter events by the URL (`url` property) associated with the event. + :type url: str + :param bundle_id: Filter events by the Bundle ID (iOS) associated with the event. + :type bundle_id: str + :param package_name: Filter events by the Package Name (Android) associated with the event. + :type package_name: str + :param origin: Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) + :type origin: str + :param start: Filter events with a timestamp greater than the start time, in Unix time (milliseconds). + :type start: int + :param end: Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). + :type end: int + :param reverse: Sort events in reverse timestamp order. + :type reverse: bool + :param suspect: Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > 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. + :type suspect: bool + :param vpn: Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. + :type vpn: bool + :param virtual_machine: Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. + :type virtual_machine: bool + :param tampering: Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. + :type tampering: bool + :param anti_detect_browser: Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. + :type anti_detect_browser: bool + :param incognito: Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. + :type incognito: bool + :param privacy_settings: Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. + :type privacy_settings: bool + :param jailbroken: Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. + :type jailbroken: bool + :param frida: Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. + :type frida: bool + :param factory_reset: Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. + :type factory_reset: bool + :param cloned_app: Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. + :type cloned_app: bool + :param emulator: Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. + :type emulator: bool + :param root_apps: Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. + :type root_apps: bool + :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 `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. + :type vpn_confidence: SearchEventsVpnConfidence + :param min_suspect_score: Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. + :type min_suspect_score: float + :param developer_tools: Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. + :type developer_tools: bool + :param location_spoofing: Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. + :type location_spoofing: bool + :param mitm_attack: Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. + :type mitm_attack: bool + :param proxy: Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. + :type proxy: bool + :param sdk_version: Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` + :type sdk_version: str + :param sdk_platform: Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. + :type sdk_platform: SearchEventsSdkPlatform + :param environment: Filter for events by providing one or more environment IDs (`environment_id` property). + :type environment: List[str] + :param proximity_id: Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `proximity.id` property matching the provided ID are returned. Events without a `proximity` result are left out of the response. + :type proximity_id: str + :param total_hits: When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. + :type total_hits: int + :param tor_node: Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. + :type tor_node: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_events_serialize( + limit=limit, + pagination_key=pagination_key, + visitor_id=visitor_id, + bot=bot, + ip_address=ip_address, + asn=asn, + linked_id=linked_id, + url=url, + bundle_id=bundle_id, + package_name=package_name, + origin=origin, + start=start, + end=end, + reverse=reverse, + suspect=suspect, + vpn=vpn, + virtual_machine=virtual_machine, + tampering=tampering, + anti_detect_browser=anti_detect_browser, + incognito=incognito, + privacy_settings=privacy_settings, + jailbroken=jailbroken, + frida=frida, + factory_reset=factory_reset, + cloned_app=cloned_app, + emulator=emulator, + root_apps=root_apps, + vpn_confidence=vpn_confidence, + min_suspect_score=min_suspect_score, + developer_tools=developer_tools, + location_spoofing=location_spoofing, + mitm_attack=mitm_attack, + proxy=proxy, + sdk_version=sdk_version, + sdk_platform=sdk_platform, + environment=environment, + proximity_id=proximity_id, + total_hits=total_hits, + tor_node=tor_node, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventSearch", + '400': "ErrorResponse", + '403': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def search_events_without_preload_content( + self, + limit: Annotated[Optional[Annotated[int, Field(le=100, strict=True, ge=1)]], Field(description="Limit the number of events returned. ")] = None, + pagination_key: Annotated[Optional[StrictStr], Field(description="Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The pagination key is an arbitrary string that should not be interpreted in any way and should be passed as-is. 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?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=1740815825085` ")] = None, + visitor_id: Annotated[Optional[StrictStr], Field(description="Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. ")] = None, + bot: Annotated[Optional[SearchEventsBot], Field(description="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 `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. ")] = None, + ip_address: Annotated[Optional[StrictStr], Field(description="Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 ")] = None, + asn: Annotated[Optional[StrictStr], Field(description="Filter events by the ASN associated with the event's IP address. This corresponds to the `ip_info.(v4|v6).asn` property in the response. ")] = None, + linked_id: Annotated[Optional[StrictStr], Field(description="Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-v4-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. ")] = None, + url: Annotated[Optional[StrictStr], Field(description="Filter events by the URL (`url` property) associated with the event. ")] = None, + bundle_id: Annotated[Optional[StrictStr], Field(description="Filter events by the Bundle ID (iOS) associated with the event. ")] = None, + package_name: Annotated[Optional[StrictStr], Field(description="Filter events by the Package Name (Android) associated with the event. ")] = None, + origin: Annotated[Optional[StrictStr], Field(description="Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) ")] = None, + start: Annotated[Optional[StrictInt], Field(description="Filter events with a timestamp greater than the start time, in Unix time (milliseconds). ")] = None, + end: Annotated[Optional[StrictInt], Field(description="Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). ")] = None, + reverse: Annotated[Optional[StrictBool], Field(description="Sort events in reverse timestamp order. ")] = None, + suspect: Annotated[Optional[StrictBool], Field(description="Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > 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. ")] = None, + vpn: Annotated[Optional[StrictBool], Field(description="Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. ")] = None, + virtual_machine: Annotated[Optional[StrictBool], Field(description="Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. ")] = None, + tampering: Annotated[Optional[StrictBool], Field(description="Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. ")] = None, + anti_detect_browser: Annotated[Optional[StrictBool], Field(description="Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. ")] = None, + incognito: Annotated[Optional[StrictBool], Field(description="Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. ")] = None, + privacy_settings: Annotated[Optional[StrictBool], Field(description="Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. ")] = None, + jailbroken: Annotated[Optional[StrictBool], Field(description="Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. ")] = None, + frida: Annotated[Optional[StrictBool], Field(description="Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. ")] = None, + factory_reset: Annotated[Optional[StrictBool], Field(description="Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. ")] = None, + cloned_app: Annotated[Optional[StrictBool], Field(description="Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. ")] = None, + emulator: Annotated[Optional[StrictBool], Field(description="Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. ")] = None, + root_apps: Annotated[Optional[StrictBool], Field(description="Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. ")] = None, + vpn_confidence: Annotated[Optional[SearchEventsVpnConfidence], Field(description="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 `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. ")] = None, + min_suspect_score: Annotated[Optional[Union[StrictFloat, StrictInt]], Field(description="Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. ")] = None, + developer_tools: Annotated[Optional[StrictBool], Field(description="Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. ")] = None, + location_spoofing: Annotated[Optional[StrictBool], Field(description="Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. ")] = None, + mitm_attack: Annotated[Optional[StrictBool], Field(description="Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. ")] = None, + proxy: Annotated[Optional[StrictBool], Field(description="Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. ")] = None, + sdk_version: Annotated[Optional[StrictStr], Field(description="Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` ")] = None, + sdk_platform: Annotated[Optional[SearchEventsSdkPlatform], Field(description="Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. ")] = None, + environment: Annotated[Optional[List[StrictStr]], Field(description="Filter for events by providing one or more environment IDs (`environment_id` property). ")] = None, + proximity_id: Annotated[Optional[StrictStr], Field(description="Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `proximity.id` property matching the provided ID are returned. Events without a `proximity` result are left out of the response. ")] = None, + total_hits: Annotated[Optional[Annotated[int, Field(le=1000, strict=True, ge=1)]], Field(description="When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. ")] = None, + tor_node: Annotated[Optional[StrictBool], Field(description="Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. ")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Search events + + ## Search The `/v4/events` endpoint provides a convenient way to search for past events based on specific parameters. Typical use cases and queries include: - Searching for events associated with a single `visitor_id` within a time range to get historical behavior of a visitor. - Searching for events associated with a single `linked_id` within a time range to get all events associated with your internal account identifier. - Excluding all bot traffic from the query (`good` and `bad` bots) If you don't provide `start` or `end` parameters, the default search range is the **last 7 days**. ### Filtering events with the `suspect` flag The `/v4/events` endpoint unlocks a powerful method for fraud protection analytics. The `suspect` flag is exposed in all events where it was previously set by the update API. You can also apply the `suspect` query parameter as a filter to find all potentially fraudulent activity that you previously marked as `suspect`. This helps identify patterns of fraudulent behavior. ### Environment scoping If you use a secret key that is scoped to an environment, you will only get events associated with the same environment. With a workspace-scoped environment, you will get events from all environments. Smart Signals not activated for your workspace or are not included in the response. + + :param limit: Limit the number of events returned. + :type limit: int + :param pagination_key: Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The pagination key is an arbitrary string that should not be interpreted in any way and should be passed as-is. 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?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=1740815825085` + :type pagination_key: str + :param visitor_id: Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. + :type visitor_id: str + :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 `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. + :type bot: SearchEventsBot + :param ip_address: Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 + :type ip_address: str + :param asn: Filter events by the ASN associated with the event's IP address. This corresponds to the `ip_info.(v4|v6).asn` property in the response. + :type asn: str + :param linked_id: Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-v4-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. + :type linked_id: str + :param url: Filter events by the URL (`url` property) associated with the event. + :type url: str + :param bundle_id: Filter events by the Bundle ID (iOS) associated with the event. + :type bundle_id: str + :param package_name: Filter events by the Package Name (Android) associated with the event. + :type package_name: str + :param origin: Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) + :type origin: str + :param start: Filter events with a timestamp greater than the start time, in Unix time (milliseconds). + :type start: int + :param end: Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). + :type end: int + :param reverse: Sort events in reverse timestamp order. + :type reverse: bool + :param suspect: Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > 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. + :type suspect: bool + :param vpn: Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. + :type vpn: bool + :param virtual_machine: Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. + :type virtual_machine: bool + :param tampering: Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. + :type tampering: bool + :param anti_detect_browser: Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. + :type anti_detect_browser: bool + :param incognito: Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. + :type incognito: bool + :param privacy_settings: Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. + :type privacy_settings: bool + :param jailbroken: Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. + :type jailbroken: bool + :param frida: Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. + :type frida: bool + :param factory_reset: Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. + :type factory_reset: bool + :param cloned_app: Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. + :type cloned_app: bool + :param emulator: Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. + :type emulator: bool + :param root_apps: Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. + :type root_apps: bool + :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 `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. + :type vpn_confidence: SearchEventsVpnConfidence + :param min_suspect_score: Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. + :type min_suspect_score: float + :param developer_tools: Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. + :type developer_tools: bool + :param location_spoofing: Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. + :type location_spoofing: bool + :param mitm_attack: Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. + :type mitm_attack: bool + :param proxy: Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. + :type proxy: bool + :param sdk_version: Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` + :type sdk_version: str + :param sdk_platform: Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. + :type sdk_platform: SearchEventsSdkPlatform + :param environment: Filter for events by providing one or more environment IDs (`environment_id` property). + :type environment: List[str] + :param proximity_id: Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `proximity.id` property matching the provided ID are returned. Events without a `proximity` result are left out of the response. + :type proximity_id: str + :param total_hits: When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. + :type total_hits: int + :param tor_node: Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. + :type tor_node: bool + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_events_serialize( + limit=limit, + pagination_key=pagination_key, + visitor_id=visitor_id, + bot=bot, + ip_address=ip_address, + asn=asn, + linked_id=linked_id, + url=url, + bundle_id=bundle_id, + package_name=package_name, + origin=origin, + start=start, + end=end, + reverse=reverse, + suspect=suspect, + vpn=vpn, + virtual_machine=virtual_machine, + tampering=tampering, + anti_detect_browser=anti_detect_browser, + incognito=incognito, + privacy_settings=privacy_settings, + jailbroken=jailbroken, + frida=frida, + factory_reset=factory_reset, + cloned_app=cloned_app, + emulator=emulator, + root_apps=root_apps, + vpn_confidence=vpn_confidence, + min_suspect_score=min_suspect_score, + developer_tools=developer_tools, + location_spoofing=location_spoofing, + mitm_attack=mitm_attack, + proxy=proxy, + sdk_version=sdk_version, + sdk_platform=sdk_platform, + environment=environment, + proximity_id=proximity_id, + total_hits=total_hits, + tor_node=tor_node, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "EventSearch", + '400': "ErrorResponse", + '403': "ErrorResponse", + '500': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _search_events_serialize( + self, + limit, + pagination_key, + visitor_id, + bot, + ip_address, + asn, + linked_id, + url, + bundle_id, + package_name, + origin, + start, + end, + reverse, + suspect, + vpn, + virtual_machine, + tampering, + anti_detect_browser, + incognito, + privacy_settings, + jailbroken, + frida, + factory_reset, + cloned_app, + emulator, + root_apps, + vpn_confidence, + min_suspect_score, + developer_tools, + location_spoofing, + mitm_attack, + proxy, + sdk_version, + sdk_platform, + environment, + proximity_id, + total_hits, + tor_node, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + 'environment': 'multi', + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + # process the query parameters + if pagination_key is not None: + + _query_params.append(('pagination_key', pagination_key)) + + # process the query parameters + if visitor_id is not None: + + _query_params.append(('visitor_id', visitor_id)) + + # process the query parameters + if bot is not None: + + _query_params.append(('bot', bot.value)) + + # process the query parameters + if ip_address is not None: + + _query_params.append(('ip_address', ip_address)) + + # process the query parameters + if asn is not None: + + _query_params.append(('asn', asn)) + + # process the query parameters + if linked_id is not None: + + _query_params.append(('linked_id', linked_id)) + + # process the query parameters + if url is not None: + + _query_params.append(('url', url)) + + # process the query parameters + if bundle_id is not None: + + _query_params.append(('bundle_id', bundle_id)) + + # process the query parameters + if package_name is not None: + + _query_params.append(('package_name', package_name)) + + # process the query parameters + if origin is not None: + + _query_params.append(('origin', origin)) + + # process the query parameters + if start is not None: + + _query_params.append(('start', start)) + + # process the query parameters + if end is not None: + + _query_params.append(('end', end)) + + # process the query parameters + if reverse is not None: + + _query_params.append(('reverse', reverse)) + + # process the query parameters + if suspect is not None: + + _query_params.append(('suspect', suspect)) + + # process the query parameters + if vpn is not None: + + _query_params.append(('vpn', vpn)) + + # process the query parameters + if virtual_machine is not None: + + _query_params.append(('virtual_machine', virtual_machine)) + + # process the query parameters + if tampering is not None: + + _query_params.append(('tampering', tampering)) + + # process the query parameters + if anti_detect_browser is not None: + + _query_params.append(('anti_detect_browser', anti_detect_browser)) + + # process the query parameters + if incognito is not None: + + _query_params.append(('incognito', incognito)) + + # process the query parameters + if privacy_settings is not None: + + _query_params.append(('privacy_settings', privacy_settings)) + + # process the query parameters + if jailbroken is not None: + + _query_params.append(('jailbroken', jailbroken)) + + # process the query parameters + if frida is not None: + + _query_params.append(('frida', frida)) + + # process the query parameters + if factory_reset is not None: + + _query_params.append(('factory_reset', factory_reset)) + + # process the query parameters + if cloned_app is not None: + + _query_params.append(('cloned_app', cloned_app)) + + # process the query parameters + if emulator is not None: + + _query_params.append(('emulator', emulator)) + + # process the query parameters + if root_apps is not None: + + _query_params.append(('root_apps', root_apps)) + + # process the query parameters + if vpn_confidence is not None: + + _query_params.append(('vpn_confidence', vpn_confidence.value)) + + # process the query parameters + if min_suspect_score is not None: + + _query_params.append(('min_suspect_score', min_suspect_score)) + + # process the query parameters + if developer_tools is not None: + + _query_params.append(('developer_tools', developer_tools)) + + # process the query parameters + if location_spoofing is not None: + + _query_params.append(('location_spoofing', location_spoofing)) + + # process the query parameters + if mitm_attack is not None: + + _query_params.append(('mitm_attack', mitm_attack)) + + # process the query parameters + if proxy is not None: + + _query_params.append(('proxy', proxy)) + + # process the query parameters + if sdk_version is not None: + + _query_params.append(('sdk_version', sdk_version)) + + # process the query parameters + if sdk_platform is not None: + + _query_params.append(('sdk_platform', sdk_platform.value)) + + # process the query parameters + if environment is not None: + + _query_params.append(('environment', environment)) + + # process the query parameters + if proximity_id is not None: + + _query_params.append(('proximity_id', proximity_id)) + + # process the query parameters + if total_hits is not None: + + _query_params.append(('total_hits', total_hits)) + + # process the query parameters + if tor_node is not None: + + _query_params.append(('tor_node', tor_node)) + + + + + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/events', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def update_event( + self, + event_id: Annotated[StrictStr, Field(description="The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id).")], + event_update: EventUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Update an event + + Change information in existing events specified by `event_id` or *flag suspicious events*. When an event is created, it can be assigned `linked_id` and `tags` submitted through the JS agent parameters. This information might not have been available on the client initially, so the Server API permits updating these attributes after the fact. **Warning** It's not possible to update events older than one month. **Warning** Trying to update an event immediately after creation may temporarily result in an error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully propagated across our systems. In such a case, simply retry the request. + + :param event_id: The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). (required) + :type event_id: str + :param event_update: (required) + :type event_update: EventUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_event_serialize( + event_id=event_id, + event_update=event_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_event_with_http_info( + self, + event_id: Annotated[StrictStr, Field(description="The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id).")], + event_update: EventUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Update an event + + Change information in existing events specified by `event_id` or *flag suspicious events*. When an event is created, it can be assigned `linked_id` and `tags` submitted through the JS agent parameters. This information might not have been available on the client initially, so the Server API permits updating these attributes after the fact. **Warning** It's not possible to update events older than one month. **Warning** Trying to update an event immediately after creation may temporarily result in an error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully propagated across our systems. In such a case, simply retry the request. + + :param event_id: The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). (required) + :type event_id: str + :param event_update: (required) + :type event_update: EventUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_event_serialize( + event_id=event_id, + event_update=event_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_event_without_preload_content( + self, + event_id: Annotated[StrictStr, Field(description="The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id).")], + event_update: EventUpdate, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update an event + + Change information in existing events specified by `event_id` or *flag suspicious events*. When an event is created, it can be assigned `linked_id` and `tags` submitted through the JS agent parameters. This information might not have been available on the client initially, so the Server API permits updating these attributes after the fact. **Warning** It's not possible to update events older than one month. **Warning** Trying to update an event immediately after creation may temporarily result in an error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully propagated across our systems. In such a case, simply retry the request. + + :param event_id: The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). (required) + :type event_id: str + :param event_update: (required) + :type event_update: EventUpdate + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_event_serialize( + event_id=event_id, + event_update=event_update, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': None, + '400': "ErrorResponse", + '403': "ErrorResponse", + '404': "ErrorResponse", + '409': "ErrorResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_event_serialize( + self, + event_id, + event_update, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if event_id is not None: + _path_params['event_id'] = event_id + + + + + # process the body parameter + if event_update is not None: + _body_params = event_update + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type else: - (data) = self.update_event_with_http_info(body, request_id, **kwargs) # noqa: E501 - return data - - def update_event_with_http_info(self, body: EventsUpdateRequest, request_id: str, **kwargs): # noqa: E501 - """Update an event with a given request ID # noqa: E501 - - 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 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_event_with_http_info(body, request_id, async_req=True) - >>> result = thread.get() - - :param async_req bool - :param EventsUpdateRequest body: (required) - :param str request_id: The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). (required) - :return: None - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [ - 'body', - 'request_id', - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout'] - - params = locals() - for key, val in params['kwargs'].items(): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method update_event" % key + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json' + ] ) - params[key] = val - del params['kwargs'] - # verify the required parameter 'body' is set - if 'body' not in params or params['body'] is None: - raise ValueError("Missing the required parameter `body` when calling `update_event`") # noqa: E501 - # verify the required parameter 'request_id' is set - if 'request_id' not in params or params['request_id'] is None: - raise ValueError("Missing the required parameter `request_id` when calling `update_event`") # noqa: E501 - - collection_formats = {} - - path_params = {} - if 'request_id' in params: - path_params['request_id'] = params['request_id'] # noqa: E501 - - query_params = [('ii', 'fingerprint-pro-server-python-sdk/8.11.0')] - - header_params = {} - - form_params = [] - local_var_files = {} - - body_params = None - if 'body' in params: - body_params = params['body'] - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - ['application/json']) # noqa: E501 - - # Authentication setting - auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501 - - try: - return self.api_client.call_api( - '/events/{request_id}', 'PUT', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type=None, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - except ApiException as e: - if e.status == 400: - error = self.api_client.deserialize(e, 'ErrorResponse', True) - raise extend_exception(e, error) - if e.status == 403: - error = self.api_client.deserialize(e, 'ErrorResponse', True) - raise extend_exception(e, error) - if e.status == 404: - error = self.api_client.deserialize(e, 'ErrorResponse', True) - raise extend_exception(e, error) - if e.status == 409: - error = self.api_client.deserialize(e, 'ErrorResponse', True) - raise extend_exception(e, error) - raise e + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type + + # authentication setting + _auth_settings: List[str] = [ + 'bearerAuth' + ] + + return self.api_client.param_serialize( + method='PATCH', + resource_path='/events/{event_id}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/fingerprint_server_sdk/api_client.py b/fingerprint_server_sdk/api_client.py index 36be7d86..47c93af2 100644 --- a/fingerprint_server_sdk/api_client.py +++ b/fingerprint_server_sdk/api_client.py @@ -1,55 +1,57 @@ # coding: utf-8 + """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +import datetime +from dateutil.parser import parse +from enum import Enum +import decimal import json import mimetypes import os import re import tempfile +import uuid from urllib.parse import quote -from multiprocessing import Pool -from typing import Optional, Any, Union, Dict, List, Tuple -from datetime import date, datetime +from typing import Tuple, Optional, List, Dict, Union, Any +from pydantic import SecretStr from fingerprint_server_sdk.configuration import Configuration +from fingerprint_server_sdk.api_response import ApiResponse, T as ApiResponseT import fingerprint_server_sdk.models -from fingerprint_server_sdk import rest -from fingerprint_server_sdk.rest import ApiException, RESTResponse -from fingerprint_server_sdk.base_model import BaseModel - -PRIMITIVE_TYPES = (float, bool, bytes, str, int) -NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int, - 'float': float, - 'str': str, - 'bool': bool, - 'date': date, - 'datetime': datetime, - 'object': object, -} - +from fingerprint_server_sdk import rest, __version__ +from fingerprint_server_sdk.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] class ApiClient: - """Generic API client for Swagger client library builds. + """Generic API client for OpenAPI client library builds. - Swagger generic API client. This client handles the client- + OpenAPI generic API client. This client handles the client- server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the Swagger + the methods and models for each application are generated from the OpenAPI templates. - NOTE: This class is auto generated by the swagger code generator program. - Ref: https://github.com/swagger-api/swagger-codegen - Do not edit the class manually. - :param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. :param header_value: a header value to pass when making calls to @@ -58,32 +60,42 @@ class ApiClient: to the API """ - def __init__(self, configuration: Optional[Configuration] = None, header_name: Optional[str] = None, - header_value: Optional[str] = None, cookie: Optional[str] = None, pool: Optional[Pool] = None): - if configuration is None: - configuration = Configuration() + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'object': object, + } + + def __init__( + self, + configuration, + header_name=None, + header_value=None, + cookie=None + ) -> None: self.configuration = configuration - if pool is None: - try: - from multiprocessing.pool import ThreadPool - self.pool = ThreadPool() - except (ImportError, OSError): - from fingerprint_server_sdk.dummy_pool import DummyPool - self.pool = DummyPool() - else: - self.pool = pool self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} if header_name is not None: self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'Swagger-Codegen/8.11.0/python' + self.user_agent = 'fingerprint-server-python-sdk/{__version__}' + self.client_side_validation = configuration.client_side_validation + + def __enter__(self): + return self - def __del__(self): - self.pool.close() - self.pool.join() + def __exit__(self, exc_type, exc_value, traceback): + pass @property def user_agent(self) -> Optional[str]: @@ -97,14 +109,44 @@ def user_agent(self, value: str): def set_default_header(self, header_name: str, header_value: str): self.default_headers[header_name] = header_value - def __call_api( - self, resource_path: str, method: str, path_params: Optional[Dict[str, Any]] = None, - query_params: Optional[List[Tuple[str, Any]]] = None, header_params: Optional[Dict[str, Any]] = None, - body: Any = None, post_params: Optional[List[Tuple[str, Any]]] = None, - files: Optional[Dict[str, Any]] = None, response_type: Optional[str] = None, - auth_settings: Optional[List[str]] = None, _return_http_data_only: Optional[bool] = None, - collection_formats: Optional[Dict[str, Any]] = None, _preload_content: bool = True, - _request_timeout: Optional[int] = None): + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ config = self.configuration @@ -115,14 +157,17 @@ def __call_api( header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = dict( + self.parameters_to_tuples(header_params, collection_formats) + ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( @@ -130,207 +175,289 @@ def __call_api( quote(str(v), safe=config.safe_chars_for_path_param) ) - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - # post parameters if post_params or files: - post_params = self.prepare_post_parameters(post_params, files) + post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings) + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) # body if body: body = self.sanitize_for_serialization(body) # request url - url = self.configuration.host + resource_path + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path + + query_params = list(query_params or []) + if getattr(self.configuration, "default_query_params", None): + existing_keys = {k for k, _ in query_params} + for k, v in self.configuration.default_query_params: + if k not in existing_keys: + query_params.append((k, v)) + + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + def call_api( + self, + method: str, + url: str, + header_params: Optional[Dict[str, Any]] = None, + body: Any = None, + post_params: Optional[List[Tuple[str, Any]]] = None, + _request_timeout: Optional[int] = None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + + try: + # perform request and return response + response_data = self.rest_client.request( + method, + url, + headers=header_params, + body=body, + post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + return response_data - self.last_response = response_data + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ - return_data = response_data + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if ( + not response_type + and isinstance(response_data.status, int) + and 100 <= response_data.status <= 599 + ): + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get( + str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None try: - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - except ValueError as e: - error = ApiException(http_resp=response_data) - error.reason = e - raise error - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) - def sanitize_for_serialization(self, obj: Union[Dict[str, Any], List[Tuple[str, Any]], BaseModel]): + def sanitize_for_serialization(self, obj): """Builds a JSON POST object. If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. - If obj is swagger model, return the properties dict. + If obj is OpenAPI model, return the properties dict. :param obj: The data to serialize. :return: The serialized form of data. """ if obj is None: return None - elif isinstance(obj, PRIMITIVE_TYPES): + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): return obj + elif isinstance(obj, uuid.UUID): + return str(obj) elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) - elif isinstance(obj, (datetime, date)): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) - if isinstance(obj, dict): + elif isinstance(obj, dict): obj_dict = obj else: # Convert model obj to dict except - # attributes `swagger_types`, `attribute_map` + # attributes `openapi_types`, `attribute_map` # and attributes which value is not None. # Convert attribute name to json key in # model definition for request. - obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in obj.swagger_types.items() - if getattr(obj, attr) is not None} + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() + return self.sanitize_for_serialization(obj_dict) - return {key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items()} + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } - def deserialize(self, response: Union[RESTResponse, ApiException], response_type: Any, is_error=False): + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. - :param is_error: boolean means deserialization should - be made for `response.body` field + :param content_type: content type of response. :return: deserialized object. """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) - if is_error: - try: - data = json.loads(response.body) - except ValueError: - data = response.body # fetch data from response object - else: + if content_type is None: try: - data = json.loads(response.data) + data = json.loads(response_text) except ValueError: - data = response.data + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) - return ApiClientDeserializer.deserialize(data, response_type) + return self.__deserialize(data, response_type) - def call_api(self, resource_path: str, method: str, path_params: Optional[Dict[str, Any]] = None, - query_params: Optional[List[Tuple[str, Any]]] = None, header_params: Optional[Dict[str, Any]] = None, - body: Any = None, post_params: Optional[List[Tuple[str, Any]]] = None, - files: Optional[Dict[str, Any]] = None, response_type: Optional[str] = None, - auth_settings: Optional[List[str]] = None, async_req: Optional[bool] = None, - _return_http_data_only: Optional[bool] = None, collection_formats: Optional[Dict[str, Any]] = None, - _preload_content: bool = True, _request_timeout: Optional[int] = None): - """Makes the HTTP request (synchronous) and returns deserialized data. + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. - To make an async request, set the async_req parameter. + :param data: dict, list or str. + :param klass: class literal, or string of class name. - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings: Auth Settings names for the request. - :param response_type: Response data type. - :param files: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. + :return: object. """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout) - else: - thread = self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, _request_timeout)) - return thread - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method in ["GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH", "DELETE"]: - return self.rest_client.request(method, url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr(fingerprint_server_sdk.models, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass is object: + return self.__deserialize_object(data) + elif klass is datetime.date: + return self.__deserialize_date(data) + elif klass is datetime.datetime: + return self.__deserialize_datetime(data) + elif klass is decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: - raise ValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) + return self.__deserialize_model(data, klass) def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -339,10 +466,10 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -362,33 +489,78 @@ def parameters_to_tuples(self, params, collection_formats): new_params.append((k, v)) return new_params - def prepare_post_parameters(self, post_params: Optional[List[Tuple[str, Any]]] = None, - files: Optional[Dict[str, Any]] = None): + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, quote(str(value))) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. - :param post_params: Normal form parameters. :param files: File parameters. :return: Form parameters with files. """ params = [] - - if post_params: - params = post_params - - if files: - for k, v in files.items(): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params def select_header_accept(self, accepts: List[str]) -> Optional[str]: @@ -398,62 +570,116 @@ def select_header_accept(self, accepts: List[str]) -> Optional[str]: :return: Accept (e.g. application/json). """ if not accepts: - return + return None - accepts = [x.lower() for x in accepts] + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) + return accepts[0] - def select_header_content_type(self, content_types: List[str]) -> str: + def select_header_content_type(self, content_types): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. :return: Content-Type (e.g. application/json). """ if not content_types: - return 'application/json' - - content_types = [x.lower() for x in content_types] - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] + return None - def update_params_for_auth(self, headers: Optional[Dict[str, Any]], queries: Optional[List[Tuple[str, Any]]], - auth_settings: Optional[List[str]]): + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param queries: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - if not auth_setting['value']: - continue - elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ValueError( - 'Authentication token must be in `query` or `header`' + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting ) + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + def __deserialize_file(self, response): """Deserializes body to file Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. + handle file downloading + save response body into a tmp file and return the instance + :param response: RESTResponse. :return: file path. """ @@ -463,64 +689,20 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) path = os.path.join(os.path.dirname(path), filename) - response_data = response.data - with open(path, "w") as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - else: - f.write(response_data) - return path - - -class ApiClientDeserializer: - """Deserializes server response into appropriate type.""" - @staticmethod - def deserialize(data: Union[Dict, List, str], klass: Any): - """Deserializes dict, list, str into an object. - - :param data: dict, list or str. - :param klass: class literal, or string of class name. - - :return: object. - """ - if data is None: - return None - - if type(klass) == str: - if klass.startswith('list['): - sub_kls = re.match(r'list\[(.*)\]', klass).group(1) - return [ApiClientDeserializer.deserialize(sub_data, sub_kls) - for sub_data in data] - - if klass.startswith('dict('): - sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) - return {k: ApiClientDeserializer.deserialize(v, sub_kls) - for k, v in data.items()} - # convert str to class - if klass in NATIVE_TYPES_MAPPING: - klass = NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr(fingerprint_server_sdk.models, klass) + with open(path, "wb") as f: + f.write(response.data) - if klass in PRIMITIVE_TYPES: - return ApiClientDeserializer.__deserialize_primitive(data, klass) - elif klass == object: - return data - elif klass == date: - return ApiClientDeserializer.__deserialize_date(data) - elif klass == datetime: - return ApiClientDeserializer.__deserialize_datatime(data) - else: - return ApiClientDeserializer.__deserialize_model(data, klass) + return path - @staticmethod - def __deserialize_primitive(data, klass): + def __deserialize_primitive(self, data, klass): """Deserializes string to primitive type. :param data: str. @@ -535,14 +717,20 @@ def __deserialize_primitive(data, klass): except TypeError: return data - @staticmethod - def __deserialize_date(string: str) -> date: + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): """Deserializes string to date. :param string: str. + :return: date. """ try: - from dateutil.parser import parse return parse(string).date() except ImportError: return string @@ -552,16 +740,15 @@ def __deserialize_date(string: str) -> date: reason="Failed to parse `{0}` as date object".format(string) ) - @staticmethod - def __deserialize_datatime(string: str) -> datetime: + def __deserialize_datetime(self, string): """Deserializes string to datetime. The string should be in iso8601 datetime format. :param string: str. + :return: datetime. """ try: - from dateutil.parser import parse return parse(string) except ImportError: return string @@ -574,12 +761,25 @@ def __deserialize_datatime(string: str) -> datetime: ) ) - @staticmethod - def __hasattr(object, name): - return name in object.__class__.__dict__ + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. - @staticmethod - def __deserialize_model(data, klass): + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + + def __deserialize_model(self, data, klass): """Deserializes list or dict to model. :param data: dict, list. @@ -587,30 +787,4 @@ def __deserialize_model(data, klass): :return: model object. """ - if not klass.swagger_types and not ApiClientDeserializer.__hasattr(klass, 'get_real_child_model'): - if hasattr(klass, '__parent_class__') and klass.__parent_class__ == 'dict': - return klass(**data) - return data - - kwargs = {} - if klass.swagger_types is not None: - for attr, attr_type in klass.swagger_types.items(): - if (data is not None and - klass.attribute_map[attr] in data and - isinstance(data, (list, dict))): - value = data[klass.attribute_map[attr]] - kwargs[attr] = ApiClientDeserializer.deserialize(value, attr_type) - - instance = klass(**kwargs) - - if (isinstance(instance, dict) and - klass.swagger_types is not None and - isinstance(data, dict)): - for key, value in data.items(): - if key not in klass.swagger_types: - instance[key] = value - if ApiClientDeserializer.__hasattr(instance, 'get_real_child_model'): - klass_name = instance.get_real_child_model(data) - if klass_name: - instance = ApiClientDeserializer.deserialize(data, klass_name) - return instance + return klass.from_dict(data) \ No newline at end of file diff --git a/fingerprint_server_sdk/api_response.py b/fingerprint_server_sdk/api_response.py new file mode 100644 index 00000000..9bc7c11f --- /dev/null +++ b/fingerprint_server_sdk/api_response.py @@ -0,0 +1,21 @@ +"""API response object.""" + +from __future__ import annotations +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel + +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): + """ + API response object + """ + + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") + + model_config = { + "arbitrary_types_allowed": True + } diff --git a/fingerprint_server_sdk/base_model.py b/fingerprint_server_sdk/base_model.py deleted file mode 100644 index 3de213d1..00000000 --- a/fingerprint_server_sdk/base_model.py +++ /dev/null @@ -1,60 +0,0 @@ -import pprint -from typing import Union, Dict - - -class BaseModel: - """Base class for all models with utility methods.""" - - swagger_types: Dict[str, str] = {} - attribute_map: Dict[str, str] = {} - nullable_map: Dict[str, bool] = {} - - def to_dict(self) -> Dict[str, Union[list, dict]]: - """Returns the model properties as a dict""" - result = {} - - for attr, _ in self.swagger_types.items(): - value = getattr(self, attr) - if isinstance(value, list): - result[attr] = list(map( - lambda x: x.to_dict() if hasattr(x, "to_dict") else x, - value - )) - elif hasattr(value, "to_dict"): - result[attr] = value.to_dict() - elif isinstance(value, Dict): - result[attr] = dict(map( - lambda item: (item[0], item[1].to_dict()) - if hasattr(item[1], "to_dict") else item, - value.items() - )) - elif value is None: - if self.nullable_map[attr]: - result[attr] = None - - continue - else: - result[attr] = value - if issubclass(type(self), Dict): - for key, value in self.items(): - result[key] = value - - return result - - def to_str(self) -> str: - """Returns the string representation of the model""" - return pprint.pformat(self.to_dict()) - - def __repr__(self) -> str: - """For `print` and `pprint`""" - return self.to_str() - - def __eq__(self, other) -> bool: - """Returns true if both objects are equal""" - if not isinstance(other, type(self)): - return False - return self.to_dict() == other.to_dict() - - def __ne__(self, other) -> bool: - """Returns true if both objects are not equal""" - return not self.__eq__(other) diff --git a/fingerprint_server_sdk/configuration.py b/fingerprint_server_sdk/configuration.py index e903efc2..d9648185 100644 --- a/fingerprint_server_sdk/configuration.py +++ b/fingerprint_server_sdk/configuration.py @@ -1,113 +1,251 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + import copy +import http.client as httplib import logging +from logging import FileHandler import multiprocessing import sys -import http.client as httplib +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union, Tuple +from typing_extensions import NotRequired, Self +from fingerprint_server_sdk import __version__ +from enum import Enum -from typing import Dict +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} -class Configuration: - """NOTE: This class is auto generated by the swagger code generator program. +ServerVariablesT = Dict[str, str] - Ref: https://github.com/swagger-api/swagger-codegen - Do not edit the class manually. - """ +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + +AuthSettings = TypedDict( + "AuthSettings", + { + "bearerAuth": BearerFormatAuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] - _default = None - def __init__(self, api_key: str, region: str = "us"): - """Constructor""" - if self._default: - for key in self._default.__dict__.keys(): - self.__dict__[key] = copy.copy(self._default.__dict__[key]) - return +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] - # Default Base url - self.host = self.get_host(region) - # Temp file folder for downloading files - self.temp_folder_path = None - # Authentication Settings - # dict to store API key(s) +class Region(Enum): + US = "us" + EU = "eu" + AP = "ap" + + +class Configuration: + """This class contains various settings of the API client. + + :param api_key: Required API key. + :param region: Region. + :param host: Optional base url. If this provided, region will not be used. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + :param retries: Number of retries for API requests. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. + :param default_query_params: default additional query parameters. + """ + + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + api_key: str, + region: Region = Region.US, + host: Optional[str]=None, + ssl_ca_cert: Optional[str]=None, + retries: Optional[int] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + default_query_params: Optional[List[Tuple[str, str]]] = None, + *, + debug: Optional[bool] = None, + ) -> None: + """Constructor + """ + if host: + self._base_path = host + else: + self._base_path = self.get_host(region) + self.api_key = api_key - # Logging Settings - self.logger = {"package_logger": logging.getLogger("fingerprint_server_sdk"), - "urllib3_logger": logging.getLogger("urllib3")} - # Log format + + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("fingerprint_server_sdk") + self.logger["urllib3_logger"] = logging.getLogger("urllib3") self.logger_format = '%(asctime)s %(levelname)s %(message)s' - # Log stream handler + """Log format + """ self.logger_stream_handler = None - # Log file handler - self.logger_file_handler = None - # Debug file location + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ self.logger_file = None - # Debug switch - self.debug = False + """Debug file location + """ + if debug is not None: + self.debug = debug + else: + self.__debug = False + """Debug switch + """ - # SSL/TLS verification - # Set this to false to skip verifying SSL certificate when calling API - # from https server. self.verify_ssl = True - # Set this to customize the certificate file to verify the peer. - self.ssl_ca_cert = None - # client certificate file + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.ca_cert_data = ca_cert_data + """Set this to verify the peer using PEM (str) or DER (bytes) + certificate data. + """ self.cert_file = None - # client key file + """client certificate file + """ self.key_file = None - # Set this to True/False to enable/disable SSL hostname verification. + """client key file + """ self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ - # urllib3 connection pool's maximum number of connections saved - # per pool. urllib3 uses 1 connection as default value, but this is - # not the best value when you are making a lot of possibly parallel - # requests to the same host, which is often the case here. - # cpu_count * 5 is used as default value to increase performance. self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ - # Proxy URL - self.proxy = None - # Safe chars for path_param + self.proxy: Optional[str] = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ self.safe_chars_for_path_param = '' - - # Disable client side validation + """Safe chars for path_param + """ + self.retries = retries + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation self.client_side_validation = True + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "%Y-%m-%dT%H:%M:%S.%f%z" + """datetime format + """ + + self.date_format = "%Y-%m-%d" + """date format + """ + + if default_query_params: + self.default_query_params = default_query_params + else: + self.default_query_params: List[Tuple[str, str]] = [("ii", f"fingerprint-server-python-sdk/{__version__}")] + + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name: str, value: Any) -> None: + object.__setattr__(self, name, value) + @classmethod - def set_default(cls, default): + def set_default(cls, default: Optional[Self]) -> None: + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ cls._default = default @property - def logger_file(self) -> str: + def logger_file(self) -> Optional[str]: """The logger file. If the logger_file is None, then add stream handler and remove file handler. Otherwise, add file handler and remove stream handler. - :return: The logger_file path. + :type: str """ return self.__logger_file @logger_file.setter - def logger_file(self, value: str): + def logger_file(self, value: Optional[str]) -> None: """The logger file. If the logger_file is None, then add stream handler and remove file handler. Otherwise, add file handler and remove stream handler. :param value: The logger_file path. + :type: str """ self.__logger_file = value if self.__logger_file: @@ -117,31 +255,21 @@ def logger_file(self, value: str): self.logger_file_handler.setFormatter(self.logger_formatter) for _, logger in self.logger.items(): logger.addHandler(self.logger_file_handler) - if self.logger_stream_handler: - logger.removeHandler(self.logger_stream_handler) - else: - # If not set logging file, - # then add stream handler and remove file handler. - self.logger_stream_handler = logging.StreamHandler() - self.logger_stream_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_stream_handler) - if self.logger_file_handler: - logger.removeHandler(self.logger_file_handler) @property def debug(self) -> bool: """Debug status - :param value: The debug status, True or False. + :type: bool """ return self.__debug @debug.setter - def debug(self, value: bool): + def debug(self, value: bool) -> None: """Debug status :param value: The debug status, True or False. + :type: bool """ self.__debug = value if self.__debug: @@ -164,44 +292,40 @@ def logger_format(self) -> str: The logger_formatter will be updated when sets logger_format. - :return: The format string. + :type: str """ return self.__logger_format @logger_format.setter - def logger_format(self, value: str): + def logger_format(self, value: str) -> None: """The logger format. The logger_formatter will be updated when sets logger_format. :param value: The format string. + :type: str """ self.__logger_format = value self.logger_formatter = logging.Formatter(self.__logger_format) - def auth_settings(self) -> Dict[str, Dict[str, str]]: + def auth_settings(self) -> AuthSettings: """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ - return { - 'ApiKeyHeader': - { - 'type': 'api_key', - 'in': 'header', - 'key': 'Auth-API-Key', - 'value': self.api_key - }, + auth: AuthSettings = {} + bearerAuth: BearerFormatAuthSetting = { + 'type': 'bearer', + 'in': 'header', + 'format': 'JWT', + 'key': 'Authorization', + 'value': 'Bearer ' + self.api_key } - def get_host(self, region: str) -> str: - return { - "us": "https://api.fpjs.io", - "eu": "https://eu.api.fpjs.io", - "ap": "https://ap.api.fpjs.io", - }.get(region, "https://api.fpjs.io") + auth['bearerAuth'] = bearerAuth + return auth - def to_debug_report(self): + def to_debug_report(self) -> str: """Gets the essential information for debugging. :return: The report for debugging. @@ -209,6 +333,24 @@ def to_debug_report(self): return "Python SDK Debug Report:\n"\ "OS: {env}\n"\ "Python Version: {pyversion}\n"\ - "Version of the API: 3\n"\ + "Version of the API: 4\n"\ "SDK Package Version: 8.11.0".\ format(env=sys.platform, pyversion=sys.version) + + @staticmethod + def get_host(region: Region) -> str: + return { + Region.US: "https://api.fpjs.io/v4", + Region.EU: "https://eu.api.fpjs.io/v4", + Region.AP: "https://ap.api.fpjs.io/v4", + }.get(region, "https://api.fpjs.io/v4") + + @property + def host(self) -> str: + """Return generated host.""" + return self._base_path + + @host.setter + def host(self, value: str) -> None: + """Fix base path.""" + self._base_path = value diff --git a/fingerprint_server_sdk/dummy_pool.py b/fingerprint_server_sdk/dummy_pool.py deleted file mode 100644 index 2d10d5c2..00000000 --- a/fingerprint_server_sdk/dummy_pool.py +++ /dev/null @@ -1,20 +0,0 @@ -class DummyAsyncResult: - def __init__(self, value): - self.value = value - - def get(self): - return self.value - - -class DummyPool: - def apply_async(self, func, args=(), kwds={}, callback=None): - result = func(*args, **kwds) - if callback is not None: - callback(result) - return DummyAsyncResult(result) - - def close(self): - pass - - def join(self): - pass diff --git a/fingerprint_server_sdk/exceptions.py b/fingerprint_server_sdk/exceptions.py new file mode 100644 index 00000000..eb62fcca --- /dev/null +++ b/fingerprint_server_sdk/exceptions.py @@ -0,0 +1,228 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from typing import Any, Optional +from typing_extensions import Self + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.headers + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 429: + raise TooManyRequestsException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + if self.data: + error_message += "HTTP response data: {0}\n".format(self.data) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass + + +class TooManyRequestsException(ApiException): + """Exception for HTTP 429 Too Many Requests.""" + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result \ No newline at end of file diff --git a/fingerprint_server_sdk/extend_exception.py b/fingerprint_server_sdk/extend_exception.py deleted file mode 100644 index ddfcacd0..00000000 --- a/fingerprint_server_sdk/extend_exception.py +++ /dev/null @@ -1,10 +0,0 @@ -from fingerprint_server_sdk.rest import KnownApiException - - -def extend_exception(exception, error_object): - if exception.status == 429: - try: - error_object.retry_after = int(exception.headers.get('retry-after')) - except Exception: - error_object.retry_after = 1 - return KnownApiException(exception, error_object) diff --git a/fingerprint_server_sdk/models/__init__.py b/fingerprint_server_sdk/models/__init__.py index a0fbdc3a..d99e01bc 100644 --- a/fingerprint_server_sdk/models/__init__.py +++ b/fingerprint_server_sdk/models/__init__.py @@ -2,131 +2,63 @@ # flake8: noqa """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 # import models into model package -from fingerprint_server_sdk.models.botd import Botd -from fingerprint_server_sdk.models.botd_bot import BotdBot -from fingerprint_server_sdk.models.botd_bot_result import BotdBotResult +from fingerprint_server_sdk.models.bot_info import BotInfo +from fingerprint_server_sdk.models.bot_result import BotResult from fingerprint_server_sdk.models.browser_details import BrowserDetails -from fingerprint_server_sdk.models.cloned_app import ClonedApp -from fingerprint_server_sdk.models.deprecated_geolocation import DeprecatedGeolocation -from fingerprint_server_sdk.models.developer_tools import DeveloperTools -from fingerprint_server_sdk.models.emulator import Emulator +from fingerprint_server_sdk.models.canvas import Canvas +from fingerprint_server_sdk.models.emoji import Emoji from fingerprint_server_sdk.models.error import Error from fingerprint_server_sdk.models.error_code import ErrorCode -from fingerprint_server_sdk.models.error_plain_response import ErrorPlainResponse from fingerprint_server_sdk.models.error_response import ErrorResponse -from fingerprint_server_sdk.models.events_get_response import EventsGetResponse -from fingerprint_server_sdk.models.events_update_request import EventsUpdateRequest -from fingerprint_server_sdk.models.factory_reset import FactoryReset -from fingerprint_server_sdk.models.frida import Frida +from fingerprint_server_sdk.models.event import Event +from fingerprint_server_sdk.models.event_rule_action import EventRuleAction +from fingerprint_server_sdk.models.event_rule_action_allow import EventRuleActionAllow +from fingerprint_server_sdk.models.event_rule_action_block import EventRuleActionBlock +from fingerprint_server_sdk.models.event_search import EventSearch +from fingerprint_server_sdk.models.event_update import EventUpdate +from fingerprint_server_sdk.models.font_preferences import FontPreferences from fingerprint_server_sdk.models.geolocation import Geolocation -from fingerprint_server_sdk.models.geolocation_city import GeolocationCity -from fingerprint_server_sdk.models.geolocation_continent import GeolocationContinent -from fingerprint_server_sdk.models.geolocation_country import GeolocationCountry -from fingerprint_server_sdk.models.geolocation_subdivision import GeolocationSubdivision -from fingerprint_server_sdk.models.geolocation_subdivisions import GeolocationSubdivisions -from fingerprint_server_sdk.models.high_activity import HighActivity -from fingerprint_server_sdk.models.ip_blocklist import IPBlocklist -from fingerprint_server_sdk.models.ip_blocklist_details import IPBlocklistDetails +from fingerprint_server_sdk.models.geolocation_subdivisions_inner import GeolocationSubdivisionsInner +from fingerprint_server_sdk.models.ip_block_list import IPBlockList from fingerprint_server_sdk.models.ip_info import IPInfo -from fingerprint_server_sdk.models.ip_info_asn import IPInfoASN -from fingerprint_server_sdk.models.ip_info_data_center import IPInfoDataCenter from fingerprint_server_sdk.models.ip_info_v4 import IPInfoV4 from fingerprint_server_sdk.models.ip_info_v6 import IPInfoV6 from fingerprint_server_sdk.models.identification import Identification from fingerprint_server_sdk.models.identification_confidence import IdentificationConfidence -from fingerprint_server_sdk.models.identification_seen_at import IdentificationSeenAt -from fingerprint_server_sdk.models.incognito import Incognito -from fingerprint_server_sdk.models.jailbroken import Jailbroken -from fingerprint_server_sdk.models.location_spoofing import LocationSpoofing -from fingerprint_server_sdk.models.mit_m_attack import MitMAttack -from fingerprint_server_sdk.models.privacy_settings import PrivacySettings -from fingerprint_server_sdk.models.product_botd import ProductBotd -from fingerprint_server_sdk.models.product_cloned_app import ProductClonedApp -from fingerprint_server_sdk.models.product_developer_tools import ProductDeveloperTools -from fingerprint_server_sdk.models.product_emulator import ProductEmulator -from fingerprint_server_sdk.models.product_factory_reset import ProductFactoryReset -from fingerprint_server_sdk.models.product_frida import ProductFrida -from fingerprint_server_sdk.models.product_high_activity import ProductHighActivity -from fingerprint_server_sdk.models.product_ip_blocklist import ProductIPBlocklist -from fingerprint_server_sdk.models.product_ip_info import ProductIPInfo -from fingerprint_server_sdk.models.product_identification import ProductIdentification -from fingerprint_server_sdk.models.product_incognito import ProductIncognito -from fingerprint_server_sdk.models.product_jailbroken import ProductJailbroken -from fingerprint_server_sdk.models.product_location_spoofing import ProductLocationSpoofing -from fingerprint_server_sdk.models.product_mit_m_attack import ProductMitMAttack -from fingerprint_server_sdk.models.product_privacy_settings import ProductPrivacySettings -from fingerprint_server_sdk.models.product_proximity import ProductProximity -from fingerprint_server_sdk.models.product_proxy import ProductProxy -from fingerprint_server_sdk.models.product_raw_device_attributes import ProductRawDeviceAttributes -from fingerprint_server_sdk.models.product_remote_control import ProductRemoteControl -from fingerprint_server_sdk.models.product_root_apps import ProductRootApps -from fingerprint_server_sdk.models.product_suspect_score import ProductSuspectScore -from fingerprint_server_sdk.models.product_tampering import ProductTampering -from fingerprint_server_sdk.models.product_tor import ProductTor -from fingerprint_server_sdk.models.product_vpn import ProductVPN -from fingerprint_server_sdk.models.product_velocity import ProductVelocity -from fingerprint_server_sdk.models.product_virtual_machine import ProductVirtualMachine -from fingerprint_server_sdk.models.products import Products +from fingerprint_server_sdk.models.integration import Integration +from fingerprint_server_sdk.models.integration_subintegration import IntegrationSubintegration +from fingerprint_server_sdk.models.plugins_inner import PluginsInner +from fingerprint_server_sdk.models.plugins_inner_mime_types_inner import PluginsInnerMimeTypesInner from fingerprint_server_sdk.models.proximity import Proximity -from fingerprint_server_sdk.models.proxy import Proxy from fingerprint_server_sdk.models.proxy_confidence import ProxyConfidence from fingerprint_server_sdk.models.proxy_details import ProxyDetails -from fingerprint_server_sdk.models.raw_device_attribute import RawDeviceAttribute -from fingerprint_server_sdk.models.raw_device_attribute_error import RawDeviceAttributeError from fingerprint_server_sdk.models.raw_device_attributes import RawDeviceAttributes -from fingerprint_server_sdk.models.related_visitor import RelatedVisitor -from fingerprint_server_sdk.models.related_visitors_response import RelatedVisitorsResponse -from fingerprint_server_sdk.models.remote_control import RemoteControl -from fingerprint_server_sdk.models.root_apps import RootApps +from fingerprint_server_sdk.models.request_header_modifications import RequestHeaderModifications +from fingerprint_server_sdk.models.rule_action_header_field import RuleActionHeaderField +from fingerprint_server_sdk.models.rule_action_type import RuleActionType from fingerprint_server_sdk.models.sdk import SDK -from fingerprint_server_sdk.models.search_events_response import SearchEventsResponse -from fingerprint_server_sdk.models.search_events_response_events import SearchEventsResponseEvents -from fingerprint_server_sdk.models.supplementary_id import SupplementaryID -from fingerprint_server_sdk.models.suspect_score import SuspectScore -from fingerprint_server_sdk.models.tag import Tag -from fingerprint_server_sdk.models.tampering import Tampering -from fingerprint_server_sdk.models.tor import Tor -from fingerprint_server_sdk.models.vpn import VPN -from fingerprint_server_sdk.models.vpn_confidence import VPNConfidence -from fingerprint_server_sdk.models.vpn_methods import VPNMethods +from fingerprint_server_sdk.models.search_events_bot import SearchEventsBot +from fingerprint_server_sdk.models.search_events_sdk_platform import SearchEventsSdkPlatform +from fingerprint_server_sdk.models.search_events_vpn_confidence import SearchEventsVpnConfidence +from fingerprint_server_sdk.models.supplementary_id_high_recall import SupplementaryIDHighRecall +from fingerprint_server_sdk.models.tampering_details import TamperingDetails +from fingerprint_server_sdk.models.touch_support import TouchSupport from fingerprint_server_sdk.models.velocity import Velocity from fingerprint_server_sdk.models.velocity_data import VelocityData -from fingerprint_server_sdk.models.velocity_intervals import VelocityIntervals -from fingerprint_server_sdk.models.virtual_machine import VirtualMachine -from fingerprint_server_sdk.models.visit import Visit -from fingerprint_server_sdk.models.visitors_get_response import VisitorsGetResponse -from fingerprint_server_sdk.models.webhook import Webhook -from fingerprint_server_sdk.models.webhook_cloned_app import WebhookClonedApp -from fingerprint_server_sdk.models.webhook_developer_tools import WebhookDeveloperTools -from fingerprint_server_sdk.models.webhook_emulator import WebhookEmulator -from fingerprint_server_sdk.models.webhook_factory_reset import WebhookFactoryReset -from fingerprint_server_sdk.models.webhook_frida import WebhookFrida -from fingerprint_server_sdk.models.webhook_high_activity import WebhookHighActivity -from fingerprint_server_sdk.models.webhook_ip_blocklist import WebhookIPBlocklist -from fingerprint_server_sdk.models.webhook_ip_info import WebhookIPInfo -from fingerprint_server_sdk.models.webhook_jailbroken import WebhookJailbroken -from fingerprint_server_sdk.models.webhook_location_spoofing import WebhookLocationSpoofing -from fingerprint_server_sdk.models.webhook_mit_m_attack import WebhookMitMAttack -from fingerprint_server_sdk.models.webhook_privacy_settings import WebhookPrivacySettings -from fingerprint_server_sdk.models.webhook_proximity import WebhookProximity -from fingerprint_server_sdk.models.webhook_proxy import WebhookProxy -from fingerprint_server_sdk.models.webhook_raw_device_attributes import WebhookRawDeviceAttributes -from fingerprint_server_sdk.models.webhook_remote_control import WebhookRemoteControl -from fingerprint_server_sdk.models.webhook_root_apps import WebhookRootApps -from fingerprint_server_sdk.models.webhook_supplementary_i_ds import WebhookSupplementaryIDs -from fingerprint_server_sdk.models.webhook_suspect_score import WebhookSuspectScore -from fingerprint_server_sdk.models.webhook_tampering import WebhookTampering -from fingerprint_server_sdk.models.webhook_tor import WebhookTor -from fingerprint_server_sdk.models.webhook_vpn import WebhookVPN -from fingerprint_server_sdk.models.webhook_velocity import WebhookVelocity -from fingerprint_server_sdk.models.webhook_virtual_machine import WebhookVirtualMachine +from fingerprint_server_sdk.models.vpn_confidence import VpnConfidence +from fingerprint_server_sdk.models.vpn_methods import VpnMethods +from fingerprint_server_sdk.models.web_gl_basics import WebGlBasics +from fingerprint_server_sdk.models.web_gl_extensions import WebGlExtensions + diff --git a/fingerprint_server_sdk/models/bot_info.py b/fingerprint_server_sdk/models/bot_info.py new file mode 100644 index 00000000..038bd40c --- /dev/null +++ b/fingerprint_server_sdk/models/bot_info.py @@ -0,0 +1,112 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class BotInfo(BaseModel): + """ + Extended bot information. + """ # noqa: E501 + category: StrictStr = Field(description="The type and purpose of the bot.") + provider: StrictStr = Field(description="The organization or company operating the bot.") + provider_url: Optional[StrictStr] = Field(default=None, description="The URL of the bot provider's website.") + name: StrictStr = Field(description="The specific name or identifier of the bot.") + identity: StrictStr = Field(description="The verification status of the bot's identity: * `verified` - well-known bot with publicly verifiable identity, directed by the bot provider. * `signed` - bot that signs its platform via Web Bot Auth, directed by the bot provider’s customers. * `spoofed` - bot that claims a public identity but fails verification. * `unknown` - bot that does not publish a verifiable identity. ") + confidence: StrictStr = Field(description="Confidence level of the bot identification.") + __properties: ClassVar[List[str]] = ["category", "provider", "provider_url", "name", "identity", "confidence"] + + @field_validator('identity') + def identity_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['verified', 'signed', 'spoofed', 'unknown']): + raise ValueError("must be one of enum values ('verified', 'signed', 'spoofed', 'unknown')") + return value + + @field_validator('confidence') + def confidence_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['low', 'medium', 'high']): + raise ValueError("must be one of enum values ('low', 'medium', 'high')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BotInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BotInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "category": obj.get("category"), + "provider": obj.get("provider"), + "provider_url": obj.get("provider_url"), + "name": obj.get("name"), + "identity": obj.get("identity"), + "confidence": obj.get("confidence") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/bot_result.py b/fingerprint_server_sdk/models/bot_result.py new file mode 100644 index 00000000..41dc280a --- /dev/null +++ b/fingerprint_server_sdk/models/bot_result.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class BotResult(str, Enum): + """ + Bot detection result: * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on * `not_detected` - the visitor is not a bot + """ + + """ + allowed enum values + """ + BAD = 'bad' + GOOD = 'good' + NOT_DETECTED = 'not_detected' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of BotResult from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/fingerprint_server_sdk/models/botd.py b/fingerprint_server_sdk/models/botd.py deleted file mode 100644 index 4f4666f1..00000000 --- a/fingerprint_server_sdk/models/botd.py +++ /dev/null @@ -1,264 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.botd_bot import BotdBot -from fingerprint_server_sdk.models.tag import Tag -from datetime import datetime - - -class Botd(BaseModel): - """ - Contains all the information from Bot Detection product - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'bot': 'BotdBot', - 'meta': 'Tag', - 'linked_id': 'str', - 'url': 'str', - 'ip': 'str', - 'time': 'datetime', - 'user_agent': 'str', - 'request_id': 'str' - } - - nullable_map = { - 'bot': False, - 'meta': False, - 'linked_id': False, - 'url': False, - 'ip': False, - 'time': False, - 'user_agent': False, - 'request_id': False - } - - attribute_map = { - 'bot': 'bot', - 'meta': 'meta', - 'linked_id': 'linkedId', - 'url': 'url', - 'ip': 'ip', - 'time': 'time', - 'user_agent': 'userAgent', - 'request_id': 'requestId' - } - - def __init__(self, bot=None, meta=None, linked_id=None, url=None, ip=None, time=None, user_agent=None, request_id=None): # noqa: E501 - """Botd - a model defined in Swagger""" # noqa: E501 - self._bot = None - self._meta = None - self._linked_id = None - self._url = None - self._ip = None - self._time = None - self._user_agent = None - self._request_id = None - self.discriminator = None - self.bot = bot - if meta is not None: - self.meta = meta - if linked_id is not None: - self.linked_id = linked_id - self.url = url - self.ip = ip - self.time = time - self.user_agent = user_agent - self.request_id = request_id - - @property - def bot(self) -> BotdBot: - """Gets the bot of this Botd. # noqa: E501 - - - :return: The bot of this Botd. # noqa: E501 - """ - return self._bot - - @bot.setter - def bot(self, bot: BotdBot): - """Sets the bot of this Botd. - - - :param bot: The bot of this Botd. # noqa: E501 - """ - if bot is None: - raise ValueError("Invalid value for `bot`, must not be `None`") # noqa: E501 - - self._bot = bot - - @property - def meta(self) -> Optional[Tag]: - """Gets the meta of this Botd. # noqa: E501 - - - :return: The meta of this Botd. # noqa: E501 - """ - return self._meta - - @meta.setter - def meta(self, meta: Optional[Tag]): - """Sets the meta of this Botd. - - - :param meta: The meta of this Botd. # noqa: E501 - """ - - self._meta = meta - - @property - def linked_id(self) -> Optional[str]: - """Gets the linked_id of this Botd. # noqa: E501 - - A customer-provided id that was sent with the request. # noqa: E501 - - :return: The linked_id of this Botd. # noqa: E501 - """ - return self._linked_id - - @linked_id.setter - def linked_id(self, linked_id: Optional[str]): - """Sets the linked_id of this Botd. - - A customer-provided id that was sent with the request. # noqa: E501 - - :param linked_id: The linked_id of this Botd. # noqa: E501 - """ - - self._linked_id = linked_id - - @property - def url(self) -> str: - """Gets the url of this Botd. # noqa: E501 - - Page URL from which the request was sent. # noqa: E501 - - :return: The url of this Botd. # noqa: E501 - """ - return self._url - - @url.setter - def url(self, url: str): - """Sets the url of this Botd. - - Page URL from which the request was sent. # noqa: E501 - - :param url: The url of this Botd. # noqa: E501 - """ - if url is None: - raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 - - self._url = url - - @property - def ip(self) -> str: - """Gets the ip of this Botd. # noqa: E501 - - IP address of the requesting browser or bot. # noqa: E501 - - :return: The ip of this Botd. # noqa: E501 - """ - return self._ip - - @ip.setter - def ip(self, ip: str): - """Sets the ip of this Botd. - - IP address of the requesting browser or bot. # noqa: E501 - - :param ip: The ip of this Botd. # noqa: E501 - """ - if ip is None: - raise ValueError("Invalid value for `ip`, must not be `None`") # noqa: E501 - - self._ip = ip - - @property - def time(self) -> datetime: - """Gets the time of this Botd. # noqa: E501 - - Time in UTC when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. # noqa: E501 - - :return: The time of this Botd. # noqa: E501 - """ - return self._time - - @time.setter - def time(self, time: datetime): - """Sets the time of this Botd. - - Time in UTC when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. # noqa: E501 - - :param time: The time of this Botd. # noqa: E501 - """ - if time is None: - raise ValueError("Invalid value for `time`, must not be `None`") # noqa: E501 - - self._time = time - - @property - def user_agent(self) -> str: - """Gets the user_agent of this Botd. # noqa: E501 - - - :return: The user_agent of this Botd. # noqa: E501 - """ - return self._user_agent - - @user_agent.setter - def user_agent(self, user_agent: str): - """Sets the user_agent of this Botd. - - - :param user_agent: The user_agent of this Botd. # noqa: E501 - """ - if user_agent is None: - raise ValueError("Invalid value for `user_agent`, must not be `None`") # noqa: E501 - - self._user_agent = user_agent - - @property - def request_id(self) -> str: - """Gets the request_id of this Botd. # noqa: E501 - - Unique identifier of the user's request. # noqa: E501 - - :return: The request_id of this Botd. # noqa: E501 - """ - return self._request_id - - @request_id.setter - def request_id(self, request_id: str): - """Sets the request_id of this Botd. - - Unique identifier of the user's request. # noqa: E501 - - :param request_id: The request_id of this Botd. # noqa: E501 - """ - if request_id is None: - raise ValueError("Invalid value for `request_id`, must not be `None`") # noqa: E501 - - self._request_id = request_id - diff --git a/fingerprint_server_sdk/models/botd_bot.py b/fingerprint_server_sdk/models/botd_bot.py deleted file mode 100644 index ef43b432..00000000 --- a/fingerprint_server_sdk/models/botd_bot.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.botd_bot_result import BotdBotResult - - -class BotdBot(BaseModel): - """ - Stores bot detection result - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'BotdBotResult', - 'type': 'str' - } - - nullable_map = { - 'result': False, - 'type': False - } - - attribute_map = { - 'result': 'result', - 'type': 'type' - } - - def __init__(self, result=None, type=None): # noqa: E501 - """BotdBot - a model defined in Swagger""" # noqa: E501 - self._result = None - self._type = None - self.discriminator = None - self.result = result - if type is not None: - self.type = type - - @property - def result(self) -> BotdBotResult: - """Gets the result of this BotdBot. # noqa: E501 - - - :return: The result of this BotdBot. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: BotdBotResult): - """Sets the result of this BotdBot. - - - :param result: The result of this BotdBot. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - - @property - def type(self) -> Optional[str]: - """Gets the type of this BotdBot. # noqa: E501 - - - :return: The type of this BotdBot. # noqa: E501 - """ - return self._type - - @type.setter - def type(self, type: Optional[str]): - """Sets the type of this BotdBot. - - - :param type: The type of this BotdBot. # noqa: E501 - """ - - self._type = type - diff --git a/fingerprint_server_sdk/models/botd_bot_result.py b/fingerprint_server_sdk/models/botd_bot_result.py deleted file mode 100644 index 8176876b..00000000 --- a/fingerprint_server_sdk/models/botd_bot_result.py +++ /dev/null @@ -1,52 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class BotdBotResult(BaseModel): - """ - Bot detection result: * `notDetected` - the visitor is not a bot * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - - """ - allowed enum values - """ - NOTDETECTED = "notDetected" - GOOD = "good" - BAD = "bad" - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - nullable_map = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """BotdBotResult - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - diff --git a/fingerprint_server_sdk/models/browser_details.py b/fingerprint_server_sdk/models/browser_details.py index 433f6bf2..ed847562 100644 --- a/fingerprint_server_sdk/models/browser_details.py +++ b/fingerprint_server_sdk/models/browser_details.py @@ -1,224 +1,98 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class BrowserDetails(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'browser_name': 'str', - 'browser_major_version': 'str', - 'browser_full_version': 'str', - 'os': 'str', - 'os_version': 'str', - 'device': 'str', - 'user_agent': 'str' - } - - nullable_map = { - 'browser_name': False, - 'browser_major_version': False, - 'browser_full_version': False, - 'os': False, - 'os_version': False, - 'device': False, - 'user_agent': False - } - - attribute_map = { - 'browser_name': 'browserName', - 'browser_major_version': 'browserMajorVersion', - 'browser_full_version': 'browserFullVersion', - 'os': 'os', - 'os_version': 'osVersion', - 'device': 'device', - 'user_agent': 'userAgent' - } - - def __init__(self, browser_name=None, browser_major_version=None, browser_full_version=None, os=None, os_version=None, device=None, user_agent=None): # noqa: E501 - """BrowserDetails - a model defined in Swagger""" # noqa: E501 - self._browser_name = None - self._browser_major_version = None - self._browser_full_version = None - self._os = None - self._os_version = None - self._device = None - self._user_agent = None - self.discriminator = None - self.browser_name = browser_name - self.browser_major_version = browser_major_version - self.browser_full_version = browser_full_version - self.os = os - self.os_version = os_version - self.device = device - self.user_agent = user_agent - - @property - def browser_name(self) -> str: - """Gets the browser_name of this BrowserDetails. # noqa: E501 - - - :return: The browser_name of this BrowserDetails. # noqa: E501 - """ - return self._browser_name - - @browser_name.setter - def browser_name(self, browser_name: str): - """Sets the browser_name of this BrowserDetails. - - - :param browser_name: The browser_name of this BrowserDetails. # noqa: E501 - """ - if browser_name is None: - raise ValueError("Invalid value for `browser_name`, must not be `None`") # noqa: E501 - - self._browser_name = browser_name - - @property - def browser_major_version(self) -> str: - """Gets the browser_major_version of this BrowserDetails. # noqa: E501 - - - :return: The browser_major_version of this BrowserDetails. # noqa: E501 - """ - return self._browser_major_version - - @browser_major_version.setter - def browser_major_version(self, browser_major_version: str): - """Sets the browser_major_version of this BrowserDetails. - - - :param browser_major_version: The browser_major_version of this BrowserDetails. # noqa: E501 - """ - if browser_major_version is None: - raise ValueError("Invalid value for `browser_major_version`, must not be `None`") # noqa: E501 - - self._browser_major_version = browser_major_version - - @property - def browser_full_version(self) -> str: - """Gets the browser_full_version of this BrowserDetails. # noqa: E501 - - - :return: The browser_full_version of this BrowserDetails. # noqa: E501 - """ - return self._browser_full_version - - @browser_full_version.setter - def browser_full_version(self, browser_full_version: str): - """Sets the browser_full_version of this BrowserDetails. - - - :param browser_full_version: The browser_full_version of this BrowserDetails. # noqa: E501 - """ - if browser_full_version is None: - raise ValueError("Invalid value for `browser_full_version`, must not be `None`") # noqa: E501 - - self._browser_full_version = browser_full_version +""" # noqa: E501 - @property - def os(self) -> str: - """Gets the os of this BrowserDetails. # noqa: E501 +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - :return: The os of this BrowserDetails. # noqa: E501 - """ - return self._os - - @os.setter - def os(self, os: str): - """Sets the os of this BrowserDetails. - - - :param os: The os of this BrowserDetails. # noqa: E501 - """ - if os is None: - raise ValueError("Invalid value for `os`, must not be `None`") # noqa: E501 - - self._os = os - - @property - def os_version(self) -> str: - """Gets the os_version of this BrowserDetails. # noqa: E501 - - - :return: The os_version of this BrowserDetails. # noqa: E501 - """ - return self._os_version - - @os_version.setter - def os_version(self, os_version: str): - """Sets the os_version of this BrowserDetails. - - - :param os_version: The os_version of this BrowserDetails. # noqa: E501 - """ - if os_version is None: - raise ValueError("Invalid value for `os_version`, must not be `None`") # noqa: E501 - - self._os_version = os_version - - @property - def device(self) -> str: - """Gets the device of this BrowserDetails. # noqa: E501 - - - :return: The device of this BrowserDetails. # noqa: E501 - """ - return self._device - - @device.setter - def device(self, device: str): - """Sets the device of this BrowserDetails. - - - :param device: The device of this BrowserDetails. # noqa: E501 - """ - if device is None: - raise ValueError("Invalid value for `device`, must not be `None`") # noqa: E501 - - self._device = device - - @property - def user_agent(self) -> str: - """Gets the user_agent of this BrowserDetails. # noqa: E501 - - - :return: The user_agent of this BrowserDetails. # noqa: E501 - """ - return self._user_agent - - @user_agent.setter - def user_agent(self, user_agent: str): - """Sets the user_agent of this BrowserDetails. - +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self - :param user_agent: The user_agent of this BrowserDetails. # noqa: E501 +class BrowserDetails(BaseModel): + """ + BrowserDetails + """ # noqa: E501 + browser_name: StrictStr + browser_major_version: StrictStr + browser_full_version: StrictStr + os: StrictStr + os_version: StrictStr + device: StrictStr + __properties: ClassVar[List[str]] = ["browser_name", "browser_major_version", "browser_full_version", "os", "os_version", "device"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of BrowserDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - if user_agent is None: - raise ValueError("Invalid value for `user_agent`, must not be `None`") # noqa: E501 + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of BrowserDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "browser_name": obj.get("browser_name"), + "browser_major_version": obj.get("browser_major_version"), + "browser_full_version": obj.get("browser_full_version"), + "os": obj.get("os"), + "os_version": obj.get("os_version"), + "device": obj.get("device") + }) + return _obj - self._user_agent = user_agent diff --git a/fingerprint_server_sdk/models/canvas.py b/fingerprint_server_sdk/models/canvas.py new file mode 100644 index 00000000..5321df68 --- /dev/null +++ b/fingerprint_server_sdk/models/canvas.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class Canvas(BaseModel): + """ + Canvas fingerprint containing winding flag plus geometry/text hashes. + """ # noqa: E501 + winding: Optional[StrictBool] = None + geometry: Optional[StrictStr] = Field(default=None, description="Hash of geometry rendering output or `unsupported` markers.") + text: Optional[StrictStr] = Field(default=None, description="Hash of text rendering output or `unsupported` markers.") + __properties: ClassVar[List[str]] = ["winding", "geometry", "text"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Canvas from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Canvas from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "winding": obj.get("winding"), + "geometry": obj.get("geometry"), + "text": obj.get("text") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/cloned_app.py b/fingerprint_server_sdk/models/cloned_app.py deleted file mode 100644 index ad1a085b..00000000 --- a/fingerprint_server_sdk/models/cloned_app.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class ClonedApp(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """ClonedApp - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - self.result = result - - @property - def result(self) -> bool: - """Gets the result of this ClonedApp. # noqa: E501 - - Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. # noqa: E501 - - :return: The result of this ClonedApp. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this ClonedApp. - - Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. # noqa: E501 - - :param result: The result of this ClonedApp. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - diff --git a/fingerprint_server_sdk/models/deprecated_geolocation.py b/fingerprint_server_sdk/models/deprecated_geolocation.py deleted file mode 100644 index a15d8cac..00000000 --- a/fingerprint_server_sdk/models/deprecated_geolocation.py +++ /dev/null @@ -1,278 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.geolocation_city import GeolocationCity -from fingerprint_server_sdk.models.geolocation_country import GeolocationCountry -from fingerprint_server_sdk.models.geolocation_continent import GeolocationContinent -from fingerprint_server_sdk.models.geolocation_subdivisions import GeolocationSubdivisions -from typing_extensions import deprecated - - -@deprecated("This class is deprecated. Please avoid using it in new code.") -class DeprecatedGeolocation(BaseModel): - """ - This field is **deprecated** and will not return a result for **applications created after January 23rd, 2024**. Please use the [IP Geolocation Smart signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) for geolocation information. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'accuracy_radius': 'int', - 'latitude': 'float', - 'longitude': 'float', - 'postal_code': 'str', - 'timezone': 'str', - 'city': 'GeolocationCity', - 'country': 'GeolocationCountry', - 'continent': 'GeolocationContinent', - 'subdivisions': 'GeolocationSubdivisions' - } - - nullable_map = { - 'accuracy_radius': False, - 'latitude': False, - 'longitude': False, - 'postal_code': False, - 'timezone': False, - 'city': False, - 'country': False, - 'continent': False, - 'subdivisions': False - } - - attribute_map = { - 'accuracy_radius': 'accuracyRadius', - 'latitude': 'latitude', - 'longitude': 'longitude', - 'postal_code': 'postalCode', - 'timezone': 'timezone', - 'city': 'city', - 'country': 'country', - 'continent': 'continent', - 'subdivisions': 'subdivisions' - } - - def __init__(self, accuracy_radius=None, latitude=None, longitude=None, postal_code=None, timezone=None, city=None, country=None, continent=None, subdivisions=None): # noqa: E501 - """DeprecatedGeolocation - a model defined in Swagger""" # noqa: E501 - self._accuracy_radius = None - self._latitude = None - self._longitude = None - self._postal_code = None - self._timezone = None - self._city = None - self._country = None - self._continent = None - self._subdivisions = None - self.discriminator = None - if accuracy_radius is not None: - self.accuracy_radius = accuracy_radius - if latitude is not None: - self.latitude = latitude - if longitude is not None: - self.longitude = longitude - if postal_code is not None: - self.postal_code = postal_code - if timezone is not None: - self.timezone = timezone - if city is not None: - self.city = city - if country is not None: - self.country = country - if continent is not None: - self.continent = continent - if subdivisions is not None: - self.subdivisions = subdivisions - - @property - def accuracy_radius(self) -> Optional[int]: - """Gets the accuracy_radius of this DeprecatedGeolocation. # noqa: E501 - - The IP address is likely to be within this radius (in km) of the specified location. # noqa: E501 - - :return: The accuracy_radius of this DeprecatedGeolocation. # noqa: E501 - """ - return self._accuracy_radius - - @accuracy_radius.setter - def accuracy_radius(self, accuracy_radius: Optional[int]): - """Sets the accuracy_radius of this DeprecatedGeolocation. - - The IP address is likely to be within this radius (in km) of the specified location. # noqa: E501 - - :param accuracy_radius: The accuracy_radius of this DeprecatedGeolocation. # noqa: E501 - """ - - self._accuracy_radius = accuracy_radius - - @property - def latitude(self) -> Optional[float]: - """Gets the latitude of this DeprecatedGeolocation. # noqa: E501 - - - :return: The latitude of this DeprecatedGeolocation. # noqa: E501 - """ - return self._latitude - - @latitude.setter - def latitude(self, latitude: Optional[float]): - """Sets the latitude of this DeprecatedGeolocation. - - - :param latitude: The latitude of this DeprecatedGeolocation. # noqa: E501 - """ - - self._latitude = latitude - - @property - def longitude(self) -> Optional[float]: - """Gets the longitude of this DeprecatedGeolocation. # noqa: E501 - - - :return: The longitude of this DeprecatedGeolocation. # noqa: E501 - """ - return self._longitude - - @longitude.setter - def longitude(self, longitude: Optional[float]): - """Sets the longitude of this DeprecatedGeolocation. - - - :param longitude: The longitude of this DeprecatedGeolocation. # noqa: E501 - """ - - self._longitude = longitude - - @property - def postal_code(self) -> Optional[str]: - """Gets the postal_code of this DeprecatedGeolocation. # noqa: E501 - - - :return: The postal_code of this DeprecatedGeolocation. # noqa: E501 - """ - return self._postal_code - - @postal_code.setter - def postal_code(self, postal_code: Optional[str]): - """Sets the postal_code of this DeprecatedGeolocation. - - - :param postal_code: The postal_code of this DeprecatedGeolocation. # noqa: E501 - """ - - self._postal_code = postal_code - - @property - def timezone(self) -> Optional[str]: - """Gets the timezone of this DeprecatedGeolocation. # noqa: E501 - - - :return: The timezone of this DeprecatedGeolocation. # noqa: E501 - """ - return self._timezone - - @timezone.setter - def timezone(self, timezone: Optional[str]): - """Sets the timezone of this DeprecatedGeolocation. - - - :param timezone: The timezone of this DeprecatedGeolocation. # noqa: E501 - """ - - self._timezone = timezone - - @property - def city(self) -> Optional[GeolocationCity]: - """Gets the city of this DeprecatedGeolocation. # noqa: E501 - - - :return: The city of this DeprecatedGeolocation. # noqa: E501 - """ - return self._city - - @city.setter - def city(self, city: Optional[GeolocationCity]): - """Sets the city of this DeprecatedGeolocation. - - - :param city: The city of this DeprecatedGeolocation. # noqa: E501 - """ - - self._city = city - - @property - def country(self) -> Optional[GeolocationCountry]: - """Gets the country of this DeprecatedGeolocation. # noqa: E501 - - - :return: The country of this DeprecatedGeolocation. # noqa: E501 - """ - return self._country - - @country.setter - def country(self, country: Optional[GeolocationCountry]): - """Sets the country of this DeprecatedGeolocation. - - - :param country: The country of this DeprecatedGeolocation. # noqa: E501 - """ - - self._country = country - - @property - def continent(self) -> Optional[GeolocationContinent]: - """Gets the continent of this DeprecatedGeolocation. # noqa: E501 - - - :return: The continent of this DeprecatedGeolocation. # noqa: E501 - """ - return self._continent - - @continent.setter - def continent(self, continent: Optional[GeolocationContinent]): - """Sets the continent of this DeprecatedGeolocation. - - - :param continent: The continent of this DeprecatedGeolocation. # noqa: E501 - """ - - self._continent = continent - - @property - def subdivisions(self) -> Optional[GeolocationSubdivisions]: - """Gets the subdivisions of this DeprecatedGeolocation. # noqa: E501 - - - :return: The subdivisions of this DeprecatedGeolocation. # noqa: E501 - """ - return self._subdivisions - - @subdivisions.setter - def subdivisions(self, subdivisions: Optional[GeolocationSubdivisions]): - """Sets the subdivisions of this DeprecatedGeolocation. - - - :param subdivisions: The subdivisions of this DeprecatedGeolocation. # noqa: E501 - """ - - self._subdivisions = subdivisions - diff --git a/fingerprint_server_sdk/models/developer_tools.py b/fingerprint_server_sdk/models/developer_tools.py deleted file mode 100644 index 2286c6eb..00000000 --- a/fingerprint_server_sdk/models/developer_tools.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class DeveloperTools(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """DeveloperTools - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - self.result = result - - @property - def result(self) -> bool: - """Gets the result of this DeveloperTools. # noqa: E501 - - `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. # noqa: E501 - - :return: The result of this DeveloperTools. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this DeveloperTools. - - `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. # noqa: E501 - - :param result: The result of this DeveloperTools. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - diff --git a/fingerprint_server_sdk/models/emoji.py b/fingerprint_server_sdk/models/emoji.py new file mode 100644 index 00000000..22a51b8d --- /dev/null +++ b/fingerprint_server_sdk/models/emoji.py @@ -0,0 +1,104 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class Emoji(BaseModel): + """ + Bounding box metrics describing how the emoji glyph renders. + """ # noqa: E501 + font: Optional[StrictStr] = Field(default=None, description="Font family reported by the browser when drawing the emoji.") + width: Optional[Union[StrictFloat, StrictInt]] = None + height: Optional[Union[StrictFloat, StrictInt]] = None + top: Optional[Union[StrictFloat, StrictInt]] = None + bottom: Optional[Union[StrictFloat, StrictInt]] = None + left: Optional[Union[StrictFloat, StrictInt]] = None + right: Optional[Union[StrictFloat, StrictInt]] = None + x: Optional[Union[StrictFloat, StrictInt]] = None + y: Optional[Union[StrictFloat, StrictInt]] = None + __properties: ClassVar[List[str]] = ["font", "width", "height", "top", "bottom", "left", "right", "x", "y"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Emoji from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Emoji from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "font": obj.get("font"), + "width": obj.get("width"), + "height": obj.get("height"), + "top": obj.get("top"), + "bottom": obj.get("bottom"), + "left": obj.get("left"), + "right": obj.get("right"), + "x": obj.get("x"), + "y": obj.get("y") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/emulator.py b/fingerprint_server_sdk/models/emulator.py deleted file mode 100644 index 89a9a51b..00000000 --- a/fingerprint_server_sdk/models/emulator.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class Emulator(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """Emulator - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - self.result = result - - @property - def result(self) -> bool: - """Gets the result of this Emulator. # noqa: E501 - - Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. # noqa: E501 - - :return: The result of this Emulator. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this Emulator. - - Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. # noqa: E501 - - :param result: The result of this Emulator. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - diff --git a/fingerprint_server_sdk/models/error.py b/fingerprint_server_sdk/models/error.py index 73e5ac81..2df9a6af 100644 --- a/fingerprint_server_sdk/models/error.py +++ b/fingerprint_server_sdk/models/error.py @@ -1,95 +1,91 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.error_code import ErrorCode - - -class Error(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'code': 'ErrorCode', - 'message': 'str' - } - - nullable_map = { - 'code': False, - 'message': False - } - - attribute_map = { - 'code': 'code', - 'message': 'message' - } - - def __init__(self, code=None, message=None): # noqa: E501 - """Error - a model defined in Swagger""" # noqa: E501 - self._code = None - self._message = None - self.discriminator = None - self.code = code - self.message = message - - @property - def code(self) -> ErrorCode: - """Gets the code of this Error. # noqa: E501 - - - :return: The code of this Error. # noqa: E501 - """ - return self._code - - @code.setter - def code(self, code: ErrorCode): - """Sets the code of this Error. +""" # noqa: E501 - :param code: The code of this Error. # noqa: E501 - """ - if code is None: - raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 - - self._code = code - - @property - def message(self) -> str: - """Gets the message of this Error. # noqa: E501 - - - :return: The message of this Error. # noqa: E501 - """ - return self._message - - @message.setter - def message(self, message: str): - """Sets the message of this Error. +from __future__ import annotations +import pprint +import re # noqa: F401 +import json +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from fingerprint_server_sdk.models.error_code import ErrorCode +from typing import Optional, Set +from typing_extensions import Self - :param message: The message of this Error. # noqa: E501 +class Error(BaseModel): + """ + Error + """ # noqa: E501 + code: ErrorCode + message: StrictStr + __properties: ClassVar[List[str]] = ["code", "message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Error from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - if message is None: - raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Error from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "code": obj.get("code"), + "message": obj.get("message") + }) + return _obj - self._message = message diff --git a/fingerprint_server_sdk/models/error_code.py b/fingerprint_server_sdk/models/error_code.py index 648f2ed0..37528758 100644 --- a/fingerprint_server_sdk/models/error_code.py +++ b/fingerprint_server_sdk/models/error_code.py @@ -1,61 +1,54 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel + Do not edit the class manually. +""" # noqa: E501 -class ErrorCode(BaseModel): - """ - Error code: * `RequestCannotBeParsed` - the query parameters or JSON payload contains some errors that prevented us from parsing it (wrong type/surpassed limits). * `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. * `RequestNotFound` - the specified request ID was not found. It never existed, expired, or it has been deleted. * `VisitorNotFound` - The specified visitor ID was not found. It never existed or it may have already been deleted. * `TooManyRequests` - the limit on secret API key requests per second has been exceeded. * `429 Too Many Requests` - the limit on secret API key requests per second has been exceeded. * `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. * `Failed` - internal server error. +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self - NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. +class ErrorCode(str, Enum): + """ + Error code: * `request_cannot_be_parsed` - The query parameters or JSON payload contains some errors that prevented us from parsing it (wrong type/surpassed limits). * `secret_api_key_required` - secret API key in header is missing or empty. * `secret_api_key_not_found` - No Fingerprint workspace found for specified secret API key. * `public_api_key_required` - public API key in header is missing or empty. * `public_api_key_not_found` - No Fingerprint workspace found for specified public API key. * `subscription_not_active` - Fingerprint workspace is not active. * `wrong_region` - Server and workspace region differ. * `feature_not_enabled` - This feature (for example, Delete API) is not enabled for your workspace. * `request_not_found` - The specified event ID was not found. It never existed, expired, or it has been deleted. * `visitor_not_found` - The specified visitor ID was not found. It never existed or it may have already been deleted. * `too_many_requests` - The limit on secret API key requests per second has been exceeded. * `state_not_ready` - The event specified with event ID is not ready for updates yet. Try again. This error happens in rare cases when update API is called immediately after receiving the event ID on the client. In case you need to send information right away, we recommend using the JS agent API instead. * `failed` - Internal server error. * `event_not_found` - The specified event ID was not found. It never existed, expired, or it has been deleted. * `missing_module` - The request is invalid because it is missing a required module. * `payload_too_large` - The request payload is too large and cannot be processed. * `service_unavailable` - The service was unable to process the request. * `ruleset_not_found` - The specified ruleset was not found. It never existed or it has been deleted. """ """ allowed enum values """ - REQUESTCANNOTBEPARSED = "RequestCannotBeParsed" - TOKENREQUIRED = "TokenRequired" - TOKENNOTFOUND = "TokenNotFound" - SUBSCRIPTIONNOTACTIVE = "SubscriptionNotActive" - WRONGREGION = "WrongRegion" - FEATURENOTENABLED = "FeatureNotEnabled" - REQUESTNOTFOUND = "RequestNotFound" - VISITORNOTFOUND = "VisitorNotFound" - TOOMANYREQUESTS = "TooManyRequests" - _429_TOO_MANY_REQUESTS = "429 Too Many Requests" - STATENOTREADY = "StateNotReady" - FAILED = "Failed" - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - nullable_map = { - } - - attribute_map = { - } + REQUEST_CANNOT_BE_PARSED = 'request_cannot_be_parsed' + SECRET_API_KEY_REQUIRED = 'secret_api_key_required' + SECRET_API_KEY_NOT_FOUND = 'secret_api_key_not_found' + PUBLIC_API_KEY_REQUIRED = 'public_api_key_required' + PUBLIC_API_KEY_NOT_FOUND = 'public_api_key_not_found' + SUBSCRIPTION_NOT_ACTIVE = 'subscription_not_active' + WRONG_REGION = 'wrong_region' + FEATURE_NOT_ENABLED = 'feature_not_enabled' + REQUEST_NOT_FOUND = 'request_not_found' + VISITOR_NOT_FOUND = 'visitor_not_found' + TOO_MANY_REQUESTS = 'too_many_requests' + STATE_NOT_READY = 'state_not_ready' + FAILED = 'failed' + EVENT_NOT_FOUND = 'event_not_found' + MISSING_MODULE = 'missing_module' + PAYLOAD_TOO_LARGE = 'payload_too_large' + SERVICE_UNAVAILABLE = 'service_unavailable' + RULESET_NOT_FOUND = 'ruleset_not_found' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ErrorCode from a JSON string""" + return cls(json.loads(json_str)) - def __init__(self): # noqa: E501 - """ErrorCode - a model defined in Swagger""" # noqa: E501 - self.discriminator = None diff --git a/fingerprint_server_sdk/models/error_plain_response.py b/fingerprint_server_sdk/models/error_plain_response.py deleted file mode 100644 index 712e794a..00000000 --- a/fingerprint_server_sdk/models/error_plain_response.py +++ /dev/null @@ -1,73 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - Fingerprint Server API allows you to get information about visitors and about individual events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. # noqa: E501 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class ErrorPlainResponse(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'error': 'str' - } - - attribute_map = { - 'error': 'error' - } - - def __init__(self, error=None): # noqa: E501 - """ErrorPlainResponse - a model defined in Swagger""" # noqa: E501 - self._error = None - self.discriminator = None - self.error = error - self.retry_after = 0 - - @property - def error(self) -> str: - """Gets the error of this ErrorPlainResponse. # noqa: E501 - - - :return: The error of this ErrorPlainResponse. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: str): - """Sets the error of this ErrorPlainResponse. - - - :param error: The error of this ErrorPlainResponse. # noqa: E501 - """ - if error is None: - raise ValueError("Invalid value for `error`, must not be `None`") # noqa: E501 - - self._error = error - - @property - def retry_after(self) -> int: - """Indicates how many seconds you should wait before attempting the next request for 429 error """ - return self._retry_after - - @retry_after.setter - def retry_after(self, retry_after: int): - self._retry_after = retry_after diff --git a/fingerprint_server_sdk/models/error_response.py b/fingerprint_server_sdk/models/error_response.py index 347ad6d6..e0bb54cf 100644 --- a/fingerprint_server_sdk/models/error_response.py +++ b/fingerprint_server_sdk/models/error_response.py @@ -1,69 +1,92 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations +import pprint import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.error import Error +import json +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List +from fingerprint_server_sdk.models.error import Error +from typing import Optional, Set +from typing_extensions import Self class ErrorResponse(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'error': 'Error' - } - - nullable_map = { - 'error': False - } + ErrorResponse + """ # noqa: E501 + error: Error + __properties: ClassVar[List[str]] = ["error"] - attribute_map = { - 'error': 'error' - } + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - def __init__(self, error=None): # noqa: E501 - """ErrorResponse - a model defined in Swagger""" # noqa: E501 - self._error = None - self.discriminator = None - self.error = error - @property - def error(self) -> Error: - """Gets the error of this ErrorResponse. # noqa: E501 + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) - :return: The error of this ErrorResponse. # noqa: E501 - """ - return self._error + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ErrorResponse from a JSON string""" + return cls.from_dict(json.loads(json_str)) - @error.setter - def error(self, error: Error): - """Sets the error of this ErrorResponse. + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - :param error: The error of this ErrorResponse. # noqa: E501 + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - if error is None: - raise ValueError("Invalid value for `error`, must not be `None`") # noqa: E501 + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of error + if self.error: + _dict['error'] = self.error.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ErrorResponse from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "error": Error.from_dict(obj["error"]) if obj.get("error") is not None else None + }) + return _obj - self._error = error diff --git a/fingerprint_server_sdk/models/event.py b/fingerprint_server_sdk/models/event.py new file mode 100644 index 00000000..4174c5ef --- /dev/null +++ b/fingerprint_server_sdk/models/event.py @@ -0,0 +1,245 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from fingerprint_server_sdk.models.bot_info import BotInfo +from fingerprint_server_sdk.models.bot_result import BotResult +from fingerprint_server_sdk.models.browser_details import BrowserDetails +from fingerprint_server_sdk.models.event_rule_action import EventRuleAction +from fingerprint_server_sdk.models.identification import Identification +from fingerprint_server_sdk.models.ip_block_list import IPBlockList +from fingerprint_server_sdk.models.ip_info import IPInfo +from fingerprint_server_sdk.models.proximity import Proximity +from fingerprint_server_sdk.models.proxy_confidence import ProxyConfidence +from fingerprint_server_sdk.models.proxy_details import ProxyDetails +from fingerprint_server_sdk.models.raw_device_attributes import RawDeviceAttributes +from fingerprint_server_sdk.models.sdk import SDK +from fingerprint_server_sdk.models.supplementary_id_high_recall import SupplementaryIDHighRecall +from fingerprint_server_sdk.models.tampering_details import TamperingDetails +from fingerprint_server_sdk.models.velocity import Velocity +from fingerprint_server_sdk.models.vpn_confidence import VpnConfidence +from fingerprint_server_sdk.models.vpn_methods import VpnMethods +from typing import Optional, Set +from typing_extensions import Self + +class Event(BaseModel): + """ + Contains results from Fingerprint Identification and all active Smart Signals. + """ # noqa: E501 + event_id: StrictStr = Field(description="Unique identifier of the user's request. The first portion of the event_id is a unix epoch milliseconds timestamp For example: `1758130560902.8tRtrH` ") + timestamp: StrictInt = Field(description="Timestamp of the event with millisecond precision in Unix time.") + linked_id: Optional[StrictStr] = Field(default=None, description="A customer-provided id that was sent with the request.") + environment_id: Optional[StrictStr] = Field(default=None, description="Environment Id of the event. For example: `ae_47abaca3db2c7c43` ") + suspect: Optional[StrictBool] = Field(default=None, description="Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://docs.fingerprint.com/reference/server-api-v4-update-event).") + sdk: Optional[SDK] = None + replayed: Optional[StrictBool] = Field(default=None, description="`true` if we determined that this payload was replayed, `false` otherwise. ") + identification: Optional[Identification] = None + supplementary_id_high_recall: Optional[SupplementaryIDHighRecall] = None + tags: Optional[Dict[str, Any]] = Field(default=None, description="A customer-provided value or an object that was sent with the identification request or updated later.") + url: Optional[StrictStr] = Field(default=None, description="Page URL from which the request was sent. For example `https://example.com/` ") + bundle_id: Optional[StrictStr] = Field(default=None, description="Bundle Id of the iOS application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` ") + package_name: Optional[StrictStr] = Field(default=None, description="Package name of the Android application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` ") + ip_address: Optional[StrictStr] = Field(default=None, description="IP address of the requesting browser or bot.") + user_agent: Optional[StrictStr] = Field(default=None, description="User Agent of the client, for example: `Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....` ") + client_referrer: Optional[StrictStr] = Field(default=None, description="Client Referrer field corresponds to the `document.referrer` field gathered during an identification request. The value is an empty string if the user navigated to the page directly (not through a link, but, for example, by using a bookmark) For example: `https://example.com/blog/my-article` ") + browser_details: Optional[BrowserDetails] = None + proximity: Optional[Proximity] = None + bot: Optional[BotResult] = None + bot_type: Optional[StrictStr] = Field(default=None, description="Additional classification of the bot type if detected. ") + bot_info: Optional[BotInfo] = None + cloned_app: Optional[StrictBool] = Field(default=None, description="Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. ") + developer_tools: Optional[StrictBool] = Field(default=None, description="`true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. ") + emulator: Optional[StrictBool] = Field(default=None, description="Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. ") + factory_reset_timestamp: Optional[StrictInt] = Field(default=None, description="The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC) as a value of 0. See [Factory Reset Detection](https://docs.fingerprint.com/docs/smart-signals-reference#factory-reset-detection) to learn more about this Smart Signal. ") + frida: Optional[StrictBool] = Field(default=None, description="[Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. ") + ip_blocklist: Optional[IPBlockList] = None + ip_info: Optional[IPInfo] = None + proxy: Optional[StrictBool] = Field(default=None, description="IP address was used by a public proxy provider or belonged to a known recent residential proxy ") + proxy_confidence: Optional[ProxyConfidence] = None + proxy_details: Optional[ProxyDetails] = None + incognito: Optional[StrictBool] = Field(default=None, description="`true` if we detected incognito mode used in the browser, `false` otherwise. ") + jailbroken: Optional[StrictBool] = Field(default=None, description="iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. ") + location_spoofing: Optional[StrictBool] = Field(default=None, description="Flag indicating whether the request came from a mobile device with location spoofing enabled.") + mitm_attack: Optional[StrictBool] = Field(default=None, description="* `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://docs.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. ") + privacy_settings: Optional[StrictBool] = Field(default=None, description="`true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. ") + root_apps: Optional[StrictBool] = Field(default=None, description="Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. ") + rule_action: Optional[EventRuleAction] = None + suspect_score: Optional[StrictInt] = Field(default=None, description="Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://docs.fingerprint.com/docs/suspect-score ") + tampering: Optional[StrictBool] = Field(default=None, description="Flag indicating browser tampering was detected. This happens when either: * There are inconsistencies in the browser configuration that cross internal tampering thresholds (see `tampering_details.anomaly_score`). * The browser signature resembles an \"anti-detect\" browser specifically designed to evade fingerprinting (see `tampering_details.anti_detect_browser`). ") + tampering_details: Optional[TamperingDetails] = None + velocity: Optional[Velocity] = None + virtual_machine: Optional[StrictBool] = Field(default=None, description="`true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. ") + vpn: Optional[StrictBool] = Field(default=None, description="VPN or other anonymizing service has been used when sending the request. ") + vpn_confidence: Optional[VpnConfidence] = None + vpn_origin_timezone: Optional[StrictStr] = Field(default=None, description="Local timezone which is used in timezone_mismatch method. ") + vpn_origin_country: Optional[StrictStr] = Field(default=None, description="Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). ") + vpn_methods: Optional[VpnMethods] = None + high_activity_device: Optional[StrictBool] = Field(default=None, description="Flag indicating if the request came from a high-activity visitor.") + raw_device_attributes: Optional[RawDeviceAttributes] = None + __properties: ClassVar[List[str]] = ["event_id", "timestamp", "linked_id", "environment_id", "suspect", "sdk", "replayed", "identification", "supplementary_id_high_recall", "tags", "url", "bundle_id", "package_name", "ip_address", "user_agent", "client_referrer", "browser_details", "proximity", "bot", "bot_type", "bot_info", "cloned_app", "developer_tools", "emulator", "factory_reset_timestamp", "frida", "ip_blocklist", "ip_info", "proxy", "proxy_confidence", "proxy_details", "incognito", "jailbroken", "location_spoofing", "mitm_attack", "privacy_settings", "root_apps", "rule_action", "suspect_score", "tampering", "tampering_details", "velocity", "virtual_machine", "vpn", "vpn_confidence", "vpn_origin_timezone", "vpn_origin_country", "vpn_methods", "high_activity_device", "raw_device_attributes"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Event from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of sdk + if self.sdk: + _dict['sdk'] = self.sdk.to_dict() + # override the default output from pydantic by calling `to_dict()` of identification + if self.identification: + _dict['identification'] = self.identification.to_dict() + # override the default output from pydantic by calling `to_dict()` of supplementary_id_high_recall + if self.supplementary_id_high_recall: + _dict['supplementary_id_high_recall'] = self.supplementary_id_high_recall.to_dict() + # override the default output from pydantic by calling `to_dict()` of browser_details + if self.browser_details: + _dict['browser_details'] = self.browser_details.to_dict() + # override the default output from pydantic by calling `to_dict()` of proximity + if self.proximity: + _dict['proximity'] = self.proximity.to_dict() + # override the default output from pydantic by calling `to_dict()` of bot_info + if self.bot_info: + _dict['bot_info'] = self.bot_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of ip_blocklist + if self.ip_blocklist: + _dict['ip_blocklist'] = self.ip_blocklist.to_dict() + # override the default output from pydantic by calling `to_dict()` of ip_info + if self.ip_info: + _dict['ip_info'] = self.ip_info.to_dict() + # override the default output from pydantic by calling `to_dict()` of proxy_details + if self.proxy_details: + _dict['proxy_details'] = self.proxy_details.to_dict() + # override the default output from pydantic by calling `to_dict()` of rule_action + if self.rule_action: + _dict['rule_action'] = self.rule_action.to_dict() + # override the default output from pydantic by calling `to_dict()` of tampering_details + if self.tampering_details: + _dict['tampering_details'] = self.tampering_details.to_dict() + # override the default output from pydantic by calling `to_dict()` of velocity + if self.velocity: + _dict['velocity'] = self.velocity.to_dict() + # override the default output from pydantic by calling `to_dict()` of vpn_methods + if self.vpn_methods: + _dict['vpn_methods'] = self.vpn_methods.to_dict() + # override the default output from pydantic by calling `to_dict()` of raw_device_attributes + if self.raw_device_attributes: + _dict['raw_device_attributes'] = self.raw_device_attributes.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Event from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "event_id": obj.get("event_id"), + "timestamp": obj.get("timestamp"), + "linked_id": obj.get("linked_id"), + "environment_id": obj.get("environment_id"), + "suspect": obj.get("suspect"), + "sdk": SDK.from_dict(obj["sdk"]) if obj.get("sdk") is not None else None, + "replayed": obj.get("replayed"), + "identification": Identification.from_dict(obj["identification"]) if obj.get("identification") is not None else None, + "supplementary_id_high_recall": SupplementaryIDHighRecall.from_dict(obj["supplementary_id_high_recall"]) if obj.get("supplementary_id_high_recall") is not None else None, + "tags": obj.get("tags"), + "url": obj.get("url"), + "bundle_id": obj.get("bundle_id"), + "package_name": obj.get("package_name"), + "ip_address": obj.get("ip_address"), + "user_agent": obj.get("user_agent"), + "client_referrer": obj.get("client_referrer"), + "browser_details": BrowserDetails.from_dict(obj["browser_details"]) if obj.get("browser_details") is not None else None, + "proximity": Proximity.from_dict(obj["proximity"]) if obj.get("proximity") is not None else None, + "bot": obj.get("bot"), + "bot_type": obj.get("bot_type"), + "bot_info": BotInfo.from_dict(obj["bot_info"]) if obj.get("bot_info") is not None else None, + "cloned_app": obj.get("cloned_app"), + "developer_tools": obj.get("developer_tools"), + "emulator": obj.get("emulator"), + "factory_reset_timestamp": obj.get("factory_reset_timestamp"), + "frida": obj.get("frida"), + "ip_blocklist": IPBlockList.from_dict(obj["ip_blocklist"]) if obj.get("ip_blocklist") is not None else None, + "ip_info": IPInfo.from_dict(obj["ip_info"]) if obj.get("ip_info") is not None else None, + "proxy": obj.get("proxy"), + "proxy_confidence": obj.get("proxy_confidence"), + "proxy_details": ProxyDetails.from_dict(obj["proxy_details"]) if obj.get("proxy_details") is not None else None, + "incognito": obj.get("incognito"), + "jailbroken": obj.get("jailbroken"), + "location_spoofing": obj.get("location_spoofing"), + "mitm_attack": obj.get("mitm_attack"), + "privacy_settings": obj.get("privacy_settings"), + "root_apps": obj.get("root_apps"), + "rule_action": EventRuleAction.from_dict(obj["rule_action"]) if obj.get("rule_action") is not None else None, + "suspect_score": obj.get("suspect_score"), + "tampering": obj.get("tampering"), + "tampering_details": TamperingDetails.from_dict(obj["tampering_details"]) if obj.get("tampering_details") is not None else None, + "velocity": Velocity.from_dict(obj["velocity"]) if obj.get("velocity") is not None else None, + "virtual_machine": obj.get("virtual_machine"), + "vpn": obj.get("vpn"), + "vpn_confidence": obj.get("vpn_confidence"), + "vpn_origin_timezone": obj.get("vpn_origin_timezone"), + "vpn_origin_country": obj.get("vpn_origin_country"), + "vpn_methods": VpnMethods.from_dict(obj["vpn_methods"]) if obj.get("vpn_methods") is not None else None, + "high_activity_device": obj.get("high_activity_device"), + "raw_device_attributes": RawDeviceAttributes.from_dict(obj["raw_device_attributes"]) if obj.get("raw_device_attributes") is not None else None + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/event_rule_action.py b/fingerprint_server_sdk/models/event_rule_action.py new file mode 100644 index 00000000..aa801248 --- /dev/null +++ b/fingerprint_server_sdk/models/event_rule_action.py @@ -0,0 +1,156 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +import pprint +from pydantic import BaseModel, ConfigDict, Field, StrictStr, ValidationError, field_validator +from typing import Any, List, Optional +from fingerprint_server_sdk.models.event_rule_action_allow import EventRuleActionAllow +from fingerprint_server_sdk.models.event_rule_action_block import EventRuleActionBlock +from pydantic import StrictStr, Field +from typing import Union, List, Set, Optional, Dict +from typing_extensions import Literal, Self + +EVENTRULEACTION_ONE_OF_SCHEMAS = ["EventRuleActionAllow", "EventRuleActionBlock"] + +class EventRuleAction(BaseModel): + """ + Describes the action the client should take, according to the rule in the ruleset that matched the event. When getting an event by event ID, the rule_action will only be included when the ruleset_id query parameter is specified. + """ + # data type: EventRuleActionAllow + oneof_schema_1_validator: Optional[EventRuleActionAllow] = None + # data type: EventRuleActionBlock + oneof_schema_2_validator: Optional[EventRuleActionBlock] = None + actual_instance: Optional[Union[EventRuleActionAllow, EventRuleActionBlock]] = None + one_of_schemas: Set[str] = { "EventRuleActionAllow", "EventRuleActionBlock" } + + model_config = ConfigDict( + validate_assignment=True, + protected_namespaces=(), + ) + + + discriminator_value_class_map: Dict[str, str] = { + } + + def __init__(self, *args, **kwargs) -> None: + if args: + if len(args) > 1: + raise ValueError("If a position argument is used, only 1 is allowed to set `actual_instance`") + if kwargs: + raise ValueError("If a position argument is used, keyword arguments cannot be used.") + super().__init__(actual_instance=args[0]) + else: + super().__init__(**kwargs) + + @field_validator('actual_instance') + def actual_instance_must_validate_oneof(cls, v): + instance = EventRuleAction.model_construct() + error_messages = [] + match = 0 + # validate data type: EventRuleActionAllow + if not isinstance(v, EventRuleActionAllow): + error_messages.append(f"Error! Input type `{type(v)}` is not `EventRuleActionAllow`") + else: + match += 1 + # validate data type: EventRuleActionBlock + if not isinstance(v, EventRuleActionBlock): + error_messages.append(f"Error! Input type `{type(v)}` is not `EventRuleActionBlock`") + else: + match += 1 + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when setting `actual_instance` in EventRuleAction with oneOf schemas: EventRuleActionAllow, EventRuleActionBlock. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when setting `actual_instance` in EventRuleAction with oneOf schemas: EventRuleActionAllow, EventRuleActionBlock. Details: " + ", ".join(error_messages)) + else: + return v + + @classmethod + def from_dict(cls, obj: Union[str, Dict[str, Any]]) -> Self: + return cls.from_json(json.dumps(obj)) + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Returns the object represented by the json string""" + instance = cls.model_construct() + error_messages = [] + match = 0 + + # use oneOf discriminator to lookup the data type + _data_type = json.loads(json_str).get("type") + if not _data_type: + raise ValueError("Failed to lookup data type from the field `type` in the input.") + + # check if data type is `EventRuleActionAllow` + if _data_type == "allow": + instance.actual_instance = EventRuleActionAllow.from_json(json_str) + return instance + + # check if data type is `EventRuleActionBlock` + if _data_type == "block": + instance.actual_instance = EventRuleActionBlock.from_json(json_str) + return instance + + # deserialize data into EventRuleActionAllow + try: + instance.actual_instance = EventRuleActionAllow.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + # deserialize data into EventRuleActionBlock + try: + instance.actual_instance = EventRuleActionBlock.from_json(json_str) + match += 1 + except (ValidationError, ValueError) as e: + error_messages.append(str(e)) + + if match > 1: + # more than 1 match + raise ValueError("Multiple matches found when deserializing the JSON string into EventRuleAction with oneOf schemas: EventRuleActionAllow, EventRuleActionBlock. Details: " + ", ".join(error_messages)) + elif match == 0: + # no match + raise ValueError("No match found when deserializing the JSON string into EventRuleAction with oneOf schemas: EventRuleActionAllow, EventRuleActionBlock. Details: " + ", ".join(error_messages)) + else: + return instance + + def to_json(self) -> str: + """Returns the JSON representation of the actual instance""" + if self.actual_instance is None: + return "null" + + if hasattr(self.actual_instance, "to_json") and callable(self.actual_instance.to_json): + return self.actual_instance.to_json() + else: + return json.dumps(self.actual_instance) + + def to_dict(self) -> Optional[Union[Dict[str, Any], EventRuleActionAllow, EventRuleActionBlock]]: + """Returns the dict representation of the actual instance""" + if self.actual_instance is None: + return None + + if hasattr(self.actual_instance, "to_dict") and callable(self.actual_instance.to_dict): + return self.actual_instance.to_dict() + else: + # primitive type + return self.actual_instance + + def to_str(self) -> str: + """Returns the string representation of the actual instance""" + return pprint.pformat(self.model_dump()) + + diff --git a/fingerprint_server_sdk/models/event_rule_action_allow.py b/fingerprint_server_sdk/models/event_rule_action_allow.py new file mode 100644 index 00000000..786c65fc --- /dev/null +++ b/fingerprint_server_sdk/models/event_rule_action_allow.py @@ -0,0 +1,101 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from fingerprint_server_sdk.models.request_header_modifications import RequestHeaderModifications +from fingerprint_server_sdk.models.rule_action_type import RuleActionType +from typing import Optional, Set +from typing_extensions import Self + +class EventRuleActionAllow(BaseModel): + """ + Informs the client that the request should be forwarded to the origin with optional request header modifications. + """ # noqa: E501 + ruleset_id: StrictStr = Field(description="The ID of the evaluated ruleset.") + rule_id: Optional[StrictStr] = Field(default=None, description="The ID of the rule that matched the identification event.") + rule_expression: Optional[StrictStr] = Field(default=None, description="The expression of the rule that matched the identification event.") + type: RuleActionType + request_header_modifications: Optional[RequestHeaderModifications] = None + __properties: ClassVar[List[str]] = ["ruleset_id", "rule_id", "rule_expression", "type", "request_header_modifications"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EventRuleActionAllow from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of request_header_modifications + if self.request_header_modifications: + _dict['request_header_modifications'] = self.request_header_modifications.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventRuleActionAllow from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ruleset_id": obj.get("ruleset_id"), + "rule_id": obj.get("rule_id"), + "rule_expression": obj.get("rule_expression"), + "type": obj.get("type"), + "request_header_modifications": RequestHeaderModifications.from_dict(obj["request_header_modifications"]) if obj.get("request_header_modifications") is not None else None + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/event_rule_action_block.py b/fingerprint_server_sdk/models/event_rule_action_block.py new file mode 100644 index 00000000..37a68b0f --- /dev/null +++ b/fingerprint_server_sdk/models/event_rule_action_block.py @@ -0,0 +1,109 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from fingerprint_server_sdk.models.rule_action_header_field import RuleActionHeaderField +from fingerprint_server_sdk.models.rule_action_type import RuleActionType +from typing import Optional, Set +from typing_extensions import Self + +class EventRuleActionBlock(BaseModel): + """ + Informs the client the request should be blocked using the response described by this rule action. + """ # noqa: E501 + ruleset_id: StrictStr = Field(description="The ID of the evaluated ruleset.") + rule_id: Optional[StrictStr] = Field(default=None, description="The ID of the rule that matched the identification event.") + rule_expression: Optional[StrictStr] = Field(default=None, description="The expression of the rule that matched the identification event.") + type: RuleActionType + status_code: Optional[StrictInt] = Field(default=None, description="A valid HTTP status code.") + headers: Optional[List[RuleActionHeaderField]] = Field(default=None, description="A list of headers to send.") + body: Optional[StrictStr] = Field(default=None, description="The response body to send to the client.") + __properties: ClassVar[List[str]] = ["ruleset_id", "rule_id", "rule_expression", "type", "status_code", "headers", "body"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EventRuleActionBlock from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in headers (list) + _items = [] + if self.headers: + for _item_headers in self.headers: + if _item_headers: + _items.append(_item_headers.to_dict()) + _dict['headers'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventRuleActionBlock from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "ruleset_id": obj.get("ruleset_id"), + "rule_id": obj.get("rule_id"), + "rule_expression": obj.get("rule_expression"), + "type": obj.get("type"), + "status_code": obj.get("status_code"), + "headers": [RuleActionHeaderField.from_dict(_item) for _item in obj["headers"]] if obj.get("headers") is not None else None, + "body": obj.get("body") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/event_search.py b/fingerprint_server_sdk/models/event_search.py new file mode 100644 index 00000000..eb581f76 --- /dev/null +++ b/fingerprint_server_sdk/models/event_search.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from fingerprint_server_sdk.models.event import Event +from typing import Optional, Set +from typing_extensions import Self + +class EventSearch(BaseModel): + """ + Contains a list of all identification events matching the specified search criteria. + """ # noqa: E501 + events: List[Event] + pagination_key: Optional[StrictStr] = Field(default=None, description="Use this value in the `pagination_key` parameter to request the next page of search results.") + total_hits: Optional[StrictInt] = Field(default=None, description="This value represents the total number of events matching the search query, up to the limit provided in the `total_hits` query parameter. Only present if the `total_hits` query parameter was provided.") + __properties: ClassVar[List[str]] = ["events", "pagination_key", "total_hits"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EventSearch from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in events (list) + _items = [] + if self.events: + for _item_events in self.events: + if _item_events: + _items.append(_item_events.to_dict()) + _dict['events'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventSearch from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "events": [Event.from_dict(_item) for _item in obj["events"]] if obj.get("events") is not None else None, + "pagination_key": obj.get("pagination_key"), + "total_hits": obj.get("total_hits") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/event_update.py b/fingerprint_server_sdk/models/event_update.py new file mode 100644 index 00000000..114c91c6 --- /dev/null +++ b/fingerprint_server_sdk/models/event_update.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class EventUpdate(BaseModel): + """ + EventUpdate + """ # noqa: E501 + linked_id: Optional[StrictStr] = Field(default=None, description="Linked Id value to assign to the existing event") + tags: Optional[Dict[str, Any]] = Field(default=None, description="A customer-provided value or an object that was sent with the identification request or updated later.") + suspect: Optional[StrictBool] = Field(default=None, description="Suspect flag indicating observed suspicious or fraudulent event") + __properties: ClassVar[List[str]] = ["linked_id", "tags", "suspect"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of EventUpdate from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of EventUpdate from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "linked_id": obj.get("linked_id"), + "tags": obj.get("tags"), + "suspect": obj.get("suspect") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/events_get_response.py b/fingerprint_server_sdk/models/events_get_response.py deleted file mode 100644 index 32921f18..00000000 --- a/fingerprint_server_sdk/models/events_get_response.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.products import Products - - -class EventsGetResponse(BaseModel): - """ - Contains results from all activated products - Fingerprint Pro, Bot Detection, and others. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'products': 'Products' - } - - nullable_map = { - 'products': False - } - - attribute_map = { - 'products': 'products' - } - - def __init__(self, products=None): # noqa: E501 - """EventsGetResponse - a model defined in Swagger""" # noqa: E501 - self._products = None - self.discriminator = None - self.products = products - - @property - def products(self) -> Products: - """Gets the products of this EventsGetResponse. # noqa: E501 - - - :return: The products of this EventsGetResponse. # noqa: E501 - """ - return self._products - - @products.setter - def products(self, products: Products): - """Sets the products of this EventsGetResponse. - - - :param products: The products of this EventsGetResponse. # noqa: E501 - """ - if products is None: - raise ValueError("Invalid value for `products`, must not be `None`") # noqa: E501 - - self._products = products - diff --git a/fingerprint_server_sdk/models/events_update_request.py b/fingerprint_server_sdk/models/events_update_request.py deleted file mode 100644 index 763c1909..00000000 --- a/fingerprint_server_sdk/models/events_update_request.py +++ /dev/null @@ -1,122 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.tag import Tag - - -class EventsUpdateRequest(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'linked_id': 'str', - 'tag': 'Tag', - 'suspect': 'bool' - } - - nullable_map = { - 'linked_id': False, - 'tag': False, - 'suspect': False - } - - attribute_map = { - 'linked_id': 'linkedId', - 'tag': 'tag', - 'suspect': 'suspect' - } - - def __init__(self, linked_id=None, tag=None, suspect=None): # noqa: E501 - """EventsUpdateRequest - a model defined in Swagger""" # noqa: E501 - self._linked_id = None - self._tag = None - self._suspect = None - self.discriminator = None - if linked_id is not None: - self.linked_id = linked_id - if tag is not None: - self.tag = tag - if suspect is not None: - self.suspect = suspect - - @property - def linked_id(self) -> Optional[str]: - """Gets the linked_id of this EventsUpdateRequest. # noqa: E501 - - LinkedID value to assign to the existing event # noqa: E501 - - :return: The linked_id of this EventsUpdateRequest. # noqa: E501 - """ - return self._linked_id - - @linked_id.setter - def linked_id(self, linked_id: Optional[str]): - """Sets the linked_id of this EventsUpdateRequest. - - LinkedID value to assign to the existing event # noqa: E501 - - :param linked_id: The linked_id of this EventsUpdateRequest. # noqa: E501 - """ - - self._linked_id = linked_id - - @property - def tag(self) -> Optional[Tag]: - """Gets the tag of this EventsUpdateRequest. # noqa: E501 - - - :return: The tag of this EventsUpdateRequest. # noqa: E501 - """ - return self._tag - - @tag.setter - def tag(self, tag: Optional[Tag]): - """Sets the tag of this EventsUpdateRequest. - - - :param tag: The tag of this EventsUpdateRequest. # noqa: E501 - """ - - self._tag = tag - - @property - def suspect(self) -> Optional[bool]: - """Gets the suspect of this EventsUpdateRequest. # noqa: E501 - - Suspect flag indicating observed suspicious or fraudulent event # noqa: E501 - - :return: The suspect of this EventsUpdateRequest. # noqa: E501 - """ - return self._suspect - - @suspect.setter - def suspect(self, suspect: Optional[bool]): - """Sets the suspect of this EventsUpdateRequest. - - Suspect flag indicating observed suspicious or fraudulent event # noqa: E501 - - :param suspect: The suspect of this EventsUpdateRequest. # noqa: E501 - """ - - self._suspect = suspect - diff --git a/fingerprint_server_sdk/models/factory_reset.py b/fingerprint_server_sdk/models/factory_reset.py deleted file mode 100644 index 2a40100a..00000000 --- a/fingerprint_server_sdk/models/factory_reset.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from datetime import datetime - - -class FactoryReset(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'time': 'datetime', - 'timestamp': 'int' - } - - nullable_map = { - 'time': False, - 'timestamp': False - } - - attribute_map = { - 'time': 'time', - 'timestamp': 'timestamp' - } - - def __init__(self, time=None, timestamp=None): # noqa: E501 - """FactoryReset - a model defined in Swagger""" # noqa: E501 - self._time = None - self._timestamp = None - self.discriminator = None - self.time = time - self.timestamp = timestamp - - @property - def time(self) -> datetime: - """Gets the time of this FactoryReset. # noqa: E501 - - Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. # noqa: E501 - - :return: The time of this FactoryReset. # noqa: E501 - """ - return self._time - - @time.setter - def time(self, time: datetime): - """Sets the time of this FactoryReset. - - Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. # noqa: E501 - - :param time: The time of this FactoryReset. # noqa: E501 - """ - if time is None: - raise ValueError("Invalid value for `time`, must not be `None`") # noqa: E501 - - self._time = time - - @property - def timestamp(self) -> int: - """Gets the timestamp of this FactoryReset. # noqa: E501 - - This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. # noqa: E501 - - :return: The timestamp of this FactoryReset. # noqa: E501 - """ - return self._timestamp - - @timestamp.setter - def timestamp(self, timestamp: int): - """Sets the timestamp of this FactoryReset. - - This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. # noqa: E501 - - :param timestamp: The timestamp of this FactoryReset. # noqa: E501 - """ - if timestamp is None: - raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 - - self._timestamp = timestamp - diff --git a/fingerprint_server_sdk/models/font_preferences.py b/fingerprint_server_sdk/models/font_preferences.py new file mode 100644 index 00000000..1e62a556 --- /dev/null +++ b/fingerprint_server_sdk/models/font_preferences.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing import Optional, Set +from typing_extensions import Self + +class FontPreferences(BaseModel): + """ + Baseline measurement of canonical fonts rendered on the device. Numeric width metrics, in CSS pixels, for the canonical fonts collected by the agent. + """ # noqa: E501 + default: Optional[Union[StrictFloat, StrictInt]] = None + serif: Optional[Union[StrictFloat, StrictInt]] = None + sans: Optional[Union[StrictFloat, StrictInt]] = None + mono: Optional[Union[StrictFloat, StrictInt]] = None + apple: Optional[Union[StrictFloat, StrictInt]] = None + min: Optional[Union[StrictFloat, StrictInt]] = None + system: Optional[Union[StrictFloat, StrictInt]] = None + __properties: ClassVar[List[str]] = ["default", "serif", "sans", "mono", "apple", "min", "system"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of FontPreferences from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of FontPreferences from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "default": obj.get("default"), + "serif": obj.get("serif"), + "sans": obj.get("sans"), + "mono": obj.get("mono"), + "apple": obj.get("apple"), + "min": obj.get("min"), + "system": obj.get("system") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/frida.py b/fingerprint_server_sdk/models/frida.py deleted file mode 100644 index f98ff9a1..00000000 --- a/fingerprint_server_sdk/models/frida.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class Frida(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """Frida - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - self.result = result - - @property - def result(self) -> bool: - """Gets the result of this Frida. # noqa: E501 - - [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. # noqa: E501 - - :return: The result of this Frida. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this Frida. - - [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. # noqa: E501 - - :param result: The result of this Frida. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - diff --git a/fingerprint_server_sdk/models/geolocation.py b/fingerprint_server_sdk/models/geolocation.py index 958394f0..0569a942 100644 --- a/fingerprint_server_sdk/models/geolocation.py +++ b/fingerprint_server_sdk/models/geolocation.py @@ -1,273 +1,117 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.geolocation_city import GeolocationCity -from fingerprint_server_sdk.models.geolocation_country import GeolocationCountry -from fingerprint_server_sdk.models.geolocation_continent import GeolocationContinent -from fingerprint_server_sdk.models.geolocation_subdivisions import GeolocationSubdivisions - - -class Geolocation(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'accuracy_radius': 'int', - 'latitude': 'float', - 'longitude': 'float', - 'postal_code': 'str', - 'timezone': 'str', - 'city': 'GeolocationCity', - 'country': 'GeolocationCountry', - 'continent': 'GeolocationContinent', - 'subdivisions': 'GeolocationSubdivisions' - } - - nullable_map = { - 'accuracy_radius': False, - 'latitude': False, - 'longitude': False, - 'postal_code': False, - 'timezone': False, - 'city': False, - 'country': False, - 'continent': False, - 'subdivisions': False - } - - attribute_map = { - 'accuracy_radius': 'accuracyRadius', - 'latitude': 'latitude', - 'longitude': 'longitude', - 'postal_code': 'postalCode', - 'timezone': 'timezone', - 'city': 'city', - 'country': 'country', - 'continent': 'continent', - 'subdivisions': 'subdivisions' - } - - def __init__(self, accuracy_radius=None, latitude=None, longitude=None, postal_code=None, timezone=None, city=None, country=None, continent=None, subdivisions=None): # noqa: E501 - """Geolocation - a model defined in Swagger""" # noqa: E501 - self._accuracy_radius = None - self._latitude = None - self._longitude = None - self._postal_code = None - self._timezone = None - self._city = None - self._country = None - self._continent = None - self._subdivisions = None - self.discriminator = None - if accuracy_radius is not None: - self.accuracy_radius = accuracy_radius - if latitude is not None: - self.latitude = latitude - if longitude is not None: - self.longitude = longitude - if postal_code is not None: - self.postal_code = postal_code - if timezone is not None: - self.timezone = timezone - if city is not None: - self.city = city - if country is not None: - self.country = country - if continent is not None: - self.continent = continent - if subdivisions is not None: - self.subdivisions = subdivisions - - @property - def accuracy_radius(self) -> Optional[int]: - """Gets the accuracy_radius of this Geolocation. # noqa: E501 - - The IP address is likely to be within this radius (in km) of the specified location. # noqa: E501 - - :return: The accuracy_radius of this Geolocation. # noqa: E501 - """ - return self._accuracy_radius - - @accuracy_radius.setter - def accuracy_radius(self, accuracy_radius: Optional[int]): - """Sets the accuracy_radius of this Geolocation. - - The IP address is likely to be within this radius (in km) of the specified location. # noqa: E501 - - :param accuracy_radius: The accuracy_radius of this Geolocation. # noqa: E501 - """ - - self._accuracy_radius = accuracy_radius - - @property - def latitude(self) -> Optional[float]: - """Gets the latitude of this Geolocation. # noqa: E501 - +""" # noqa: E501 - :return: The latitude of this Geolocation. # noqa: E501 - """ - return self._latitude - - @latitude.setter - def latitude(self, latitude: Optional[float]): - """Sets the latitude of this Geolocation. - - - :param latitude: The latitude of this Geolocation. # noqa: E501 - """ - - self._latitude = latitude - - @property - def longitude(self) -> Optional[float]: - """Gets the longitude of this Geolocation. # noqa: E501 - - - :return: The longitude of this Geolocation. # noqa: E501 - """ - return self._longitude - - @longitude.setter - def longitude(self, longitude: Optional[float]): - """Sets the longitude of this Geolocation. - - - :param longitude: The longitude of this Geolocation. # noqa: E501 - """ - - self._longitude = longitude - - @property - def postal_code(self) -> Optional[str]: - """Gets the postal_code of this Geolocation. # noqa: E501 - - - :return: The postal_code of this Geolocation. # noqa: E501 - """ - return self._postal_code - - @postal_code.setter - def postal_code(self, postal_code: Optional[str]): - """Sets the postal_code of this Geolocation. - - - :param postal_code: The postal_code of this Geolocation. # noqa: E501 - """ - self._postal_code = postal_code - - @property - def timezone(self) -> Optional[str]: - """Gets the timezone of this Geolocation. # noqa: E501 - - - :return: The timezone of this Geolocation. # noqa: E501 - """ - return self._timezone - - @timezone.setter - def timezone(self, timezone: Optional[str]): - """Sets the timezone of this Geolocation. - - - :param timezone: The timezone of this Geolocation. # noqa: E501 - """ - - self._timezone = timezone - - @property - def city(self) -> Optional[GeolocationCity]: - """Gets the city of this Geolocation. # noqa: E501 - - - :return: The city of this Geolocation. # noqa: E501 - """ - return self._city - - @city.setter - def city(self, city: Optional[GeolocationCity]): - """Sets the city of this Geolocation. - - - :param city: The city of this Geolocation. # noqa: E501 - """ - - self._city = city - - @property - def country(self) -> Optional[GeolocationCountry]: - """Gets the country of this Geolocation. # noqa: E501 - - - :return: The country of this Geolocation. # noqa: E501 - """ - return self._country - - @country.setter - def country(self, country: Optional[GeolocationCountry]): - """Sets the country of this Geolocation. - - - :param country: The country of this Geolocation. # noqa: E501 - """ - - self._country = country - - @property - def continent(self) -> Optional[GeolocationContinent]: - """Gets the continent of this Geolocation. # noqa: E501 - - - :return: The continent of this Geolocation. # noqa: E501 - """ - return self._continent - - @continent.setter - def continent(self, continent: Optional[GeolocationContinent]): - """Sets the continent of this Geolocation. - - - :param continent: The continent of this Geolocation. # noqa: E501 - """ - - self._continent = continent - - @property - def subdivisions(self) -> Optional[GeolocationSubdivisions]: - """Gets the subdivisions of this Geolocation. # noqa: E501 - - - :return: The subdivisions of this Geolocation. # noqa: E501 - """ - return self._subdivisions - - @subdivisions.setter - def subdivisions(self, subdivisions: Optional[GeolocationSubdivisions]): - """Sets the subdivisions of this Geolocation. +from __future__ import annotations +import pprint +import re # noqa: F401 +import json +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from fingerprint_server_sdk.models.geolocation_subdivisions_inner import GeolocationSubdivisionsInner +from typing import Optional, Set +from typing_extensions import Self - :param subdivisions: The subdivisions of this Geolocation. # noqa: E501 - """ +class Geolocation(BaseModel): + """ + Geolocation + """ # noqa: E501 + accuracy_radius: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="The IP address is likely to be within this radius (in km) of the specified location.") + latitude: Optional[Union[Annotated[float, Field(le=90, strict=True, ge=-90)], Annotated[int, Field(le=90, strict=True, ge=-90)]]] = None + longitude: Optional[Union[Annotated[float, Field(le=180, strict=True, ge=-180)], Annotated[int, Field(le=180, strict=True, ge=-180)]]] = None + postal_code: Optional[StrictStr] = None + timezone: Optional[StrictStr] = None + city_name: Optional[StrictStr] = None + country_code: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=2)]] = None + country_name: Optional[StrictStr] = None + continent_code: Optional[Annotated[str, Field(min_length=2, strict=True, max_length=2)]] = None + continent_name: Optional[StrictStr] = None + subdivisions: Optional[List[GeolocationSubdivisionsInner]] = None + __properties: ClassVar[List[str]] = ["accuracy_radius", "latitude", "longitude", "postal_code", "timezone", "city_name", "country_code", "country_name", "continent_code", "continent_name", "subdivisions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Geolocation from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in subdivisions (list) + _items = [] + if self.subdivisions: + for _item_subdivisions in self.subdivisions: + if _item_subdivisions: + _items.append(_item_subdivisions.to_dict()) + _dict['subdivisions'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Geolocation from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "accuracy_radius": obj.get("accuracy_radius"), + "latitude": obj.get("latitude"), + "longitude": obj.get("longitude"), + "postal_code": obj.get("postal_code"), + "timezone": obj.get("timezone"), + "city_name": obj.get("city_name"), + "country_code": obj.get("country_code"), + "country_name": obj.get("country_name"), + "continent_code": obj.get("continent_code"), + "continent_name": obj.get("continent_name"), + "subdivisions": [GeolocationSubdivisionsInner.from_dict(_item) for _item in obj["subdivisions"]] if obj.get("subdivisions") is not None else None + }) + return _obj - self._subdivisions = subdivisions diff --git a/fingerprint_server_sdk/models/geolocation_city.py b/fingerprint_server_sdk/models/geolocation_city.py deleted file mode 100644 index 9099f5d9..00000000 --- a/fingerprint_server_sdk/models/geolocation_city.py +++ /dev/null @@ -1,68 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class GeolocationCity(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'name': 'str' - } - - nullable_map = { - 'name': False - } - - attribute_map = { - 'name': 'name' - } - - def __init__(self, name=None): # noqa: E501 - """GeolocationCity - a model defined in Swagger""" # noqa: E501 - self._name = None - self.discriminator = None - self.name = name - - @property - def name(self) -> str: - """Gets the name of this GeolocationCity. # noqa: E501 - - - :return: The name of this GeolocationCity. # noqa: E501 - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this GeolocationCity. - - - :param name: The name of this GeolocationCity. # noqa: E501 - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - diff --git a/fingerprint_server_sdk/models/geolocation_continent.py b/fingerprint_server_sdk/models/geolocation_continent.py deleted file mode 100644 index c72f37a4..00000000 --- a/fingerprint_server_sdk/models/geolocation_continent.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class GeolocationContinent(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'code': 'str', - 'name': 'str' - } - - nullable_map = { - 'code': False, - 'name': False - } - - attribute_map = { - 'code': 'code', - 'name': 'name' - } - - def __init__(self, code=None, name=None): # noqa: E501 - """GeolocationContinent - a model defined in Swagger""" # noqa: E501 - self._code = None - self._name = None - self.discriminator = None - self.code = code - self.name = name - - @property - def code(self) -> str: - """Gets the code of this GeolocationContinent. # noqa: E501 - - - :return: The code of this GeolocationContinent. # noqa: E501 - """ - return self._code - - @code.setter - def code(self, code: str): - """Sets the code of this GeolocationContinent. - - - :param code: The code of this GeolocationContinent. # noqa: E501 - """ - if code is None: - raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 - - self._code = code - - @property - def name(self) -> str: - """Gets the name of this GeolocationContinent. # noqa: E501 - - - :return: The name of this GeolocationContinent. # noqa: E501 - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this GeolocationContinent. - - - :param name: The name of this GeolocationContinent. # noqa: E501 - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - diff --git a/fingerprint_server_sdk/models/geolocation_country.py b/fingerprint_server_sdk/models/geolocation_country.py deleted file mode 100644 index e15ba00d..00000000 --- a/fingerprint_server_sdk/models/geolocation_country.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class GeolocationCountry(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'code': 'str', - 'name': 'str' - } - - nullable_map = { - 'code': False, - 'name': False - } - - attribute_map = { - 'code': 'code', - 'name': 'name' - } - - def __init__(self, code=None, name=None): # noqa: E501 - """GeolocationCountry - a model defined in Swagger""" # noqa: E501 - self._code = None - self._name = None - self.discriminator = None - self.code = code - self.name = name - - @property - def code(self) -> str: - """Gets the code of this GeolocationCountry. # noqa: E501 - - - :return: The code of this GeolocationCountry. # noqa: E501 - """ - return self._code - - @code.setter - def code(self, code: str): - """Sets the code of this GeolocationCountry. - - - :param code: The code of this GeolocationCountry. # noqa: E501 - """ - if code is None: - raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 - - self._code = code - - @property - def name(self) -> str: - """Gets the name of this GeolocationCountry. # noqa: E501 - - - :return: The name of this GeolocationCountry. # noqa: E501 - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this GeolocationCountry. - - - :param name: The name of this GeolocationCountry. # noqa: E501 - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - diff --git a/fingerprint_server_sdk/models/geolocation_subdivision.py b/fingerprint_server_sdk/models/geolocation_subdivision.py deleted file mode 100644 index b254063b..00000000 --- a/fingerprint_server_sdk/models/geolocation_subdivision.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class GeolocationSubdivision(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'iso_code': 'str', - 'name': 'str' - } - - nullable_map = { - 'iso_code': False, - 'name': False - } - - attribute_map = { - 'iso_code': 'isoCode', - 'name': 'name' - } - - def __init__(self, iso_code=None, name=None): # noqa: E501 - """GeolocationSubdivision - a model defined in Swagger""" # noqa: E501 - self._iso_code = None - self._name = None - self.discriminator = None - self.iso_code = iso_code - self.name = name - - @property - def iso_code(self) -> str: - """Gets the iso_code of this GeolocationSubdivision. # noqa: E501 - - - :return: The iso_code of this GeolocationSubdivision. # noqa: E501 - """ - return self._iso_code - - @iso_code.setter - def iso_code(self, iso_code: str): - """Sets the iso_code of this GeolocationSubdivision. - - - :param iso_code: The iso_code of this GeolocationSubdivision. # noqa: E501 - """ - if iso_code is None: - raise ValueError("Invalid value for `iso_code`, must not be `None`") # noqa: E501 - - self._iso_code = iso_code - - @property - def name(self) -> str: - """Gets the name of this GeolocationSubdivision. # noqa: E501 - - - :return: The name of this GeolocationSubdivision. # noqa: E501 - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this GeolocationSubdivision. - - - :param name: The name of this GeolocationSubdivision. # noqa: E501 - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - diff --git a/fingerprint_server_sdk/models/geolocation_subdivisions.py b/fingerprint_server_sdk/models/geolocation_subdivisions.py deleted file mode 100644 index 63b0afae..00000000 --- a/fingerprint_server_sdk/models/geolocation_subdivisions.py +++ /dev/null @@ -1,42 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class GeolocationSubdivisions(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - nullable_map = { - } - - attribute_map = { - } - - def __init__(self): # noqa: E501 - """GeolocationSubdivisions - a model defined in Swagger""" # noqa: E501 - self.discriminator = None - diff --git a/fingerprint_server_sdk/models/geolocation_subdivisions_inner.py b/fingerprint_server_sdk/models/geolocation_subdivisions_inner.py new file mode 100644 index 00000000..073d855c --- /dev/null +++ b/fingerprint_server_sdk/models/geolocation_subdivisions_inner.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class GeolocationSubdivisionsInner(BaseModel): + """ + GeolocationSubdivisionsInner + """ # noqa: E501 + iso_code: StrictStr + name: StrictStr + __properties: ClassVar[List[str]] = ["iso_code", "name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of GeolocationSubdivisionsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of GeolocationSubdivisionsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "iso_code": obj.get("iso_code"), + "name": obj.get("name") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/high_activity.py b/fingerprint_server_sdk/models/high_activity.py deleted file mode 100644 index d83843f1..00000000 --- a/fingerprint_server_sdk/models/high_activity.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class HighActivity(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool', - 'daily_requests': 'int' - } - - nullable_map = { - 'result': False, - 'daily_requests': False - } - - attribute_map = { - 'result': 'result', - 'daily_requests': 'dailyRequests' - } - - def __init__(self, result=None, daily_requests=None): # noqa: E501 - """HighActivity - a model defined in Swagger""" # noqa: E501 - self._result = None - self._daily_requests = None - self.discriminator = None - self.result = result - if daily_requests is not None: - self.daily_requests = daily_requests - - @property - def result(self) -> bool: - """Gets the result of this HighActivity. # noqa: E501 - - Flag indicating if the request came from a high-activity visitor. # noqa: E501 - - :return: The result of this HighActivity. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this HighActivity. - - Flag indicating if the request came from a high-activity visitor. # noqa: E501 - - :param result: The result of this HighActivity. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - - @property - def daily_requests(self) -> Optional[int]: - """Gets the daily_requests of this HighActivity. # noqa: E501 - - Number of requests from the same visitor in the previous day. # noqa: E501 - - :return: The daily_requests of this HighActivity. # noqa: E501 - """ - return self._daily_requests - - @daily_requests.setter - def daily_requests(self, daily_requests: Optional[int]): - """Sets the daily_requests of this HighActivity. - - Number of requests from the same visitor in the previous day. # noqa: E501 - - :param daily_requests: The daily_requests of this HighActivity. # noqa: E501 - """ - - self._daily_requests = daily_requests - diff --git a/fingerprint_server_sdk/models/identification.py b/fingerprint_server_sdk/models/identification.py index 00301414..3bfc3e0b 100644 --- a/fingerprint_server_sdk/models/identification.py +++ b/fingerprint_server_sdk/models/identification.py @@ -1,588 +1,100 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.browser_details import BrowserDetails -from fingerprint_server_sdk.models.deprecated_geolocation import DeprecatedGeolocation -from datetime import datetime -from fingerprint_server_sdk.models.tag import Tag -from fingerprint_server_sdk.models.identification_confidence import IdentificationConfidence -from fingerprint_server_sdk.models.identification_seen_at import IdentificationSeenAt -from fingerprint_server_sdk.models.identification_seen_at import IdentificationSeenAt -from fingerprint_server_sdk.models.raw_device_attributes import RawDeviceAttributes -from fingerprint_server_sdk.models.sdk import SDK - - -class Identification(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'visitor_id': 'str', - 'request_id': 'str', - 'browser_details': 'BrowserDetails', - 'incognito': 'bool', - 'ip': 'str', - 'ip_location': 'DeprecatedGeolocation', - 'linked_id': 'str', - 'suspect': 'bool', - 'timestamp': 'int', - 'time': 'datetime', - 'url': 'str', - 'tag': 'Tag', - 'confidence': 'IdentificationConfidence', - 'visitor_found': 'bool', - 'first_seen_at': 'IdentificationSeenAt', - 'last_seen_at': 'IdentificationSeenAt', - 'components': 'RawDeviceAttributes', - 'replayed': 'bool', - 'sdk': 'SDK', - 'environment_id': 'str' - } - - nullable_map = { - 'visitor_id': False, - 'request_id': False, - 'browser_details': False, - 'incognito': False, - 'ip': False, - 'ip_location': False, - 'linked_id': False, - 'suspect': False, - 'timestamp': False, - 'time': False, - 'url': False, - 'tag': False, - 'confidence': False, - 'visitor_found': False, - 'first_seen_at': False, - 'last_seen_at': False, - 'components': False, - 'replayed': False, - 'sdk': False, - 'environment_id': False - } - - attribute_map = { - 'visitor_id': 'visitorId', - 'request_id': 'requestId', - 'browser_details': 'browserDetails', - 'incognito': 'incognito', - 'ip': 'ip', - 'ip_location': 'ipLocation', - 'linked_id': 'linkedId', - 'suspect': 'suspect', - 'timestamp': 'timestamp', - 'time': 'time', - 'url': 'url', - 'tag': 'tag', - 'confidence': 'confidence', - 'visitor_found': 'visitorFound', - 'first_seen_at': 'firstSeenAt', - 'last_seen_at': 'lastSeenAt', - 'components': 'components', - 'replayed': 'replayed', - 'sdk': 'sdk', - 'environment_id': 'environmentId' - } - - def __init__(self, visitor_id=None, request_id=None, browser_details=None, incognito=None, ip=None, ip_location=None, linked_id=None, suspect=None, timestamp=None, time=None, url=None, tag=None, confidence=None, visitor_found=None, first_seen_at=None, last_seen_at=None, components=None, replayed=None, sdk=None, environment_id=None): # noqa: E501 - """Identification - a model defined in Swagger""" # noqa: E501 - self._visitor_id = None - self._request_id = None - self._browser_details = None - self._incognito = None - self._ip = None - self._ip_location = None - self._linked_id = None - self._suspect = None - self._timestamp = None - self._time = None - self._url = None - self._tag = None - self._confidence = None - self._visitor_found = None - self._first_seen_at = None - self._last_seen_at = None - self._components = None - self._replayed = None - self._sdk = None - self._environment_id = None - self.discriminator = None - self.visitor_id = visitor_id - self.request_id = request_id - self.browser_details = browser_details - self.incognito = incognito - self.ip = ip - if ip_location is not None: - self.ip_location = ip_location - if linked_id is not None: - self.linked_id = linked_id - if suspect is not None: - self.suspect = suspect - self.timestamp = timestamp - self.time = time - self.url = url - self.tag = tag - if confidence is not None: - self.confidence = confidence - self.visitor_found = visitor_found - self.first_seen_at = first_seen_at - self.last_seen_at = last_seen_at - if components is not None: - self.components = components - self.replayed = replayed - if sdk is not None: - self.sdk = sdk - if environment_id is not None: - self.environment_id = environment_id - - @property - def visitor_id(self) -> str: - """Gets the visitor_id of this Identification. # noqa: E501 - - String of 20 characters that uniquely identifies the visitor's browser or mobile device. # noqa: E501 - - :return: The visitor_id of this Identification. # noqa: E501 - """ - return self._visitor_id - - @visitor_id.setter - def visitor_id(self, visitor_id: str): - """Sets the visitor_id of this Identification. - - String of 20 characters that uniquely identifies the visitor's browser or mobile device. # noqa: E501 - - :param visitor_id: The visitor_id of this Identification. # noqa: E501 - """ - if visitor_id is None: - raise ValueError("Invalid value for `visitor_id`, must not be `None`") # noqa: E501 - - self._visitor_id = visitor_id - - @property - def request_id(self) -> str: - """Gets the request_id of this Identification. # noqa: E501 - - Unique identifier of the user's request. # noqa: E501 - - :return: The request_id of this Identification. # noqa: E501 - """ - return self._request_id - - @request_id.setter - def request_id(self, request_id: str): - """Sets the request_id of this Identification. - - Unique identifier of the user's request. # noqa: E501 - - :param request_id: The request_id of this Identification. # noqa: E501 - """ - if request_id is None: - raise ValueError("Invalid value for `request_id`, must not be `None`") # noqa: E501 - - self._request_id = request_id - - @property - def browser_details(self) -> BrowserDetails: - """Gets the browser_details of this Identification. # noqa: E501 - - - :return: The browser_details of this Identification. # noqa: E501 - """ - return self._browser_details - - @browser_details.setter - def browser_details(self, browser_details: BrowserDetails): - """Sets the browser_details of this Identification. - - - :param browser_details: The browser_details of this Identification. # noqa: E501 - """ - if browser_details is None: - raise ValueError("Invalid value for `browser_details`, must not be `None`") # noqa: E501 - - self._browser_details = browser_details - - @property - def incognito(self) -> bool: - """Gets the incognito of this Identification. # noqa: E501 - - Flag if user used incognito session. # noqa: E501 - - :return: The incognito of this Identification. # noqa: E501 - """ - return self._incognito - - @incognito.setter - def incognito(self, incognito: bool): - """Sets the incognito of this Identification. - - Flag if user used incognito session. # noqa: E501 - - :param incognito: The incognito of this Identification. # noqa: E501 - """ - if incognito is None: - raise ValueError("Invalid value for `incognito`, must not be `None`") # noqa: E501 - - self._incognito = incognito - - @property - def ip(self) -> str: - """Gets the ip of this Identification. # noqa: E501 - - IP address of the requesting browser or bot. # noqa: E501 - - :return: The ip of this Identification. # noqa: E501 - """ - return self._ip - - @ip.setter - def ip(self, ip: str): - """Sets the ip of this Identification. - - IP address of the requesting browser or bot. # noqa: E501 - - :param ip: The ip of this Identification. # noqa: E501 - """ - if ip is None: - raise ValueError("Invalid value for `ip`, must not be `None`") # noqa: E501 - - self._ip = ip - - @property - def ip_location(self) -> Optional[DeprecatedGeolocation]: - """Gets the ip_location of this Identification. # noqa: E501 - - - :return: The ip_location of this Identification. # noqa: E501 - """ - return self._ip_location - - @ip_location.setter - def ip_location(self, ip_location: Optional[DeprecatedGeolocation]): - """Sets the ip_location of this Identification. - - - :param ip_location: The ip_location of this Identification. # noqa: E501 - """ - - self._ip_location = ip_location - - @property - def linked_id(self) -> Optional[str]: - """Gets the linked_id of this Identification. # noqa: E501 - - A customer-provided id that was sent with the request. # noqa: E501 - - :return: The linked_id of this Identification. # noqa: E501 - """ - return self._linked_id - - @linked_id.setter - def linked_id(self, linked_id: Optional[str]): - """Sets the linked_id of this Identification. - - A customer-provided id that was sent with the request. # noqa: E501 - - :param linked_id: The linked_id of this Identification. # noqa: E501 - """ - - self._linked_id = linked_id - - @property - def suspect(self) -> Optional[bool]: - """Gets the suspect of this Identification. # noqa: E501 - - Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent). # noqa: E501 - - :return: The suspect of this Identification. # noqa: E501 - """ - return self._suspect - - @suspect.setter - def suspect(self, suspect: Optional[bool]): - """Sets the suspect of this Identification. - - Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent). # noqa: E501 - - :param suspect: The suspect of this Identification. # noqa: E501 - """ - - self._suspect = suspect - - @property - def timestamp(self) -> int: - """Gets the timestamp of this Identification. # noqa: E501 - - Timestamp of the event with millisecond precision in Unix time. # noqa: E501 - - :return: The timestamp of this Identification. # noqa: E501 - """ - return self._timestamp - - @timestamp.setter - def timestamp(self, timestamp: int): - """Sets the timestamp of this Identification. - - Timestamp of the event with millisecond precision in Unix time. # noqa: E501 - - :param timestamp: The timestamp of this Identification. # noqa: E501 - """ - if timestamp is None: - raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 - - self._timestamp = timestamp - - @property - def time(self) -> datetime: - """Gets the time of this Identification. # noqa: E501 - - Time expressed according to ISO 8601 in UTC format, when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. # noqa: E501 - - :return: The time of this Identification. # noqa: E501 - """ - return self._time - - @time.setter - def time(self, time: datetime): - """Sets the time of this Identification. - - Time expressed according to ISO 8601 in UTC format, when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. # noqa: E501 - - :param time: The time of this Identification. # noqa: E501 - """ - if time is None: - raise ValueError("Invalid value for `time`, must not be `None`") # noqa: E501 - - self._time = time - - @property - def url(self) -> str: - """Gets the url of this Identification. # noqa: E501 - - Page URL from which the request was sent. # noqa: E501 - - :return: The url of this Identification. # noqa: E501 - """ - return self._url - - @url.setter - def url(self, url: str): - """Sets the url of this Identification. - - Page URL from which the request was sent. # noqa: E501 - - :param url: The url of this Identification. # noqa: E501 - """ - if url is None: - raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 - - self._url = url - - @property - def tag(self) -> Tag: - """Gets the tag of this Identification. # noqa: E501 - - - :return: The tag of this Identification. # noqa: E501 - """ - return self._tag - - @tag.setter - def tag(self, tag: Tag): - """Sets the tag of this Identification. - - - :param tag: The tag of this Identification. # noqa: E501 - """ - if tag is None: - raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 - - self._tag = tag - - @property - def confidence(self) -> Optional[IdentificationConfidence]: - """Gets the confidence of this Identification. # noqa: E501 - - - :return: The confidence of this Identification. # noqa: E501 - """ - return self._confidence - - @confidence.setter - def confidence(self, confidence: Optional[IdentificationConfidence]): - """Sets the confidence of this Identification. - - - :param confidence: The confidence of this Identification. # noqa: E501 - """ - - self._confidence = confidence - - @property - def visitor_found(self) -> bool: - """Gets the visitor_found of this Identification. # noqa: E501 - - Attribute represents if a visitor had been identified before. # noqa: E501 - - :return: The visitor_found of this Identification. # noqa: E501 - """ - return self._visitor_found - - @visitor_found.setter - def visitor_found(self, visitor_found: bool): - """Sets the visitor_found of this Identification. - - Attribute represents if a visitor had been identified before. # noqa: E501 - - :param visitor_found: The visitor_found of this Identification. # noqa: E501 - """ - if visitor_found is None: - raise ValueError("Invalid value for `visitor_found`, must not be `None`") # noqa: E501 - - self._visitor_found = visitor_found - - @property - def first_seen_at(self) -> IdentificationSeenAt: - """Gets the first_seen_at of this Identification. # noqa: E501 - - - :return: The first_seen_at of this Identification. # noqa: E501 - """ - return self._first_seen_at - - @first_seen_at.setter - def first_seen_at(self, first_seen_at: IdentificationSeenAt): - """Sets the first_seen_at of this Identification. +""" # noqa: E501 - :param first_seen_at: The first_seen_at of this Identification. # noqa: E501 - """ - if first_seen_at is None: - raise ValueError("Invalid value for `first_seen_at`, must not be `None`") # noqa: E501 - - self._first_seen_at = first_seen_at - - @property - def last_seen_at(self) -> IdentificationSeenAt: - """Gets the last_seen_at of this Identification. # noqa: E501 - - - :return: The last_seen_at of this Identification. # noqa: E501 - """ - return self._last_seen_at - - @last_seen_at.setter - def last_seen_at(self, last_seen_at: IdentificationSeenAt): - """Sets the last_seen_at of this Identification. - - - :param last_seen_at: The last_seen_at of this Identification. # noqa: E501 - """ - if last_seen_at is None: - raise ValueError("Invalid value for `last_seen_at`, must not be `None`") # noqa: E501 - - self._last_seen_at = last_seen_at - - @property - def components(self) -> Optional[RawDeviceAttributes]: - """Gets the components of this Identification. # noqa: E501 - - - :return: The components of this Identification. # noqa: E501 - """ - return self._components - - @components.setter - def components(self, components: Optional[RawDeviceAttributes]): - """Sets the components of this Identification. - - - :param components: The components of this Identification. # noqa: E501 - """ - - self._components = components - - @property - def replayed(self) -> bool: - """Gets the replayed of this Identification. # noqa: E501 - - `true` if we determined that this payload was replayed, `false` otherwise. # noqa: E501 - - :return: The replayed of this Identification. # noqa: E501 - """ - return self._replayed - - @replayed.setter - def replayed(self, replayed: bool): - """Sets the replayed of this Identification. - - `true` if we determined that this payload was replayed, `false` otherwise. # noqa: E501 - - :param replayed: The replayed of this Identification. # noqa: E501 - """ - if replayed is None: - raise ValueError("Invalid value for `replayed`, must not be `None`") # noqa: E501 - - self._replayed = replayed - - @property - def sdk(self) -> Optional[SDK]: - """Gets the sdk of this Identification. # noqa: E501 - - - :return: The sdk of this Identification. # noqa: E501 - """ - return self._sdk - - @sdk.setter - def sdk(self, sdk: Optional[SDK]): - """Sets the sdk of this Identification. - - - :param sdk: The sdk of this Identification. # noqa: E501 - """ - - self._sdk = sdk - - @property - def environment_id(self) -> Optional[str]: - """Gets the environment_id of this Identification. # noqa: E501 - - Environment ID associated with the event # noqa: E501 - - :return: The environment_id of this Identification. # noqa: E501 - """ - return self._environment_id - - @environment_id.setter - def environment_id(self, environment_id: Optional[str]): - """Sets the environment_id of this Identification. +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Environment ID associated with the event # noqa: E501 +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from fingerprint_server_sdk.models.identification_confidence import IdentificationConfidence +from typing import Optional, Set +from typing_extensions import Self - :param environment_id: The environment_id of this Identification. # noqa: E501 - """ +class Identification(BaseModel): + """ + Identification + """ # noqa: E501 + visitor_id: StrictStr = Field(description="String of 20 characters that uniquely identifies the visitor's browser or mobile device.") + confidence: Optional[IdentificationConfidence] = None + visitor_found: StrictBool = Field(description="Attribute represents if a visitor had been identified before.") + first_seen_at: Optional[StrictInt] = Field(default=None, description="Unix epoch time milliseconds timestamp indicating the time at which this visitor ID was first seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 ") + last_seen_at: Optional[StrictInt] = Field(default=None, description="Unix epoch time milliseconds timestamp indicating the time at which this visitor ID was last seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 ") + __properties: ClassVar[List[str]] = ["visitor_id", "confidence", "visitor_found", "first_seen_at", "last_seen_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Identification from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of confidence + if self.confidence: + _dict['confidence'] = self.confidence.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Identification from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "visitor_id": obj.get("visitor_id"), + "confidence": IdentificationConfidence.from_dict(obj["confidence"]) if obj.get("confidence") is not None else None, + "visitor_found": obj.get("visitor_found"), + "first_seen_at": obj.get("first_seen_at"), + "last_seen_at": obj.get("last_seen_at") + }) + return _obj - self._environment_id = environment_id diff --git a/fingerprint_server_sdk/models/identification_confidence.py b/fingerprint_server_sdk/models/identification_confidence.py index f92e90ba..41c777f2 100644 --- a/fingerprint_server_sdk/models/identification_confidence.py +++ b/fingerprint_server_sdk/models/identification_confidence.py @@ -1,122 +1,93 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class IdentificationConfidence(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'score': 'float', - 'revision': 'str', - 'comment': 'str' - } - - nullable_map = { - 'score': False, - 'revision': False, - 'comment': False - } - - attribute_map = { - 'score': 'score', - 'revision': 'revision', - 'comment': 'comment' - } - - def __init__(self, score=None, revision=None, comment=None): # noqa: E501 - """IdentificationConfidence - a model defined in Swagger""" # noqa: E501 - self._score = None - self._revision = None - self._comment = None - self.discriminator = None - self.score = score - if revision is not None: - self.revision = revision - if comment is not None: - self.comment = comment - - @property - def score(self) -> float: - """Gets the score of this IdentificationConfidence. # noqa: E501 - - The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. # noqa: E501 - - :return: The score of this IdentificationConfidence. # noqa: E501 - """ - return self._score - - @score.setter - def score(self, score: float): - """Sets the score of this IdentificationConfidence. - - The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. # noqa: E501 - - :param score: The score of this IdentificationConfidence. # noqa: E501 - """ - if score is None: - raise ValueError("Invalid value for `score`, must not be `None`") # noqa: E501 - - self._score = score +""" # noqa: E501 - @property - def revision(self) -> Optional[str]: - """Gets the revision of this IdentificationConfidence. # noqa: E501 - 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. # noqa: E501 - - :return: The revision of this IdentificationConfidence. # noqa: E501 - """ - return self._revision - - @revision.setter - def revision(self, revision: Optional[str]): - """Sets the revision of this IdentificationConfidence. - - 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. # noqa: E501 - - :param revision: The revision of this IdentificationConfidence. # noqa: E501 - """ - - self._revision = revision - - @property - def comment(self) -> Optional[str]: - """Gets the comment of this IdentificationConfidence. # noqa: E501 - - - :return: The comment of this IdentificationConfidence. # noqa: E501 - """ - return self._comment - - @comment.setter - def comment(self, comment: Optional[str]): - """Sets the comment of this IdentificationConfidence. +from __future__ import annotations +import pprint +import re # noqa: F401 +import json +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self - :param comment: The comment of this IdentificationConfidence. # noqa: E501 +class IdentificationConfidence(BaseModel): + """ + IdentificationConfidence + """ # noqa: E501 + score: Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]] = Field(description="The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification.") + version: Optional[StrictStr] = Field(default=None, description="The version 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.") + comment: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["score", "version", "comment"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IdentificationConfidence from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IdentificationConfidence from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "score": obj.get("score"), + "version": obj.get("version"), + "comment": obj.get("comment") + }) + return _obj - self._comment = comment diff --git a/fingerprint_server_sdk/models/identification_seen_at.py b/fingerprint_server_sdk/models/identification_seen_at.py deleted file mode 100644 index 8813a7f4..00000000 --- a/fingerprint_server_sdk/models/identification_seen_at.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from datetime import datetime -from datetime import datetime - - -class IdentificationSeenAt(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - '_global': 'datetime', - 'subscription': 'datetime' - } - - nullable_map = { - '_global': True, - 'subscription': True - } - - attribute_map = { - '_global': 'global', - 'subscription': 'subscription' - } - - def __init__(self, _global=None, subscription=None): # noqa: E501 - """IdentificationSeenAt - a model defined in Swagger""" # noqa: E501 - self.__global = None - self._subscription = None - self.discriminator = None - self._global = _global - self.subscription = subscription - - @property - def _global(self) -> datetime: - """Gets the _global of this IdentificationSeenAt. # noqa: E501 - - - :return: The _global of this IdentificationSeenAt. # noqa: E501 - """ - return self.__global - - @_global.setter - def _global(self, _global: datetime): - """Sets the _global of this IdentificationSeenAt. - - - :param _global: The _global of this IdentificationSeenAt. # noqa: E501 - """ - - self.__global = _global - - @property - def subscription(self) -> datetime: - """Gets the subscription of this IdentificationSeenAt. # noqa: E501 - - - :return: The subscription of this IdentificationSeenAt. # noqa: E501 - """ - return self._subscription - - @subscription.setter - def subscription(self, subscription: datetime): - """Sets the subscription of this IdentificationSeenAt. - - - :param subscription: The subscription of this IdentificationSeenAt. # noqa: E501 - """ - - self._subscription = subscription - diff --git a/fingerprint_server_sdk/models/incognito.py b/fingerprint_server_sdk/models/incognito.py deleted file mode 100644 index a8376107..00000000 --- a/fingerprint_server_sdk/models/incognito.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class Incognito(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """Incognito - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - self.result = result - - @property - def result(self) -> bool: - """Gets the result of this Incognito. # noqa: E501 - - `true` if we detected incognito mode used in the browser, `false` otherwise. # noqa: E501 - - :return: The result of this Incognito. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this Incognito. - - `true` if we detected incognito mode used in the browser, `false` otherwise. # noqa: E501 - - :param result: The result of this Incognito. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - diff --git a/fingerprint_server_sdk/models/integration.py b/fingerprint_server_sdk/models/integration.py new file mode 100644 index 00000000..a1757e1a --- /dev/null +++ b/fingerprint_server_sdk/models/integration.py @@ -0,0 +1,96 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from fingerprint_server_sdk.models.integration_subintegration import IntegrationSubintegration +from typing import Optional, Set +from typing_extensions import Self + +class Integration(BaseModel): + """ + Integration + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of the specific integration, e.g. \"fingerprint-pro-react\".") + version: Optional[StrictStr] = Field(default=None, description="The version of the specific integration, e.g. \"3.11.10\".") + subintegration: Optional[IntegrationSubintegration] = None + __properties: ClassVar[List[str]] = ["name", "version", "subintegration"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Integration from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of subintegration + if self.subintegration: + _dict['subintegration'] = self.subintegration.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Integration from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "version": obj.get("version"), + "subintegration": IntegrationSubintegration.from_dict(obj["subintegration"]) if obj.get("subintegration") is not None else None + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/integration_subintegration.py b/fingerprint_server_sdk/models/integration_subintegration.py new file mode 100644 index 00000000..9f2e3905 --- /dev/null +++ b/fingerprint_server_sdk/models/integration_subintegration.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class IntegrationSubintegration(BaseModel): + """ + IntegrationSubintegration + """ # noqa: E501 + name: Optional[StrictStr] = Field(default=None, description="The name of the specific subintegration, e.g. \"preact\".") + version: Optional[StrictStr] = Field(default=None, description="The version of the specific subintegration, e.g. \"10.21.0\".") + __properties: ClassVar[List[str]] = ["name", "version"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IntegrationSubintegration from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IntegrationSubintegration from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "version": obj.get("version") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/ip_block_list.py b/fingerprint_server_sdk/models/ip_block_list.py new file mode 100644 index 00000000..87bb5d93 --- /dev/null +++ b/fingerprint_server_sdk/models/ip_block_list.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class IPBlockList(BaseModel): + """ + IPBlockList + """ # noqa: E501 + email_spam: Optional[StrictBool] = Field(default=None, description="IP address was part of a known email spam attack (SMTP).") + attack_source: Optional[StrictBool] = Field(default=None, description="IP address was part of a known network attack (SSH/HTTPS).") + tor_node: Optional[StrictBool] = Field(default=None, description="IP address was part of known TOR network activity.") + __properties: ClassVar[List[str]] = ["email_spam", "attack_source", "tor_node"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IPBlockList from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IPBlockList from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "email_spam": obj.get("email_spam"), + "attack_source": obj.get("attack_source"), + "tor_node": obj.get("tor_node") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/ip_blocklist.py b/fingerprint_server_sdk/models/ip_blocklist.py deleted file mode 100644 index 294dc1a7..00000000 --- a/fingerprint_server_sdk/models/ip_blocklist.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.ip_blocklist_details import IPBlocklistDetails - - -class IPBlocklist(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool', - 'details': 'IPBlocklistDetails' - } - - nullable_map = { - 'result': False, - 'details': False - } - - attribute_map = { - 'result': 'result', - 'details': 'details' - } - - def __init__(self, result=None, details=None): # noqa: E501 - """IPBlocklist - a model defined in Swagger""" # noqa: E501 - self._result = None - self._details = None - self.discriminator = None - self.result = result - self.details = details - - @property - def result(self) -> bool: - """Gets the result of this IPBlocklist. # noqa: E501 - - `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. # noqa: E501 - - :return: The result of this IPBlocklist. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this IPBlocklist. - - `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. # noqa: E501 - - :param result: The result of this IPBlocklist. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - - @property - def details(self) -> IPBlocklistDetails: - """Gets the details of this IPBlocklist. # noqa: E501 - - - :return: The details of this IPBlocklist. # noqa: E501 - """ - return self._details - - @details.setter - def details(self, details: IPBlocklistDetails): - """Sets the details of this IPBlocklist. - - - :param details: The details of this IPBlocklist. # noqa: E501 - """ - if details is None: - raise ValueError("Invalid value for `details`, must not be `None`") # noqa: E501 - - self._details = details - diff --git a/fingerprint_server_sdk/models/ip_blocklist_details.py b/fingerprint_server_sdk/models/ip_blocklist_details.py deleted file mode 100644 index 95e682e5..00000000 --- a/fingerprint_server_sdk/models/ip_blocklist_details.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class IPBlocklistDetails(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'email_spam': 'bool', - 'attack_source': 'bool' - } - - nullable_map = { - 'email_spam': False, - 'attack_source': False - } - - attribute_map = { - 'email_spam': 'emailSpam', - 'attack_source': 'attackSource' - } - - def __init__(self, email_spam=None, attack_source=None): # noqa: E501 - """IPBlocklistDetails - a model defined in Swagger""" # noqa: E501 - self._email_spam = None - self._attack_source = None - self.discriminator = None - self.email_spam = email_spam - self.attack_source = attack_source - - @property - def email_spam(self) -> bool: - """Gets the email_spam of this IPBlocklistDetails. # noqa: E501 - - IP address was part of a known email spam attack (SMTP). # noqa: E501 - - :return: The email_spam of this IPBlocklistDetails. # noqa: E501 - """ - return self._email_spam - - @email_spam.setter - def email_spam(self, email_spam: bool): - """Sets the email_spam of this IPBlocklistDetails. - - IP address was part of a known email spam attack (SMTP). # noqa: E501 - - :param email_spam: The email_spam of this IPBlocklistDetails. # noqa: E501 - """ - if email_spam is None: - raise ValueError("Invalid value for `email_spam`, must not be `None`") # noqa: E501 - - self._email_spam = email_spam - - @property - def attack_source(self) -> bool: - """Gets the attack_source of this IPBlocklistDetails. # noqa: E501 - - IP address was part of a known network attack (SSH/HTTPS). # noqa: E501 - - :return: The attack_source of this IPBlocklistDetails. # noqa: E501 - """ - return self._attack_source - - @attack_source.setter - def attack_source(self, attack_source: bool): - """Sets the attack_source of this IPBlocklistDetails. - - IP address was part of a known network attack (SSH/HTTPS). # noqa: E501 - - :param attack_source: The attack_source of this IPBlocklistDetails. # noqa: E501 - """ - if attack_source is None: - raise ValueError("Invalid value for `attack_source`, must not be `None`") # noqa: E501 - - self._attack_source = attack_source - diff --git a/fingerprint_server_sdk/models/ip_info.py b/fingerprint_server_sdk/models/ip_info.py index 5d80a72c..869eb44a 100644 --- a/fingerprint_server_sdk/models/ip_info.py +++ b/fingerprint_server_sdk/models/ip_info.py @@ -1,97 +1,98 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations +import pprint import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel +import json + +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional from fingerprint_server_sdk.models.ip_info_v4 import IPInfoV4 from fingerprint_server_sdk.models.ip_info_v6 import IPInfoV6 - +from typing import Optional, Set +from typing_extensions import Self class IPInfo(BaseModel): """ Details about the request IP address. Has separate fields for v4 and v6 IP address versions. + """ # noqa: E501 + v4: Optional[IPInfoV4] = None + v6: Optional[IPInfoV6] = None + __properties: ClassVar[List[str]] = ["v4", "v6"] - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'v4': 'IPInfoV4', - 'v6': 'IPInfoV6' - } - - nullable_map = { - 'v4': False, - 'v6': False - } - - attribute_map = { - 'v4': 'v4', - 'v6': 'v6' - } - - def __init__(self, v4=None, v6=None): # noqa: E501 - """IPInfo - a model defined in Swagger""" # noqa: E501 - self._v4 = None - self._v6 = None - self.discriminator = None - if v4 is not None: - self.v4 = v4 - if v6 is not None: - self.v6 = v6 - - @property - def v4(self) -> Optional[IPInfoV4]: - """Gets the v4 of this IPInfo. # noqa: E501 - - - :return: The v4 of this IPInfo. # noqa: E501 - """ - return self._v4 - - @v4.setter - def v4(self, v4: Optional[IPInfoV4]): - """Sets the v4 of this IPInfo. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - :param v4: The v4 of this IPInfo. # noqa: E501 - """ - - self._v4 = v4 + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) - @property - def v6(self) -> Optional[IPInfoV6]: - """Gets the v6 of this IPInfo. # noqa: E501 + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IPInfo from a JSON string""" + return cls.from_dict(json.loads(json_str)) - :return: The v6 of this IPInfo. # noqa: E501 - """ - return self._v6 - - @v6.setter - def v6(self, v6: Optional[IPInfoV6]): - """Sets the v6 of this IPInfo. + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: - :param v6: The v6 of this IPInfo. # noqa: E501 + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of v4 + if self.v4: + _dict['v4'] = self.v4.to_dict() + # override the default output from pydantic by calling `to_dict()` of v6 + if self.v6: + _dict['v6'] = self.v6.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IPInfo from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "v4": IPInfoV4.from_dict(obj["v4"]) if obj.get("v4") is not None else None, + "v6": IPInfoV6.from_dict(obj["v6"]) if obj.get("v6") is not None else None + }) + return _obj - self._v6 = v6 diff --git a/fingerprint_server_sdk/models/ip_info_asn.py b/fingerprint_server_sdk/models/ip_info_asn.py deleted file mode 100644 index bddbcc86..00000000 --- a/fingerprint_server_sdk/models/ip_info_asn.py +++ /dev/null @@ -1,120 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class IPInfoASN(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'asn': 'str', - 'name': 'str', - 'network': 'str' - } - - nullable_map = { - 'asn': False, - 'name': False, - 'network': False - } - - attribute_map = { - 'asn': 'asn', - 'name': 'name', - 'network': 'network' - } - - def __init__(self, asn=None, name=None, network=None): # noqa: E501 - """IPInfoASN - a model defined in Swagger""" # noqa: E501 - self._asn = None - self._name = None - self._network = None - self.discriminator = None - self.asn = asn - self.name = name - self.network = network - - @property - def asn(self) -> str: - """Gets the asn of this IPInfoASN. # noqa: E501 - - - :return: The asn of this IPInfoASN. # noqa: E501 - """ - return self._asn - - @asn.setter - def asn(self, asn: str): - """Sets the asn of this IPInfoASN. - - - :param asn: The asn of this IPInfoASN. # noqa: E501 - """ - if asn is None: - raise ValueError("Invalid value for `asn`, must not be `None`") # noqa: E501 - - self._asn = asn - - @property - def name(self) -> str: - """Gets the name of this IPInfoASN. # noqa: E501 - - - :return: The name of this IPInfoASN. # noqa: E501 - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this IPInfoASN. - - - :param name: The name of this IPInfoASN. # noqa: E501 - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - - @property - def network(self) -> str: - """Gets the network of this IPInfoASN. # noqa: E501 - - - :return: The network of this IPInfoASN. # noqa: E501 - """ - return self._network - - @network.setter - def network(self, network: str): - """Sets the network of this IPInfoASN. - - - :param network: The network of this IPInfoASN. # noqa: E501 - """ - if network is None: - raise ValueError("Invalid value for `network`, must not be `None`") # noqa: E501 - - self._network = network - diff --git a/fingerprint_server_sdk/models/ip_info_data_center.py b/fingerprint_server_sdk/models/ip_info_data_center.py deleted file mode 100644 index 5182155e..00000000 --- a/fingerprint_server_sdk/models/ip_info_data_center.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class IPInfoDataCenter(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool', - 'name': 'str' - } - - nullable_map = { - 'result': False, - 'name': False - } - - attribute_map = { - 'result': 'result', - 'name': 'name' - } - - def __init__(self, result=None, name=None): # noqa: E501 - """IPInfoDataCenter - a model defined in Swagger""" # noqa: E501 - self._result = None - self._name = None - self.discriminator = None - self.result = result - self.name = name - - @property - def result(self) -> bool: - """Gets the result of this IPInfoDataCenter. # noqa: E501 - - - :return: The result of this IPInfoDataCenter. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this IPInfoDataCenter. - - - :param result: The result of this IPInfoDataCenter. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - - @property - def name(self) -> str: - """Gets the name of this IPInfoDataCenter. # noqa: E501 - - - :return: The name of this IPInfoDataCenter. # noqa: E501 - """ - return self._name - - @name.setter - def name(self, name: str): - """Sets the name of this IPInfoDataCenter. - - - :param name: The name of this IPInfoDataCenter. # noqa: E501 - """ - if name is None: - raise ValueError("Invalid value for `name`, must not be `None`") # noqa: E501 - - self._name = name - diff --git a/fingerprint_server_sdk/models/ip_info_v4.py b/fingerprint_server_sdk/models/ip_info_v4.py index 49b93888..03fa0c78 100644 --- a/fingerprint_server_sdk/models/ip_info_v4.py +++ b/fingerprint_server_sdk/models/ip_info_v4.py @@ -1,147 +1,106 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.geolocation import Geolocation -from fingerprint_server_sdk.models.ip_info_asn import IPInfoASN -from fingerprint_server_sdk.models.ip_info_data_center import IPInfoDataCenter - - -class IPInfoV4(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'address': 'str', - 'geolocation': 'Geolocation', - 'asn': 'IPInfoASN', - 'datacenter': 'IPInfoDataCenter' - } - - nullable_map = { - 'address': False, - 'geolocation': False, - 'asn': False, - 'datacenter': False - } - - attribute_map = { - 'address': 'address', - 'geolocation': 'geolocation', - 'asn': 'asn', - 'datacenter': 'datacenter' - } - - def __init__(self, address=None, geolocation=None, asn=None, datacenter=None): # noqa: E501 - """IPInfoV4 - a model defined in Swagger""" # noqa: E501 - self._address = None - self._geolocation = None - self._asn = None - self._datacenter = None - self.discriminator = None - self.address = address - self.geolocation = geolocation - if asn is not None: - self.asn = asn - if datacenter is not None: - self.datacenter = datacenter - - @property - def address(self) -> str: - """Gets the address of this IPInfoV4. # noqa: E501 - - - :return: The address of this IPInfoV4. # noqa: E501 - """ - return self._address - - @address.setter - def address(self, address: str): - """Sets the address of this IPInfoV4. - - - :param address: The address of this IPInfoV4. # noqa: E501 - """ - if address is None: - raise ValueError("Invalid value for `address`, must not be `None`") # noqa: E501 - - self._address = address - - @property - def geolocation(self) -> Geolocation: - """Gets the geolocation of this IPInfoV4. # noqa: E501 - - - :return: The geolocation of this IPInfoV4. # noqa: E501 - """ - return self._geolocation - - @geolocation.setter - def geolocation(self, geolocation: Geolocation): - """Sets the geolocation of this IPInfoV4. +""" # noqa: E501 - :param geolocation: The geolocation of this IPInfoV4. # noqa: E501 - """ - if geolocation is None: - raise ValueError("Invalid value for `geolocation`, must not be `None`") # noqa: E501 - - self._geolocation = geolocation - - @property - def asn(self) -> Optional[IPInfoASN]: - """Gets the asn of this IPInfoV4. # noqa: E501 - - - :return: The asn of this IPInfoV4. # noqa: E501 - """ - return self._asn - - @asn.setter - def asn(self, asn: Optional[IPInfoASN]): - """Sets the asn of this IPInfoV4. - - - :param asn: The asn of this IPInfoV4. # noqa: E501 - """ - - self._asn = asn - - @property - def datacenter(self) -> Optional[IPInfoDataCenter]: - """Gets the datacenter of this IPInfoV4. # noqa: E501 - - - :return: The datacenter of this IPInfoV4. # noqa: E501 - """ - return self._datacenter - - @datacenter.setter - def datacenter(self, datacenter: Optional[IPInfoDataCenter]): - """Sets the datacenter of this IPInfoV4. +from __future__ import annotations +import pprint +import re # noqa: F401 +import json +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from fingerprint_server_sdk.models.geolocation import Geolocation +from typing import Optional, Set +from typing_extensions import Self - :param datacenter: The datacenter of this IPInfoV4. # noqa: E501 +class IPInfoV4(BaseModel): + """ + IPInfoV4 + """ # noqa: E501 + address: StrictStr + geolocation: Optional[Geolocation] = None + asn: Optional[StrictStr] = None + asn_name: Optional[StrictStr] = None + asn_network: Optional[StrictStr] = None + asn_type: Optional[StrictStr] = None + datacenter_result: Optional[StrictBool] = None + datacenter_name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["address", "geolocation", "asn", "asn_name", "asn_network", "asn_type", "datacenter_result", "datacenter_name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IPInfoV4 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of geolocation + if self.geolocation: + _dict['geolocation'] = self.geolocation.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IPInfoV4 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "geolocation": Geolocation.from_dict(obj["geolocation"]) if obj.get("geolocation") is not None else None, + "asn": obj.get("asn"), + "asn_name": obj.get("asn_name"), + "asn_network": obj.get("asn_network"), + "asn_type": obj.get("asn_type"), + "datacenter_result": obj.get("datacenter_result"), + "datacenter_name": obj.get("datacenter_name") + }) + return _obj - self._datacenter = datacenter diff --git a/fingerprint_server_sdk/models/ip_info_v6.py b/fingerprint_server_sdk/models/ip_info_v6.py index c0d9b7b1..cf9e8dcd 100644 --- a/fingerprint_server_sdk/models/ip_info_v6.py +++ b/fingerprint_server_sdk/models/ip_info_v6.py @@ -1,147 +1,106 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.geolocation import Geolocation -from fingerprint_server_sdk.models.ip_info_asn import IPInfoASN -from fingerprint_server_sdk.models.ip_info_data_center import IPInfoDataCenter - - -class IPInfoV6(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'address': 'str', - 'geolocation': 'Geolocation', - 'asn': 'IPInfoASN', - 'datacenter': 'IPInfoDataCenter' - } - - nullable_map = { - 'address': False, - 'geolocation': False, - 'asn': False, - 'datacenter': False - } - - attribute_map = { - 'address': 'address', - 'geolocation': 'geolocation', - 'asn': 'asn', - 'datacenter': 'datacenter' - } - - def __init__(self, address=None, geolocation=None, asn=None, datacenter=None): # noqa: E501 - """IPInfoV6 - a model defined in Swagger""" # noqa: E501 - self._address = None - self._geolocation = None - self._asn = None - self._datacenter = None - self.discriminator = None - self.address = address - self.geolocation = geolocation - if asn is not None: - self.asn = asn - if datacenter is not None: - self.datacenter = datacenter - - @property - def address(self) -> str: - """Gets the address of this IPInfoV6. # noqa: E501 - - - :return: The address of this IPInfoV6. # noqa: E501 - """ - return self._address - - @address.setter - def address(self, address: str): - """Sets the address of this IPInfoV6. - - - :param address: The address of this IPInfoV6. # noqa: E501 - """ - if address is None: - raise ValueError("Invalid value for `address`, must not be `None`") # noqa: E501 - - self._address = address - - @property - def geolocation(self) -> Geolocation: - """Gets the geolocation of this IPInfoV6. # noqa: E501 - - - :return: The geolocation of this IPInfoV6. # noqa: E501 - """ - return self._geolocation - - @geolocation.setter - def geolocation(self, geolocation: Geolocation): - """Sets the geolocation of this IPInfoV6. +""" # noqa: E501 - :param geolocation: The geolocation of this IPInfoV6. # noqa: E501 - """ - if geolocation is None: - raise ValueError("Invalid value for `geolocation`, must not be `None`") # noqa: E501 - - self._geolocation = geolocation - - @property - def asn(self) -> Optional[IPInfoASN]: - """Gets the asn of this IPInfoV6. # noqa: E501 - - - :return: The asn of this IPInfoV6. # noqa: E501 - """ - return self._asn - - @asn.setter - def asn(self, asn: Optional[IPInfoASN]): - """Sets the asn of this IPInfoV6. - - - :param asn: The asn of this IPInfoV6. # noqa: E501 - """ - - self._asn = asn - - @property - def datacenter(self) -> Optional[IPInfoDataCenter]: - """Gets the datacenter of this IPInfoV6. # noqa: E501 - - - :return: The datacenter of this IPInfoV6. # noqa: E501 - """ - return self._datacenter - - @datacenter.setter - def datacenter(self, datacenter: Optional[IPInfoDataCenter]): - """Sets the datacenter of this IPInfoV6. +from __future__ import annotations +import pprint +import re # noqa: F401 +import json +from pydantic import BaseModel, ConfigDict, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from fingerprint_server_sdk.models.geolocation import Geolocation +from typing import Optional, Set +from typing_extensions import Self - :param datacenter: The datacenter of this IPInfoV6. # noqa: E501 +class IPInfoV6(BaseModel): + """ + IPInfoV6 + """ # noqa: E501 + address: StrictStr + geolocation: Optional[Geolocation] = None + asn: Optional[StrictStr] = None + asn_name: Optional[StrictStr] = None + asn_network: Optional[StrictStr] = None + asn_type: Optional[StrictStr] = None + datacenter_result: Optional[StrictBool] = None + datacenter_name: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["address", "geolocation", "asn", "asn_name", "asn_network", "asn_type", "datacenter_result", "datacenter_name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of IPInfoV6 from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of geolocation + if self.geolocation: + _dict['geolocation'] = self.geolocation.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of IPInfoV6 from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "address": obj.get("address"), + "geolocation": Geolocation.from_dict(obj["geolocation"]) if obj.get("geolocation") is not None else None, + "asn": obj.get("asn"), + "asn_name": obj.get("asn_name"), + "asn_network": obj.get("asn_network"), + "asn_type": obj.get("asn_type"), + "datacenter_result": obj.get("datacenter_result"), + "datacenter_name": obj.get("datacenter_name") + }) + return _obj - self._datacenter = datacenter diff --git a/fingerprint_server_sdk/models/jailbroken.py b/fingerprint_server_sdk/models/jailbroken.py deleted file mode 100644 index ced35adc..00000000 --- a/fingerprint_server_sdk/models/jailbroken.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class Jailbroken(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """Jailbroken - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - self.result = result - - @property - def result(self) -> bool: - """Gets the result of this Jailbroken. # noqa: E501 - - iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. # noqa: E501 - - :return: The result of this Jailbroken. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this Jailbroken. - - iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. # noqa: E501 - - :param result: The result of this Jailbroken. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - diff --git a/fingerprint_server_sdk/models/location_spoofing.py b/fingerprint_server_sdk/models/location_spoofing.py deleted file mode 100644 index f43d46d9..00000000 --- a/fingerprint_server_sdk/models/location_spoofing.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class LocationSpoofing(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """LocationSpoofing - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - self.result = result - - @property - def result(self) -> bool: - """Gets the result of this LocationSpoofing. # noqa: E501 - - Flag indicating whether the request came from a mobile device with location spoofing enabled. # noqa: E501 - - :return: The result of this LocationSpoofing. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this LocationSpoofing. - - Flag indicating whether the request came from a mobile device with location spoofing enabled. # noqa: E501 - - :param result: The result of this LocationSpoofing. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - diff --git a/fingerprint_server_sdk/models/mit_m_attack.py b/fingerprint_server_sdk/models/mit_m_attack.py deleted file mode 100644 index 3d70b40d..00000000 --- a/fingerprint_server_sdk/models/mit_m_attack.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class MitMAttack(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """MitMAttack - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - self.result = result - - @property - def result(self) -> bool: - """Gets the result of this MitMAttack. # noqa: E501 - - * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. # noqa: E501 - - :return: The result of this MitMAttack. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this MitMAttack. - - * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. # noqa: E501 - - :param result: The result of this MitMAttack. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - diff --git a/fingerprint_server_sdk/models/plugins_inner.py b/fingerprint_server_sdk/models/plugins_inner.py new file mode 100644 index 00000000..a9b57934 --- /dev/null +++ b/fingerprint_server_sdk/models/plugins_inner.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from fingerprint_server_sdk.models.plugins_inner_mime_types_inner import PluginsInnerMimeTypesInner +from typing import Optional, Set +from typing_extensions import Self + +class PluginsInner(BaseModel): + """ + PluginsInner + """ # noqa: E501 + name: StrictStr + description: Optional[StrictStr] = None + mime_types: Optional[List[PluginsInnerMimeTypesInner]] = Field(default=None, alias="mimeTypes") + __properties: ClassVar[List[str]] = ["name", "description", "mimeTypes"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PluginsInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in mime_types (list) + _items = [] + if self.mime_types: + for _item_mime_types in self.mime_types: + if _item_mime_types: + _items.append(_item_mime_types.to_dict()) + _dict['mimeTypes'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PluginsInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "description": obj.get("description"), + "mimeTypes": [PluginsInnerMimeTypesInner.from_dict(_item) for _item in obj["mimeTypes"]] if obj.get("mimeTypes") is not None else None + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/plugins_inner_mime_types_inner.py b/fingerprint_server_sdk/models/plugins_inner_mime_types_inner.py new file mode 100644 index 00000000..cd788bae --- /dev/null +++ b/fingerprint_server_sdk/models/plugins_inner_mime_types_inner.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class PluginsInnerMimeTypesInner(BaseModel): + """ + PluginsInnerMimeTypesInner + """ # noqa: E501 + type: Optional[StrictStr] = None + suffixes: Optional[StrictStr] = None + description: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["type", "suffixes", "description"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of PluginsInnerMimeTypesInner from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of PluginsInnerMimeTypesInner from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "type": obj.get("type"), + "suffixes": obj.get("suffixes"), + "description": obj.get("description") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/privacy_settings.py b/fingerprint_server_sdk/models/privacy_settings.py deleted file mode 100644 index 102a1893..00000000 --- a/fingerprint_server_sdk/models/privacy_settings.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class PrivacySettings(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """PrivacySettings - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - self.result = result - - @property - def result(self) -> bool: - """Gets the result of this PrivacySettings. # noqa: E501 - - `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. # noqa: E501 - - :return: The result of this PrivacySettings. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this PrivacySettings. - - `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. # noqa: E501 - - :param result: The result of this PrivacySettings. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - diff --git a/fingerprint_server_sdk/models/product_botd.py b/fingerprint_server_sdk/models/product_botd.py deleted file mode 100644 index 8f535dc6..00000000 --- a/fingerprint_server_sdk/models/product_botd.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.botd import Botd -from fingerprint_server_sdk.models.error import Error - - -class ProductBotd(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'Botd', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductBotd - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[Botd]: - """Gets the data of this ProductBotd. # noqa: E501 - - - :return: The data of this ProductBotd. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[Botd]): - """Sets the data of this ProductBotd. - - - :param data: The data of this ProductBotd. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductBotd. # noqa: E501 - - - :return: The error of this ProductBotd. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductBotd. - - - :param error: The error of this ProductBotd. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_cloned_app.py b/fingerprint_server_sdk/models/product_cloned_app.py deleted file mode 100644 index f1f44157..00000000 --- a/fingerprint_server_sdk/models/product_cloned_app.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.cloned_app import ClonedApp -from fingerprint_server_sdk.models.error import Error - - -class ProductClonedApp(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'ClonedApp', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductClonedApp - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[ClonedApp]: - """Gets the data of this ProductClonedApp. # noqa: E501 - - - :return: The data of this ProductClonedApp. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[ClonedApp]): - """Sets the data of this ProductClonedApp. - - - :param data: The data of this ProductClonedApp. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductClonedApp. # noqa: E501 - - - :return: The error of this ProductClonedApp. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductClonedApp. - - - :param error: The error of this ProductClonedApp. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_developer_tools.py b/fingerprint_server_sdk/models/product_developer_tools.py deleted file mode 100644 index 9d954a32..00000000 --- a/fingerprint_server_sdk/models/product_developer_tools.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.developer_tools import DeveloperTools -from fingerprint_server_sdk.models.error import Error - - -class ProductDeveloperTools(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'DeveloperTools', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductDeveloperTools - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[DeveloperTools]: - """Gets the data of this ProductDeveloperTools. # noqa: E501 - - - :return: The data of this ProductDeveloperTools. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[DeveloperTools]): - """Sets the data of this ProductDeveloperTools. - - - :param data: The data of this ProductDeveloperTools. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductDeveloperTools. # noqa: E501 - - - :return: The error of this ProductDeveloperTools. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductDeveloperTools. - - - :param error: The error of this ProductDeveloperTools. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_emulator.py b/fingerprint_server_sdk/models/product_emulator.py deleted file mode 100644 index 951329d9..00000000 --- a/fingerprint_server_sdk/models/product_emulator.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.emulator import Emulator -from fingerprint_server_sdk.models.error import Error - - -class ProductEmulator(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'Emulator', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductEmulator - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[Emulator]: - """Gets the data of this ProductEmulator. # noqa: E501 - - - :return: The data of this ProductEmulator. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[Emulator]): - """Sets the data of this ProductEmulator. - - - :param data: The data of this ProductEmulator. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductEmulator. # noqa: E501 - - - :return: The error of this ProductEmulator. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductEmulator. - - - :param error: The error of this ProductEmulator. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_factory_reset.py b/fingerprint_server_sdk/models/product_factory_reset.py deleted file mode 100644 index d2002a02..00000000 --- a/fingerprint_server_sdk/models/product_factory_reset.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.factory_reset import FactoryReset -from fingerprint_server_sdk.models.error import Error - - -class ProductFactoryReset(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'FactoryReset', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductFactoryReset - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[FactoryReset]: - """Gets the data of this ProductFactoryReset. # noqa: E501 - - - :return: The data of this ProductFactoryReset. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[FactoryReset]): - """Sets the data of this ProductFactoryReset. - - - :param data: The data of this ProductFactoryReset. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductFactoryReset. # noqa: E501 - - - :return: The error of this ProductFactoryReset. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductFactoryReset. - - - :param error: The error of this ProductFactoryReset. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_frida.py b/fingerprint_server_sdk/models/product_frida.py deleted file mode 100644 index 168c8030..00000000 --- a/fingerprint_server_sdk/models/product_frida.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.frida import Frida -from fingerprint_server_sdk.models.error import Error - - -class ProductFrida(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'Frida', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductFrida - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[Frida]: - """Gets the data of this ProductFrida. # noqa: E501 - - - :return: The data of this ProductFrida. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[Frida]): - """Sets the data of this ProductFrida. - - - :param data: The data of this ProductFrida. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductFrida. # noqa: E501 - - - :return: The error of this ProductFrida. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductFrida. - - - :param error: The error of this ProductFrida. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_high_activity.py b/fingerprint_server_sdk/models/product_high_activity.py deleted file mode 100644 index 57d3448b..00000000 --- a/fingerprint_server_sdk/models/product_high_activity.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.high_activity import HighActivity -from fingerprint_server_sdk.models.error import Error - - -class ProductHighActivity(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'HighActivity', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductHighActivity - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[HighActivity]: - """Gets the data of this ProductHighActivity. # noqa: E501 - - - :return: The data of this ProductHighActivity. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[HighActivity]): - """Sets the data of this ProductHighActivity. - - - :param data: The data of this ProductHighActivity. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductHighActivity. # noqa: E501 - - - :return: The error of this ProductHighActivity. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductHighActivity. - - - :param error: The error of this ProductHighActivity. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_identification.py b/fingerprint_server_sdk/models/product_identification.py deleted file mode 100644 index 39bfd01b..00000000 --- a/fingerprint_server_sdk/models/product_identification.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.identification import Identification -from fingerprint_server_sdk.models.error import Error - - -class ProductIdentification(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'Identification', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductIdentification - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[Identification]: - """Gets the data of this ProductIdentification. # noqa: E501 - - - :return: The data of this ProductIdentification. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[Identification]): - """Sets the data of this ProductIdentification. - - - :param data: The data of this ProductIdentification. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductIdentification. # noqa: E501 - - - :return: The error of this ProductIdentification. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductIdentification. - - - :param error: The error of this ProductIdentification. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_incognito.py b/fingerprint_server_sdk/models/product_incognito.py deleted file mode 100644 index 3315d54b..00000000 --- a/fingerprint_server_sdk/models/product_incognito.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.incognito import Incognito -from fingerprint_server_sdk.models.error import Error - - -class ProductIncognito(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'Incognito', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductIncognito - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[Incognito]: - """Gets the data of this ProductIncognito. # noqa: E501 - - - :return: The data of this ProductIncognito. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[Incognito]): - """Sets the data of this ProductIncognito. - - - :param data: The data of this ProductIncognito. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductIncognito. # noqa: E501 - - - :return: The error of this ProductIncognito. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductIncognito. - - - :param error: The error of this ProductIncognito. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_ip_blocklist.py b/fingerprint_server_sdk/models/product_ip_blocklist.py deleted file mode 100644 index 2d787637..00000000 --- a/fingerprint_server_sdk/models/product_ip_blocklist.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.ip_blocklist import IPBlocklist -from fingerprint_server_sdk.models.error import Error - - -class ProductIPBlocklist(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'IPBlocklist', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductIPBlocklist - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[IPBlocklist]: - """Gets the data of this ProductIPBlocklist. # noqa: E501 - - - :return: The data of this ProductIPBlocklist. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[IPBlocklist]): - """Sets the data of this ProductIPBlocklist. - - - :param data: The data of this ProductIPBlocklist. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductIPBlocklist. # noqa: E501 - - - :return: The error of this ProductIPBlocklist. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductIPBlocklist. - - - :param error: The error of this ProductIPBlocklist. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_ip_info.py b/fingerprint_server_sdk/models/product_ip_info.py deleted file mode 100644 index 3745ecdb..00000000 --- a/fingerprint_server_sdk/models/product_ip_info.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.ip_info import IPInfo -from fingerprint_server_sdk.models.error import Error - - -class ProductIPInfo(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'IPInfo', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductIPInfo - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[IPInfo]: - """Gets the data of this ProductIPInfo. # noqa: E501 - - - :return: The data of this ProductIPInfo. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[IPInfo]): - """Sets the data of this ProductIPInfo. - - - :param data: The data of this ProductIPInfo. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductIPInfo. # noqa: E501 - - - :return: The error of this ProductIPInfo. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductIPInfo. - - - :param error: The error of this ProductIPInfo. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_jailbroken.py b/fingerprint_server_sdk/models/product_jailbroken.py deleted file mode 100644 index c1e78479..00000000 --- a/fingerprint_server_sdk/models/product_jailbroken.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.jailbroken import Jailbroken -from fingerprint_server_sdk.models.error import Error - - -class ProductJailbroken(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'Jailbroken', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductJailbroken - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[Jailbroken]: - """Gets the data of this ProductJailbroken. # noqa: E501 - - - :return: The data of this ProductJailbroken. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[Jailbroken]): - """Sets the data of this ProductJailbroken. - - - :param data: The data of this ProductJailbroken. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductJailbroken. # noqa: E501 - - - :return: The error of this ProductJailbroken. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductJailbroken. - - - :param error: The error of this ProductJailbroken. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_location_spoofing.py b/fingerprint_server_sdk/models/product_location_spoofing.py deleted file mode 100644 index 994bff1b..00000000 --- a/fingerprint_server_sdk/models/product_location_spoofing.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.location_spoofing import LocationSpoofing -from fingerprint_server_sdk.models.error import Error - - -class ProductLocationSpoofing(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'LocationSpoofing', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductLocationSpoofing - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[LocationSpoofing]: - """Gets the data of this ProductLocationSpoofing. # noqa: E501 - - - :return: The data of this ProductLocationSpoofing. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[LocationSpoofing]): - """Sets the data of this ProductLocationSpoofing. - - - :param data: The data of this ProductLocationSpoofing. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductLocationSpoofing. # noqa: E501 - - - :return: The error of this ProductLocationSpoofing. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductLocationSpoofing. - - - :param error: The error of this ProductLocationSpoofing. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_mit_m_attack.py b/fingerprint_server_sdk/models/product_mit_m_attack.py deleted file mode 100644 index f6eaac71..00000000 --- a/fingerprint_server_sdk/models/product_mit_m_attack.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.mit_m_attack import MitMAttack -from fingerprint_server_sdk.models.error import Error - - -class ProductMitMAttack(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'MitMAttack', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductMitMAttack - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[MitMAttack]: - """Gets the data of this ProductMitMAttack. # noqa: E501 - - - :return: The data of this ProductMitMAttack. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[MitMAttack]): - """Sets the data of this ProductMitMAttack. - - - :param data: The data of this ProductMitMAttack. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductMitMAttack. # noqa: E501 - - - :return: The error of this ProductMitMAttack. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductMitMAttack. - - - :param error: The error of this ProductMitMAttack. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_privacy_settings.py b/fingerprint_server_sdk/models/product_privacy_settings.py deleted file mode 100644 index 1e7aef2c..00000000 --- a/fingerprint_server_sdk/models/product_privacy_settings.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.privacy_settings import PrivacySettings -from fingerprint_server_sdk.models.error import Error - - -class ProductPrivacySettings(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'PrivacySettings', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductPrivacySettings - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[PrivacySettings]: - """Gets the data of this ProductPrivacySettings. # noqa: E501 - - - :return: The data of this ProductPrivacySettings. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[PrivacySettings]): - """Sets the data of this ProductPrivacySettings. - - - :param data: The data of this ProductPrivacySettings. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductPrivacySettings. # noqa: E501 - - - :return: The error of this ProductPrivacySettings. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductPrivacySettings. - - - :param error: The error of this ProductPrivacySettings. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_proximity.py b/fingerprint_server_sdk/models/product_proximity.py deleted file mode 100644 index c29f446c..00000000 --- a/fingerprint_server_sdk/models/product_proximity.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.proximity import Proximity -from fingerprint_server_sdk.models.error import Error - - -class ProductProximity(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'Proximity', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductProximity - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[Proximity]: - """Gets the data of this ProductProximity. # noqa: E501 - - - :return: The data of this ProductProximity. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[Proximity]): - """Sets the data of this ProductProximity. - - - :param data: The data of this ProductProximity. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductProximity. # noqa: E501 - - - :return: The error of this ProductProximity. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductProximity. - - - :param error: The error of this ProductProximity. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_proxy.py b/fingerprint_server_sdk/models/product_proxy.py deleted file mode 100644 index b305f505..00000000 --- a/fingerprint_server_sdk/models/product_proxy.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.proxy import Proxy -from fingerprint_server_sdk.models.error import Error - - -class ProductProxy(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'Proxy', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductProxy - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[Proxy]: - """Gets the data of this ProductProxy. # noqa: E501 - - - :return: The data of this ProductProxy. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[Proxy]): - """Sets the data of this ProductProxy. - - - :param data: The data of this ProductProxy. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductProxy. # noqa: E501 - - - :return: The error of this ProductProxy. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductProxy. - - - :param error: The error of this ProductProxy. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_raw_device_attributes.py b/fingerprint_server_sdk/models/product_raw_device_attributes.py deleted file mode 100644 index c081a3fb..00000000 --- a/fingerprint_server_sdk/models/product_raw_device_attributes.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.raw_device_attributes import RawDeviceAttributes -from fingerprint_server_sdk.models.error import Error - - -class ProductRawDeviceAttributes(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'RawDeviceAttributes', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductRawDeviceAttributes - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[RawDeviceAttributes]: - """Gets the data of this ProductRawDeviceAttributes. # noqa: E501 - - - :return: The data of this ProductRawDeviceAttributes. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[RawDeviceAttributes]): - """Sets the data of this ProductRawDeviceAttributes. - - - :param data: The data of this ProductRawDeviceAttributes. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductRawDeviceAttributes. # noqa: E501 - - - :return: The error of this ProductRawDeviceAttributes. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductRawDeviceAttributes. - - - :param error: The error of this ProductRawDeviceAttributes. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_remote_control.py b/fingerprint_server_sdk/models/product_remote_control.py deleted file mode 100644 index c11019f5..00000000 --- a/fingerprint_server_sdk/models/product_remote_control.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.remote_control import RemoteControl -from fingerprint_server_sdk.models.error import Error -from typing_extensions import deprecated - - -@deprecated("This class is deprecated. Please avoid using it in new code.") -class ProductRemoteControl(BaseModel): - """ - This product is deprecated. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'RemoteControl', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductRemoteControl - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[RemoteControl]: - """Gets the data of this ProductRemoteControl. # noqa: E501 - - - :return: The data of this ProductRemoteControl. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[RemoteControl]): - """Sets the data of this ProductRemoteControl. - - - :param data: The data of this ProductRemoteControl. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductRemoteControl. # noqa: E501 - - - :return: The error of this ProductRemoteControl. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductRemoteControl. - - - :param error: The error of this ProductRemoteControl. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_root_apps.py b/fingerprint_server_sdk/models/product_root_apps.py deleted file mode 100644 index ee2da749..00000000 --- a/fingerprint_server_sdk/models/product_root_apps.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.root_apps import RootApps -from fingerprint_server_sdk.models.error import Error - - -class ProductRootApps(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'RootApps', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductRootApps - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[RootApps]: - """Gets the data of this ProductRootApps. # noqa: E501 - - - :return: The data of this ProductRootApps. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[RootApps]): - """Sets the data of this ProductRootApps. - - - :param data: The data of this ProductRootApps. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductRootApps. # noqa: E501 - - - :return: The error of this ProductRootApps. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductRootApps. - - - :param error: The error of this ProductRootApps. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_suspect_score.py b/fingerprint_server_sdk/models/product_suspect_score.py deleted file mode 100644 index 88dfcbf4..00000000 --- a/fingerprint_server_sdk/models/product_suspect_score.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.suspect_score import SuspectScore -from fingerprint_server_sdk.models.error import Error - - -class ProductSuspectScore(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'SuspectScore', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductSuspectScore - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[SuspectScore]: - """Gets the data of this ProductSuspectScore. # noqa: E501 - - - :return: The data of this ProductSuspectScore. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[SuspectScore]): - """Sets the data of this ProductSuspectScore. - - - :param data: The data of this ProductSuspectScore. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductSuspectScore. # noqa: E501 - - - :return: The error of this ProductSuspectScore. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductSuspectScore. - - - :param error: The error of this ProductSuspectScore. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_tampering.py b/fingerprint_server_sdk/models/product_tampering.py deleted file mode 100644 index 059fb64a..00000000 --- a/fingerprint_server_sdk/models/product_tampering.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.tampering import Tampering -from fingerprint_server_sdk.models.error import Error - - -class ProductTampering(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'Tampering', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductTampering - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[Tampering]: - """Gets the data of this ProductTampering. # noqa: E501 - - - :return: The data of this ProductTampering. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[Tampering]): - """Sets the data of this ProductTampering. - - - :param data: The data of this ProductTampering. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductTampering. # noqa: E501 - - - :return: The error of this ProductTampering. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductTampering. - - - :param error: The error of this ProductTampering. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_tor.py b/fingerprint_server_sdk/models/product_tor.py deleted file mode 100644 index e4cf0386..00000000 --- a/fingerprint_server_sdk/models/product_tor.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.tor import Tor -from fingerprint_server_sdk.models.error import Error - - -class ProductTor(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'Tor', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductTor - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[Tor]: - """Gets the data of this ProductTor. # noqa: E501 - - - :return: The data of this ProductTor. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[Tor]): - """Sets the data of this ProductTor. - - - :param data: The data of this ProductTor. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductTor. # noqa: E501 - - - :return: The error of this ProductTor. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductTor. - - - :param error: The error of this ProductTor. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_velocity.py b/fingerprint_server_sdk/models/product_velocity.py deleted file mode 100644 index 1a4c6ee6..00000000 --- a/fingerprint_server_sdk/models/product_velocity.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.velocity import Velocity -from fingerprint_server_sdk.models.error import Error - - -class ProductVelocity(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'Velocity', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductVelocity - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[Velocity]: - """Gets the data of this ProductVelocity. # noqa: E501 - - - :return: The data of this ProductVelocity. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[Velocity]): - """Sets the data of this ProductVelocity. - - - :param data: The data of this ProductVelocity. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductVelocity. # noqa: E501 - - - :return: The error of this ProductVelocity. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductVelocity. - - - :param error: The error of this ProductVelocity. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_virtual_machine.py b/fingerprint_server_sdk/models/product_virtual_machine.py deleted file mode 100644 index d58a1e62..00000000 --- a/fingerprint_server_sdk/models/product_virtual_machine.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.virtual_machine import VirtualMachine -from fingerprint_server_sdk.models.error import Error - - -class ProductVirtualMachine(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'VirtualMachine', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductVirtualMachine - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[VirtualMachine]: - """Gets the data of this ProductVirtualMachine. # noqa: E501 - - - :return: The data of this ProductVirtualMachine. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[VirtualMachine]): - """Sets the data of this ProductVirtualMachine. - - - :param data: The data of this ProductVirtualMachine. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductVirtualMachine. # noqa: E501 - - - :return: The error of this ProductVirtualMachine. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductVirtualMachine. - - - :param error: The error of this ProductVirtualMachine. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/product_vpn.py b/fingerprint_server_sdk/models/product_vpn.py deleted file mode 100644 index 20ea3fba..00000000 --- a/fingerprint_server_sdk/models/product_vpn.py +++ /dev/null @@ -1,94 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.vpn import VPN -from fingerprint_server_sdk.models.error import Error - - -class ProductVPN(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'data': 'VPN', - 'error': 'Error' - } - - nullable_map = { - 'data': False, - 'error': False - } - - attribute_map = { - 'data': 'data', - 'error': 'error' - } - - def __init__(self, data=None, error=None): # noqa: E501 - """ProductVPN - a model defined in Swagger""" # noqa: E501 - self._data = None - self._error = None - self.discriminator = None - if data is not None: - self.data = data - if error is not None: - self.error = error - - @property - def data(self) -> Optional[VPN]: - """Gets the data of this ProductVPN. # noqa: E501 - - - :return: The data of this ProductVPN. # noqa: E501 - """ - return self._data - - @data.setter - def data(self, data: Optional[VPN]): - """Sets the data of this ProductVPN. - - - :param data: The data of this ProductVPN. # noqa: E501 - """ - - self._data = data - - @property - def error(self) -> Optional[Error]: - """Gets the error of this ProductVPN. # noqa: E501 - - - :return: The error of this ProductVPN. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[Error]): - """Sets the error of this ProductVPN. - - - :param error: The error of this ProductVPN. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/products.py b/fingerprint_server_sdk/models/products.py deleted file mode 100644 index c94c8b46..00000000 --- a/fingerprint_server_sdk/models/products.py +++ /dev/null @@ -1,721 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.product_identification import ProductIdentification -from fingerprint_server_sdk.models.product_botd import ProductBotd -from fingerprint_server_sdk.models.product_root_apps import ProductRootApps -from fingerprint_server_sdk.models.product_emulator import ProductEmulator -from fingerprint_server_sdk.models.product_ip_info import ProductIPInfo -from fingerprint_server_sdk.models.product_ip_blocklist import ProductIPBlocklist -from fingerprint_server_sdk.models.product_tor import ProductTor -from fingerprint_server_sdk.models.product_vpn import ProductVPN -from fingerprint_server_sdk.models.product_proxy import ProductProxy -from fingerprint_server_sdk.models.product_incognito import ProductIncognito -from fingerprint_server_sdk.models.product_tampering import ProductTampering -from fingerprint_server_sdk.models.product_cloned_app import ProductClonedApp -from fingerprint_server_sdk.models.product_factory_reset import ProductFactoryReset -from fingerprint_server_sdk.models.product_jailbroken import ProductJailbroken -from fingerprint_server_sdk.models.product_frida import ProductFrida -from fingerprint_server_sdk.models.product_privacy_settings import ProductPrivacySettings -from fingerprint_server_sdk.models.product_virtual_machine import ProductVirtualMachine -from fingerprint_server_sdk.models.product_raw_device_attributes import ProductRawDeviceAttributes -from fingerprint_server_sdk.models.product_high_activity import ProductHighActivity -from fingerprint_server_sdk.models.product_location_spoofing import ProductLocationSpoofing -from fingerprint_server_sdk.models.product_suspect_score import ProductSuspectScore -from fingerprint_server_sdk.models.product_remote_control import ProductRemoteControl -from fingerprint_server_sdk.models.product_velocity import ProductVelocity -from fingerprint_server_sdk.models.product_developer_tools import ProductDeveloperTools -from fingerprint_server_sdk.models.product_mit_m_attack import ProductMitMAttack -from fingerprint_server_sdk.models.product_proximity import ProductProximity - - -class Products(BaseModel): - """ - Contains all information about the request identified by `requestId`, depending on the pricing plan (Pro, Pro Plus, Enterprise) - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'identification': 'ProductIdentification', - 'botd': 'ProductBotd', - 'root_apps': 'ProductRootApps', - 'emulator': 'ProductEmulator', - 'ip_info': 'ProductIPInfo', - 'ip_blocklist': 'ProductIPBlocklist', - 'tor': 'ProductTor', - 'vpn': 'ProductVPN', - 'proxy': 'ProductProxy', - 'incognito': 'ProductIncognito', - 'tampering': 'ProductTampering', - 'cloned_app': 'ProductClonedApp', - 'factory_reset': 'ProductFactoryReset', - 'jailbroken': 'ProductJailbroken', - 'frida': 'ProductFrida', - 'privacy_settings': 'ProductPrivacySettings', - 'virtual_machine': 'ProductVirtualMachine', - 'raw_device_attributes': 'ProductRawDeviceAttributes', - 'high_activity': 'ProductHighActivity', - 'location_spoofing': 'ProductLocationSpoofing', - 'suspect_score': 'ProductSuspectScore', - 'remote_control': 'ProductRemoteControl', - 'velocity': 'ProductVelocity', - 'developer_tools': 'ProductDeveloperTools', - 'mitm_attack': 'ProductMitMAttack', - 'proximity': 'ProductProximity' - } - - nullable_map = { - 'identification': False, - 'botd': False, - 'root_apps': False, - 'emulator': False, - 'ip_info': False, - 'ip_blocklist': False, - 'tor': False, - 'vpn': False, - 'proxy': False, - 'incognito': False, - 'tampering': False, - 'cloned_app': False, - 'factory_reset': False, - 'jailbroken': False, - 'frida': False, - 'privacy_settings': False, - 'virtual_machine': False, - 'raw_device_attributes': False, - 'high_activity': False, - 'location_spoofing': False, - 'suspect_score': False, - 'remote_control': False, - 'velocity': False, - 'developer_tools': False, - 'mitm_attack': False, - 'proximity': False - } - - attribute_map = { - 'identification': 'identification', - 'botd': 'botd', - 'root_apps': 'rootApps', - 'emulator': 'emulator', - 'ip_info': 'ipInfo', - 'ip_blocklist': 'ipBlocklist', - 'tor': 'tor', - 'vpn': 'vpn', - 'proxy': 'proxy', - 'incognito': 'incognito', - 'tampering': 'tampering', - 'cloned_app': 'clonedApp', - 'factory_reset': 'factoryReset', - 'jailbroken': 'jailbroken', - 'frida': 'frida', - 'privacy_settings': 'privacySettings', - 'virtual_machine': 'virtualMachine', - 'raw_device_attributes': 'rawDeviceAttributes', - 'high_activity': 'highActivity', - 'location_spoofing': 'locationSpoofing', - 'suspect_score': 'suspectScore', - 'remote_control': 'remoteControl', - 'velocity': 'velocity', - 'developer_tools': 'developerTools', - 'mitm_attack': 'mitmAttack', - 'proximity': 'proximity' - } - - def __init__(self, identification=None, botd=None, root_apps=None, emulator=None, ip_info=None, ip_blocklist=None, tor=None, vpn=None, proxy=None, incognito=None, tampering=None, cloned_app=None, factory_reset=None, jailbroken=None, frida=None, privacy_settings=None, virtual_machine=None, raw_device_attributes=None, high_activity=None, location_spoofing=None, suspect_score=None, remote_control=None, velocity=None, developer_tools=None, mitm_attack=None, proximity=None): # noqa: E501 - """Products - a model defined in Swagger""" # noqa: E501 - self._identification = None - self._botd = None - self._root_apps = None - self._emulator = None - self._ip_info = None - self._ip_blocklist = None - self._tor = None - self._vpn = None - self._proxy = None - self._incognito = None - self._tampering = None - self._cloned_app = None - self._factory_reset = None - self._jailbroken = None - self._frida = None - self._privacy_settings = None - self._virtual_machine = None - self._raw_device_attributes = None - self._high_activity = None - self._location_spoofing = None - self._suspect_score = None - self._remote_control = None - self._velocity = None - self._developer_tools = None - self._mitm_attack = None - self._proximity = None - self.discriminator = None - if identification is not None: - self.identification = identification - if botd is not None: - self.botd = botd - if root_apps is not None: - self.root_apps = root_apps - if emulator is not None: - self.emulator = emulator - if ip_info is not None: - self.ip_info = ip_info - if ip_blocklist is not None: - self.ip_blocklist = ip_blocklist - if tor is not None: - self.tor = tor - if vpn is not None: - self.vpn = vpn - if proxy is not None: - self.proxy = proxy - if incognito is not None: - self.incognito = incognito - if tampering is not None: - self.tampering = tampering - if cloned_app is not None: - self.cloned_app = cloned_app - if factory_reset is not None: - self.factory_reset = factory_reset - if jailbroken is not None: - self.jailbroken = jailbroken - if frida is not None: - self.frida = frida - if privacy_settings is not None: - self.privacy_settings = privacy_settings - if virtual_machine is not None: - self.virtual_machine = virtual_machine - if raw_device_attributes is not None: - self.raw_device_attributes = raw_device_attributes - if high_activity is not None: - self.high_activity = high_activity - if location_spoofing is not None: - self.location_spoofing = location_spoofing - if suspect_score is not None: - self.suspect_score = suspect_score - if remote_control is not None: - self.remote_control = remote_control - if velocity is not None: - self.velocity = velocity - if developer_tools is not None: - self.developer_tools = developer_tools - if mitm_attack is not None: - self.mitm_attack = mitm_attack - if proximity is not None: - self.proximity = proximity - - @property - def identification(self) -> Optional[ProductIdentification]: - """Gets the identification of this Products. # noqa: E501 - - - :return: The identification of this Products. # noqa: E501 - """ - return self._identification - - @identification.setter - def identification(self, identification: Optional[ProductIdentification]): - """Sets the identification of this Products. - - - :param identification: The identification of this Products. # noqa: E501 - """ - - self._identification = identification - - @property - def botd(self) -> Optional[ProductBotd]: - """Gets the botd of this Products. # noqa: E501 - - - :return: The botd of this Products. # noqa: E501 - """ - return self._botd - - @botd.setter - def botd(self, botd: Optional[ProductBotd]): - """Sets the botd of this Products. - - - :param botd: The botd of this Products. # noqa: E501 - """ - - self._botd = botd - - @property - def root_apps(self) -> Optional[ProductRootApps]: - """Gets the root_apps of this Products. # noqa: E501 - - - :return: The root_apps of this Products. # noqa: E501 - """ - return self._root_apps - - @root_apps.setter - def root_apps(self, root_apps: Optional[ProductRootApps]): - """Sets the root_apps of this Products. - - - :param root_apps: The root_apps of this Products. # noqa: E501 - """ - - self._root_apps = root_apps - - @property - def emulator(self) -> Optional[ProductEmulator]: - """Gets the emulator of this Products. # noqa: E501 - - - :return: The emulator of this Products. # noqa: E501 - """ - return self._emulator - - @emulator.setter - def emulator(self, emulator: Optional[ProductEmulator]): - """Sets the emulator of this Products. - - - :param emulator: The emulator of this Products. # noqa: E501 - """ - - self._emulator = emulator - - @property - def ip_info(self) -> Optional[ProductIPInfo]: - """Gets the ip_info of this Products. # noqa: E501 - - - :return: The ip_info of this Products. # noqa: E501 - """ - return self._ip_info - - @ip_info.setter - def ip_info(self, ip_info: Optional[ProductIPInfo]): - """Sets the ip_info of this Products. - - - :param ip_info: The ip_info of this Products. # noqa: E501 - """ - - self._ip_info = ip_info - - @property - def ip_blocklist(self) -> Optional[ProductIPBlocklist]: - """Gets the ip_blocklist of this Products. # noqa: E501 - - - :return: The ip_blocklist of this Products. # noqa: E501 - """ - return self._ip_blocklist - - @ip_blocklist.setter - def ip_blocklist(self, ip_blocklist: Optional[ProductIPBlocklist]): - """Sets the ip_blocklist of this Products. - - - :param ip_blocklist: The ip_blocklist of this Products. # noqa: E501 - """ - - self._ip_blocklist = ip_blocklist - - @property - def tor(self) -> Optional[ProductTor]: - """Gets the tor of this Products. # noqa: E501 - - - :return: The tor of this Products. # noqa: E501 - """ - return self._tor - - @tor.setter - def tor(self, tor: Optional[ProductTor]): - """Sets the tor of this Products. - - - :param tor: The tor of this Products. # noqa: E501 - """ - - self._tor = tor - - @property - def vpn(self) -> Optional[ProductVPN]: - """Gets the vpn of this Products. # noqa: E501 - - - :return: The vpn of this Products. # noqa: E501 - """ - return self._vpn - - @vpn.setter - def vpn(self, vpn: Optional[ProductVPN]): - """Sets the vpn of this Products. - - - :param vpn: The vpn of this Products. # noqa: E501 - """ - - self._vpn = vpn - - @property - def proxy(self) -> Optional[ProductProxy]: - """Gets the proxy of this Products. # noqa: E501 - - - :return: The proxy of this Products. # noqa: E501 - """ - return self._proxy - - @proxy.setter - def proxy(self, proxy: Optional[ProductProxy]): - """Sets the proxy of this Products. - - - :param proxy: The proxy of this Products. # noqa: E501 - """ - - self._proxy = proxy - - @property - def incognito(self) -> Optional[ProductIncognito]: - """Gets the incognito of this Products. # noqa: E501 - - - :return: The incognito of this Products. # noqa: E501 - """ - return self._incognito - - @incognito.setter - def incognito(self, incognito: Optional[ProductIncognito]): - """Sets the incognito of this Products. - - - :param incognito: The incognito of this Products. # noqa: E501 - """ - - self._incognito = incognito - - @property - def tampering(self) -> Optional[ProductTampering]: - """Gets the tampering of this Products. # noqa: E501 - - - :return: The tampering of this Products. # noqa: E501 - """ - return self._tampering - - @tampering.setter - def tampering(self, tampering: Optional[ProductTampering]): - """Sets the tampering of this Products. - - - :param tampering: The tampering of this Products. # noqa: E501 - """ - - self._tampering = tampering - - @property - def cloned_app(self) -> Optional[ProductClonedApp]: - """Gets the cloned_app of this Products. # noqa: E501 - - - :return: The cloned_app of this Products. # noqa: E501 - """ - return self._cloned_app - - @cloned_app.setter - def cloned_app(self, cloned_app: Optional[ProductClonedApp]): - """Sets the cloned_app of this Products. - - - :param cloned_app: The cloned_app of this Products. # noqa: E501 - """ - - self._cloned_app = cloned_app - - @property - def factory_reset(self) -> Optional[ProductFactoryReset]: - """Gets the factory_reset of this Products. # noqa: E501 - - - :return: The factory_reset of this Products. # noqa: E501 - """ - return self._factory_reset - - @factory_reset.setter - def factory_reset(self, factory_reset: Optional[ProductFactoryReset]): - """Sets the factory_reset of this Products. - - - :param factory_reset: The factory_reset of this Products. # noqa: E501 - """ - - self._factory_reset = factory_reset - - @property - def jailbroken(self) -> Optional[ProductJailbroken]: - """Gets the jailbroken of this Products. # noqa: E501 - - - :return: The jailbroken of this Products. # noqa: E501 - """ - return self._jailbroken - - @jailbroken.setter - def jailbroken(self, jailbroken: Optional[ProductJailbroken]): - """Sets the jailbroken of this Products. - - - :param jailbroken: The jailbroken of this Products. # noqa: E501 - """ - - self._jailbroken = jailbroken - - @property - def frida(self) -> Optional[ProductFrida]: - """Gets the frida of this Products. # noqa: E501 - - - :return: The frida of this Products. # noqa: E501 - """ - return self._frida - - @frida.setter - def frida(self, frida: Optional[ProductFrida]): - """Sets the frida of this Products. - - - :param frida: The frida of this Products. # noqa: E501 - """ - - self._frida = frida - - @property - def privacy_settings(self) -> Optional[ProductPrivacySettings]: - """Gets the privacy_settings of this Products. # noqa: E501 - - - :return: The privacy_settings of this Products. # noqa: E501 - """ - return self._privacy_settings - - @privacy_settings.setter - def privacy_settings(self, privacy_settings: Optional[ProductPrivacySettings]): - """Sets the privacy_settings of this Products. - - - :param privacy_settings: The privacy_settings of this Products. # noqa: E501 - """ - - self._privacy_settings = privacy_settings - - @property - def virtual_machine(self) -> Optional[ProductVirtualMachine]: - """Gets the virtual_machine of this Products. # noqa: E501 - - - :return: The virtual_machine of this Products. # noqa: E501 - """ - return self._virtual_machine - - @virtual_machine.setter - def virtual_machine(self, virtual_machine: Optional[ProductVirtualMachine]): - """Sets the virtual_machine of this Products. - - - :param virtual_machine: The virtual_machine of this Products. # noqa: E501 - """ - - self._virtual_machine = virtual_machine - - @property - def raw_device_attributes(self) -> Optional[ProductRawDeviceAttributes]: - """Gets the raw_device_attributes of this Products. # noqa: E501 - - - :return: The raw_device_attributes of this Products. # noqa: E501 - """ - return self._raw_device_attributes - - @raw_device_attributes.setter - def raw_device_attributes(self, raw_device_attributes: Optional[ProductRawDeviceAttributes]): - """Sets the raw_device_attributes of this Products. - - - :param raw_device_attributes: The raw_device_attributes of this Products. # noqa: E501 - """ - - self._raw_device_attributes = raw_device_attributes - - @property - def high_activity(self) -> Optional[ProductHighActivity]: - """Gets the high_activity of this Products. # noqa: E501 - - - :return: The high_activity of this Products. # noqa: E501 - """ - return self._high_activity - - @high_activity.setter - def high_activity(self, high_activity: Optional[ProductHighActivity]): - """Sets the high_activity of this Products. - - - :param high_activity: The high_activity of this Products. # noqa: E501 - """ - - self._high_activity = high_activity - - @property - def location_spoofing(self) -> Optional[ProductLocationSpoofing]: - """Gets the location_spoofing of this Products. # noqa: E501 - - - :return: The location_spoofing of this Products. # noqa: E501 - """ - return self._location_spoofing - - @location_spoofing.setter - def location_spoofing(self, location_spoofing: Optional[ProductLocationSpoofing]): - """Sets the location_spoofing of this Products. - - - :param location_spoofing: The location_spoofing of this Products. # noqa: E501 - """ - - self._location_spoofing = location_spoofing - - @property - def suspect_score(self) -> Optional[ProductSuspectScore]: - """Gets the suspect_score of this Products. # noqa: E501 - - - :return: The suspect_score of this Products. # noqa: E501 - """ - return self._suspect_score - - @suspect_score.setter - def suspect_score(self, suspect_score: Optional[ProductSuspectScore]): - """Sets the suspect_score of this Products. - - - :param suspect_score: The suspect_score of this Products. # noqa: E501 - """ - - self._suspect_score = suspect_score - - @property - def remote_control(self) -> Optional[ProductRemoteControl]: - """Gets the remote_control of this Products. # noqa: E501 - - - :return: The remote_control of this Products. # noqa: E501 - """ - return self._remote_control - - @remote_control.setter - def remote_control(self, remote_control: Optional[ProductRemoteControl]): - """Sets the remote_control of this Products. - - - :param remote_control: The remote_control of this Products. # noqa: E501 - """ - - self._remote_control = remote_control - - @property - def velocity(self) -> Optional[ProductVelocity]: - """Gets the velocity of this Products. # noqa: E501 - - - :return: The velocity of this Products. # noqa: E501 - """ - return self._velocity - - @velocity.setter - def velocity(self, velocity: Optional[ProductVelocity]): - """Sets the velocity of this Products. - - - :param velocity: The velocity of this Products. # noqa: E501 - """ - - self._velocity = velocity - - @property - def developer_tools(self) -> Optional[ProductDeveloperTools]: - """Gets the developer_tools of this Products. # noqa: E501 - - - :return: The developer_tools of this Products. # noqa: E501 - """ - return self._developer_tools - - @developer_tools.setter - def developer_tools(self, developer_tools: Optional[ProductDeveloperTools]): - """Sets the developer_tools of this Products. - - - :param developer_tools: The developer_tools of this Products. # noqa: E501 - """ - - self._developer_tools = developer_tools - - @property - def mitm_attack(self) -> Optional[ProductMitMAttack]: - """Gets the mitm_attack of this Products. # noqa: E501 - - - :return: The mitm_attack of this Products. # noqa: E501 - """ - return self._mitm_attack - - @mitm_attack.setter - def mitm_attack(self, mitm_attack: Optional[ProductMitMAttack]): - """Sets the mitm_attack of this Products. - - - :param mitm_attack: The mitm_attack of this Products. # noqa: E501 - """ - - self._mitm_attack = mitm_attack - - @property - def proximity(self) -> Optional[ProductProximity]: - """Gets the proximity of this Products. # noqa: E501 - - - :return: The proximity of this Products. # noqa: E501 - """ - return self._proximity - - @proximity.setter - def proximity(self, proximity: Optional[ProductProximity]): - """Sets the proximity of this Products. - - - :param proximity: The proximity of this Products. # noqa: E501 - """ - - self._proximity = proximity - diff --git a/fingerprint_server_sdk/models/proximity.py b/fingerprint_server_sdk/models/proximity.py index 5e8cf299..0a1948dc 100644 --- a/fingerprint_server_sdk/models/proximity.py +++ b/fingerprint_server_sdk/models/proximity.py @@ -1,135 +1,100 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations +import pprint import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel +import json +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class Proximity(BaseModel): """ Proximity ID represents a fixed geographical zone in a discrete global grid within which the device is observed. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'str', - 'precision_radius': 'int', - 'confidence': 'float' - } - - nullable_map = { - 'id': False, - 'precision_radius': False, - 'confidence': False - } - - attribute_map = { - 'id': 'id', - 'precision_radius': 'precisionRadius', - 'confidence': 'confidence' - } - - def __init__(self, id=None, precision_radius=None, confidence=None): # noqa: E501 - """Proximity - a model defined in Swagger""" # noqa: E501 - self._id = None - self._precision_radius = None - self._confidence = None - self.discriminator = None - self.id = id - self.precision_radius = precision_radius - self.confidence = confidence - - @property - def id(self) -> str: - """Gets the id of this Proximity. # noqa: E501 - - A stable privacy-preserving identifier for a given proximity zone. # noqa: E501 - - :return: The id of this Proximity. # noqa: E501 - """ - return self._id - - @id.setter - def id(self, id: str): - """Sets the id of this Proximity. - - A stable privacy-preserving identifier for a given proximity zone. # noqa: E501 - - :param id: The id of this Proximity. # noqa: E501 - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def precision_radius(self) -> int: - """Gets the precision_radius of this Proximity. # noqa: E501 - - The radius of the proximity zone’s precision level, in meters. # noqa: E501 - - :return: The precision_radius of this Proximity. # noqa: E501 - """ - return self._precision_radius - - @precision_radius.setter - def precision_radius(self, precision_radius: int): - """Sets the precision_radius of this Proximity. - - The radius of the proximity zone’s precision level, in meters. # noqa: E501 - - :param precision_radius: The precision_radius of this Proximity. # noqa: E501 - """ - if precision_radius is None: - raise ValueError("Invalid value for `precision_radius`, must not be `None`") # noqa: E501 - allowed_values = [10, 25, 65, 175, 450, 1200, 3300, 8500, 22500] # noqa: E501 - if (precision_radius not in allowed_values): - raise ValueError( - "Invalid value for `precision_radius` ({0}), must be one of {1}" # noqa: E501 - .format(precision_radius, allowed_values) - ) - - self._precision_radius = precision_radius - - @property - def confidence(self) -> float: - """Gets the confidence of this Proximity. # noqa: E501 - - A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. # noqa: E501 - - :return: The confidence of this Proximity. # noqa: E501 - """ - return self._confidence - - @confidence.setter - def confidence(self, confidence: float): - """Sets the confidence of this Proximity. - - A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. # noqa: E501 - - :param confidence: The confidence of this Proximity. # noqa: E501 + """ # noqa: E501 + id: StrictStr = Field(description="A stable privacy-preserving identifier for a given proximity zone. ") + precision_radius: StrictInt = Field(description="The radius of the proximity zone’s precision level, in meters. ") + confidence: Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]] = Field(description="A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. ") + __properties: ClassVar[List[str]] = ["id", "precision_radius", "confidence"] + + @field_validator('precision_radius') + def precision_radius_validate_enum(cls, value): + """Validates the enum""" + if value not in set([10, 25, 65, 175, 450, 1200, 3300, 8500, 22500]): + raise ValueError("must be one of enum values (10, 25, 65, 175, 450, 1200, 3300, 8500, 22500)") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Proximity from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - if confidence is None: - raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501 + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Proximity from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "id": obj.get("id"), + "precision_radius": obj.get("precision_radius"), + "confidence": obj.get("confidence") + }) + return _obj - self._confidence = confidence diff --git a/fingerprint_server_sdk/models/proxy.py b/fingerprint_server_sdk/models/proxy.py deleted file mode 100644 index 14df0bd7..00000000 --- a/fingerprint_server_sdk/models/proxy.py +++ /dev/null @@ -1,123 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.proxy_confidence import ProxyConfidence -from fingerprint_server_sdk.models.proxy_details import ProxyDetails - - -class Proxy(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool', - 'confidence': 'ProxyConfidence', - 'details': 'ProxyDetails' - } - - nullable_map = { - 'result': False, - 'confidence': False, - 'details': False - } - - attribute_map = { - 'result': 'result', - 'confidence': 'confidence', - 'details': 'details' - } - - def __init__(self, result=None, confidence=None, details=None): # noqa: E501 - """Proxy - a model defined in Swagger""" # noqa: E501 - self._result = None - self._confidence = None - self._details = None - self.discriminator = None - self.result = result - self.confidence = confidence - if details is not None: - self.details = details - - @property - def result(self) -> bool: - """Gets the result of this Proxy. # noqa: E501 - - IP address was used by a public proxy provider or belonged to a known recent residential proxy # noqa: E501 - - :return: The result of this Proxy. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this Proxy. - - IP address was used by a public proxy provider or belonged to a known recent residential proxy # noqa: E501 - - :param result: The result of this Proxy. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - - @property - def confidence(self) -> ProxyConfidence: - """Gets the confidence of this Proxy. # noqa: E501 - - - :return: The confidence of this Proxy. # noqa: E501 - """ - return self._confidence - - @confidence.setter - def confidence(self, confidence: ProxyConfidence): - """Sets the confidence of this Proxy. - - - :param confidence: The confidence of this Proxy. # noqa: E501 - """ - if confidence is None: - raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501 - - self._confidence = confidence - - @property - def details(self) -> Optional[ProxyDetails]: - """Gets the details of this Proxy. # noqa: E501 - - - :return: The details of this Proxy. # noqa: E501 - """ - return self._details - - @details.setter - def details(self, details: Optional[ProxyDetails]): - """Sets the details of this Proxy. - - - :param details: The details of this Proxy. # noqa: E501 - """ - - self._details = details - diff --git a/fingerprint_server_sdk/models/proxy_confidence.py b/fingerprint_server_sdk/models/proxy_confidence.py index dbccc029..45d2a9c0 100644 --- a/fingerprint_server_sdk/models/proxy_confidence.py +++ b/fingerprint_server_sdk/models/proxy_confidence.py @@ -1,52 +1,39 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel + Do not edit the class manually. +""" # noqa: E501 -class ProxyConfidence(BaseModel): - """ - Confidence level of the proxy detection. If a proxy is not detected, confidence is \"high\". If it's detected, can be \"low\", \"medium\", or \"high\". +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self - NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. +class ProxyConfidence(str, Enum): + """ + Confidence level of the proxy detection. If a proxy is not detected, confidence is \"high\". If it's detected, can be \"low\", \"medium\", or \"high\". """ """ allowed enum values """ - LOW = "low" - MEDIUM = "medium" - HIGH = "high" - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - nullable_map = { - } + LOW = 'low' + MEDIUM = 'medium' + HIGH = 'high' - attribute_map = { - } + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of ProxyConfidence from a JSON string""" + return cls(json.loads(json_str)) - def __init__(self): # noqa: E501 - """ProxyConfidence - a model defined in Swagger""" # noqa: E501 - self.discriminator = None diff --git a/fingerprint_server_sdk/models/proxy_details.py b/fingerprint_server_sdk/models/proxy_details.py index abebff08..01d5f743 100644 --- a/fingerprint_server_sdk/models/proxy_details.py +++ b/fingerprint_server_sdk/models/proxy_details.py @@ -1,107 +1,99 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from datetime import datetime - - -class ProxyDetails(BaseModel): - """ - Proxy detection details (present if proxy is detected) - - NOTE: This class is auto generated by the swagger code generator program. + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'proxy_type': 'str', - 'last_seen_at': 'datetime' - } - - nullable_map = { - 'proxy_type': False, - 'last_seen_at': False - } - - attribute_map = { - 'proxy_type': 'proxyType', - 'last_seen_at': 'lastSeenAt' - } - - def __init__(self, proxy_type=None, last_seen_at=None): # noqa: E501 - """ProxyDetails - a model defined in Swagger""" # noqa: E501 - self._proxy_type = None - self._last_seen_at = None - self.discriminator = None - self.proxy_type = proxy_type - if last_seen_at is not None: - self.last_seen_at = last_seen_at - - @property - def proxy_type(self) -> str: - """Gets the proxy_type of this ProxyDetails. # noqa: E501 - - Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers # noqa: E501 - - :return: The proxy_type of this ProxyDetails. # noqa: E501 - """ - return self._proxy_type +""" # noqa: E501 - @proxy_type.setter - def proxy_type(self, proxy_type: str): - """Sets the proxy_type of this ProxyDetails. - Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers # noqa: E501 - - :param proxy_type: The proxy_type of this ProxyDetails. # noqa: E501 - """ - if proxy_type is None: - raise ValueError("Invalid value for `proxy_type`, must not be `None`") # noqa: E501 - allowed_values = ["residential", "data_center"] # noqa: E501 - if (proxy_type not in allowed_values): - raise ValueError( - "Invalid value for `proxy_type` ({0}), must be one of {1}" # noqa: E501 - .format(proxy_type, allowed_values) - ) - - self._proxy_type = proxy_type - - @property - def last_seen_at(self) -> Optional[datetime]: - """Gets the last_seen_at of this ProxyDetails. # noqa: E501 - - ISO 8601 formatted timestamp in UTC with hourly resolution of when this IP was last seen as a proxy when available. # noqa: E501 - - :return: The last_seen_at of this ProxyDetails. # noqa: E501 - """ - return self._last_seen_at - - @last_seen_at.setter - def last_seen_at(self, last_seen_at: Optional[datetime]): - """Sets the last_seen_at of this ProxyDetails. +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - ISO 8601 formatted timestamp in UTC with hourly resolution of when this IP was last seen as a proxy when available. # noqa: E501 +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self - :param last_seen_at: The last_seen_at of this ProxyDetails. # noqa: E501 +class ProxyDetails(BaseModel): + """ + Proxy detection details (present if `proxy` is `true`) + """ # noqa: E501 + proxy_type: StrictStr = Field(description="Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers ") + last_seen_at: Optional[StrictInt] = Field(default=None, description="Unix millisecond timestamp with hourly resolution of when this IP was last seen as a proxy ") + provider: Optional[StrictStr] = Field(default=None, description="String representing the last proxy service provider detected when this IP was synced. An IP can be shared by multiple service providers. ") + __properties: ClassVar[List[str]] = ["proxy_type", "last_seen_at", "provider"] + + @field_validator('proxy_type') + def proxy_type_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['residential', 'data_center']): + raise ValueError("must be one of enum values ('residential', 'data_center')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of ProxyDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of ProxyDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "proxy_type": obj.get("proxy_type"), + "last_seen_at": obj.get("last_seen_at"), + "provider": obj.get("provider") + }) + return _obj - self._last_seen_at = last_seen_at diff --git a/fingerprint_server_sdk/models/raw_device_attribute.py b/fingerprint_server_sdk/models/raw_device_attribute.py deleted file mode 100644 index 9a65dcfd..00000000 --- a/fingerprint_server_sdk/models/raw_device_attribute.py +++ /dev/null @@ -1,93 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.raw_device_attribute_error import RawDeviceAttributeError - - -class RawDeviceAttribute(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'value': 'object', - 'error': 'RawDeviceAttributeError' - } - - nullable_map = { - 'value': False, - 'error': False - } - - attribute_map = { - 'value': 'value', - 'error': 'error' - } - - def __init__(self, value=None, error=None): # noqa: E501 - """RawDeviceAttribute - a model defined in Swagger""" # noqa: E501 - self._value = None - self._error = None - self.discriminator = None - if value is not None: - self.value = value - if error is not None: - self.error = error - - @property - def value(self) -> Optional[object]: - """Gets the value of this RawDeviceAttribute. # noqa: E501 - - - :return: The value of this RawDeviceAttribute. # noqa: E501 - """ - return self._value - - @value.setter - def value(self, value: Optional[object]): - """Sets the value of this RawDeviceAttribute. - - - :param value: The value of this RawDeviceAttribute. # noqa: E501 - """ - - self._value = value - - @property - def error(self) -> Optional[RawDeviceAttributeError]: - """Gets the error of this RawDeviceAttribute. # noqa: E501 - - - :return: The error of this RawDeviceAttribute. # noqa: E501 - """ - return self._error - - @error.setter - def error(self, error: Optional[RawDeviceAttributeError]): - """Sets the error of this RawDeviceAttribute. - - - :param error: The error of this RawDeviceAttribute. # noqa: E501 - """ - - self._error = error - diff --git a/fingerprint_server_sdk/models/raw_device_attribute_error.py b/fingerprint_server_sdk/models/raw_device_attribute_error.py deleted file mode 100644 index 62d10eaf..00000000 --- a/fingerprint_server_sdk/models/raw_device_attribute_error.py +++ /dev/null @@ -1,92 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class RawDeviceAttributeError(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'name': 'str', - 'message': 'str' - } - - nullable_map = { - 'name': False, - 'message': False - } - - attribute_map = { - 'name': 'name', - 'message': 'message' - } - - def __init__(self, name=None, message=None): # noqa: E501 - """RawDeviceAttributeError - a model defined in Swagger""" # noqa: E501 - self._name = None - self._message = None - self.discriminator = None - if name is not None: - self.name = name - if message is not None: - self.message = message - - @property - def name(self) -> Optional[str]: - """Gets the name of this RawDeviceAttributeError. # noqa: E501 - - - :return: The name of this RawDeviceAttributeError. # noqa: E501 - """ - return self._name - - @name.setter - def name(self, name: Optional[str]): - """Sets the name of this RawDeviceAttributeError. - - - :param name: The name of this RawDeviceAttributeError. # noqa: E501 - """ - - self._name = name - - @property - def message(self) -> Optional[str]: - """Gets the message of this RawDeviceAttributeError. # noqa: E501 - - - :return: The message of this RawDeviceAttributeError. # noqa: E501 - """ - return self._message - - @message.setter - def message(self, message: Optional[str]): - """Sets the message of this RawDeviceAttributeError. - - - :param message: The message of this RawDeviceAttributeError. # noqa: E501 - """ - - self._message = message - diff --git a/fingerprint_server_sdk/models/raw_device_attributes.py b/fingerprint_server_sdk/models/raw_device_attributes.py index 9d1f9f52..6205eaa8 100644 --- a/fingerprint_server_sdk/models/raw_device_attributes.py +++ b/fingerprint_server_sdk/models/raw_device_attributes.py @@ -1,43 +1,169 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations +import pprint import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel +import json +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from fingerprint_server_sdk.models.canvas import Canvas +from fingerprint_server_sdk.models.emoji import Emoji +from fingerprint_server_sdk.models.font_preferences import FontPreferences +from fingerprint_server_sdk.models.plugins_inner import PluginsInner +from fingerprint_server_sdk.models.touch_support import TouchSupport +from fingerprint_server_sdk.models.web_gl_basics import WebGlBasics +from fingerprint_server_sdk.models.web_gl_extensions import WebGlExtensions +from typing import Optional, Set +from typing_extensions import Self -class RawDeviceAttributes(dict): +class RawDeviceAttributes(BaseModel): """ - It includes 35+ raw browser identification attributes to provide Fingerprint users with even more information than our standard visitor ID provides. This enables Fingerprint users to not have to run our open-source product in conjunction with Fingerprint Pro Plus and Enterprise to get those additional attributes. Warning: The raw signals data can change at any moment as we improve the product. We cannot guarantee the internal shape of raw device attributes to be stable, so typical semantic versioning rules do not apply here. Use this data with caution without assuming a specific structure beyond the generic type provided here. + A curated subset of raw browser/device attributes that the API surface exposes. Each property contains a value or object with the data for the collected signal. + """ # noqa: E501 + font_preferences: Optional[FontPreferences] = None + emoji: Optional[Emoji] = None + fonts: Optional[List[StrictStr]] = Field(default=None, description="List of fonts detected on the device.") + device_memory: Optional[Annotated[int, Field(strict=True, ge=0)]] = Field(default=None, description="Rounded amount of RAM (in gigabytes) reported by the browser.") + timezone: Optional[StrictStr] = Field(default=None, description="Timezone identifier detected on the client.") + canvas: Optional[Canvas] = None + languages: Optional[List[List[StrictStr]]] = Field(default=None, description="Navigator languages reported by the agent including fallbacks. Each inner array represents ordered language preferences reported by different APIs. ") + webgl_extensions: Optional[WebGlExtensions] = None + webgl_basics: Optional[WebGlBasics] = None + screen_resolution: Optional[Annotated[List[StrictInt], Field(min_length=2, max_length=2)]] = Field(default=None, description="Current screen resolution.") + touch_support: Optional[TouchSupport] = None + oscpu: Optional[StrictStr] = Field(default=None, description="Navigator `oscpu` string.") + architecture: Optional[StrictInt] = Field(default=None, description="Integer representing the CPU architecture exposed by the browser.") + cookies_enabled: Optional[StrictBool] = Field(default=None, description="Whether the cookies are enabled in the browser.") + hardware_concurrency: Optional[Annotated[int, Field(strict=True, ge=1)]] = Field(default=None, description="Number of logical CPU cores reported by the browser.") + date_time_locale: Optional[StrictStr] = Field(default=None, description="Locale derived from the Intl.DateTimeFormat API. Negative values indicate known error states. The negative statuses can be: - \"-1\": A permanent status for browsers that don't support Intl API. - \"-2\": A permanent status for browsers that don't supportDateTimeFormat constructor. - \"-3\": A permanent status for browsers in which DateTimeFormat locale is undefined or null. ") + vendor: Optional[StrictStr] = Field(default=None, description="Navigator vendor string.") + color_depth: Optional[StrictInt] = Field(default=None, description="Screen color depth in bits.") + platform: Optional[StrictStr] = Field(default=None, description="Navigator platform string.") + session_storage: Optional[StrictBool] = Field(default=None, description="Whether sessionStorage is available.") + local_storage: Optional[StrictBool] = Field(default=None, description="Whether localStorage is available.") + audio: Optional[Union[StrictFloat, StrictInt]] = Field(default=None, description="AudioContext fingerprint or negative status when unavailable. The negative statuses can be: - -1: A permanent status for those browsers which are known to always suspend audio context - -2: A permanent status for browsers that don't support the signal - -3: A temporary status that means that an unexpected timeout has happened ") + plugins: Optional[List[PluginsInner]] = Field(default=None, description="Browser plugins reported by `navigator.plugins`.") + indexed_db: Optional[StrictBool] = Field(default=None, description="Whether IndexedDB is available.") + math: Optional[StrictStr] = Field(default=None, description="Hash of Math APIs used for entropy collection.") + __properties: ClassVar[List[str]] = ["font_preferences", "emoji", "fonts", "device_memory", "timezone", "canvas", "languages", "webgl_extensions", "webgl_basics", "screen_resolution", "touch_support", "oscpu", "architecture", "cookies_enabled", "hardware_concurrency", "date_time_locale", "vendor", "color_depth", "platform", "session_storage", "local_storage", "audio", "plugins", "indexed_db", "math"] - NOTE: This class is auto generated by the swagger code generator program. + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - nullable_map = { - } + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RawDeviceAttributes from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of font_preferences + if self.font_preferences: + _dict['font_preferences'] = self.font_preferences.to_dict() + # override the default output from pydantic by calling `to_dict()` of emoji + if self.emoji: + _dict['emoji'] = self.emoji.to_dict() + # override the default output from pydantic by calling `to_dict()` of canvas + if self.canvas: + _dict['canvas'] = self.canvas.to_dict() + # override the default output from pydantic by calling `to_dict()` of webgl_extensions + if self.webgl_extensions: + _dict['webgl_extensions'] = self.webgl_extensions.to_dict() + # override the default output from pydantic by calling `to_dict()` of webgl_basics + if self.webgl_basics: + _dict['webgl_basics'] = self.webgl_basics.to_dict() + # override the default output from pydantic by calling `to_dict()` of touch_support + if self.touch_support: + _dict['touch_support'] = self.touch_support.to_dict() + # override the default output from pydantic by calling `to_dict()` of each item in plugins (list) + _items = [] + if self.plugins: + for _item_plugins in self.plugins: + if _item_plugins: + _items.append(_item_plugins.to_dict()) + _dict['plugins'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RawDeviceAttributes from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) - attribute_map = { - } + _obj = cls.model_validate({ + "font_preferences": FontPreferences.from_dict(obj["font_preferences"]) if obj.get("font_preferences") is not None else None, + "emoji": Emoji.from_dict(obj["emoji"]) if obj.get("emoji") is not None else None, + "fonts": obj.get("fonts"), + "device_memory": obj.get("device_memory"), + "timezone": obj.get("timezone"), + "canvas": Canvas.from_dict(obj["canvas"]) if obj.get("canvas") is not None else None, + "languages": obj.get("languages"), + "webgl_extensions": WebGlExtensions.from_dict(obj["webgl_extensions"]) if obj.get("webgl_extensions") is not None else None, + "webgl_basics": WebGlBasics.from_dict(obj["webgl_basics"]) if obj.get("webgl_basics") is not None else None, + "screen_resolution": obj.get("screen_resolution"), + "touch_support": TouchSupport.from_dict(obj["touch_support"]) if obj.get("touch_support") is not None else None, + "oscpu": obj.get("oscpu"), + "architecture": obj.get("architecture"), + "cookies_enabled": obj.get("cookies_enabled"), + "hardware_concurrency": obj.get("hardware_concurrency"), + "date_time_locale": obj.get("date_time_locale"), + "vendor": obj.get("vendor"), + "color_depth": obj.get("color_depth"), + "platform": obj.get("platform"), + "session_storage": obj.get("session_storage"), + "local_storage": obj.get("local_storage"), + "audio": obj.get("audio"), + "plugins": [PluginsInner.from_dict(_item) for _item in obj["plugins"]] if obj.get("plugins") is not None else None, + "indexed_db": obj.get("indexed_db"), + "math": obj.get("math") + }) + return _obj - __parent_class__ = 'dict' diff --git a/fingerprint_server_sdk/models/related_visitor.py b/fingerprint_server_sdk/models/related_visitor.py deleted file mode 100644 index 347f951c..00000000 --- a/fingerprint_server_sdk/models/related_visitor.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class RelatedVisitor(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'visitor_id': 'str' - } - - nullable_map = { - 'visitor_id': False - } - - attribute_map = { - 'visitor_id': 'visitorId' - } - - def __init__(self, visitor_id=None): # noqa: E501 - """RelatedVisitor - a model defined in Swagger""" # noqa: E501 - self._visitor_id = None - self.discriminator = None - self.visitor_id = visitor_id - - @property - def visitor_id(self) -> str: - """Gets the visitor_id of this RelatedVisitor. # noqa: E501 - - Visitor ID of a browser that originates from the same mobile device as the input visitor ID. # noqa: E501 - - :return: The visitor_id of this RelatedVisitor. # noqa: E501 - """ - return self._visitor_id - - @visitor_id.setter - def visitor_id(self, visitor_id: str): - """Sets the visitor_id of this RelatedVisitor. - - Visitor ID of a browser that originates from the same mobile device as the input visitor ID. # noqa: E501 - - :param visitor_id: The visitor_id of this RelatedVisitor. # noqa: E501 - """ - if visitor_id is None: - raise ValueError("Invalid value for `visitor_id`, must not be `None`") # noqa: E501 - - self._visitor_id = visitor_id - diff --git a/fingerprint_server_sdk/models/related_visitors_response.py b/fingerprint_server_sdk/models/related_visitors_response.py deleted file mode 100644 index 0640e327..00000000 --- a/fingerprint_server_sdk/models/related_visitors_response.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.related_visitor import RelatedVisitor - - -class RelatedVisitorsResponse(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'related_visitors': 'list[RelatedVisitor]' - } - - nullable_map = { - 'related_visitors': False - } - - attribute_map = { - 'related_visitors': 'relatedVisitors' - } - - def __init__(self, related_visitors=None): # noqa: E501 - """RelatedVisitorsResponse - a model defined in Swagger""" # noqa: E501 - self._related_visitors = None - self.discriminator = None - self.related_visitors = related_visitors - - @property - def related_visitors(self) -> List[RelatedVisitor]: - """Gets the related_visitors of this RelatedVisitorsResponse. # noqa: E501 - - - :return: The related_visitors of this RelatedVisitorsResponse. # noqa: E501 - """ - return self._related_visitors - - @related_visitors.setter - def related_visitors(self, related_visitors: List[RelatedVisitor]): - """Sets the related_visitors of this RelatedVisitorsResponse. - - - :param related_visitors: The related_visitors of this RelatedVisitorsResponse. # noqa: E501 - """ - if related_visitors is None: - raise ValueError("Invalid value for `related_visitors`, must not be `None`") # noqa: E501 - - self._related_visitors = related_visitors - diff --git a/fingerprint_server_sdk/models/remote_control.py b/fingerprint_server_sdk/models/remote_control.py deleted file mode 100644 index 31956187..00000000 --- a/fingerprint_server_sdk/models/remote_control.py +++ /dev/null @@ -1,75 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from typing_extensions import deprecated - - -@deprecated("This class is deprecated. Please avoid using it in new code.") -class RemoteControl(BaseModel): - """ - This signal is deprecated. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """RemoteControl - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - self.result = result - - @property - def result(self) -> bool: - """Gets the result of this RemoteControl. # noqa: E501 - - `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. # noqa: E501 - - :return: The result of this RemoteControl. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this RemoteControl. - - `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. # noqa: E501 - - :param result: The result of this RemoteControl. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - diff --git a/fingerprint_server_sdk/models/request_header_modifications.py b/fingerprint_server_sdk/models/request_header_modifications.py new file mode 100644 index 00000000..e9e98be6 --- /dev/null +++ b/fingerprint_server_sdk/models/request_header_modifications.py @@ -0,0 +1,107 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from fingerprint_server_sdk.models.rule_action_header_field import RuleActionHeaderField +from typing import Optional, Set +from typing_extensions import Self + +class RequestHeaderModifications(BaseModel): + """ + The set of header modifications to apply, in the following order: remove, set, append. + """ # noqa: E501 + remove: Optional[List[StrictStr]] = Field(default=None, description="The list of headers to remove.") + set: Optional[List[RuleActionHeaderField]] = Field(default=None, description="The list of headers to set, overwriting any existing headers with the same name.") + append: Optional[List[RuleActionHeaderField]] = Field(default=None, description="The list of headers to append.") + __properties: ClassVar[List[str]] = ["remove", "set", "append"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RequestHeaderModifications from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in set (list) + _items = [] + if self.set: + for _item_set in self.set: + if _item_set: + _items.append(_item_set.to_dict()) + _dict['set'] = _items + # override the default output from pydantic by calling `to_dict()` of each item in append (list) + _items = [] + if self.append: + for _item_append in self.append: + if _item_append: + _items.append(_item_append.to_dict()) + _dict['append'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RequestHeaderModifications from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "remove": obj.get("remove"), + "set": [RuleActionHeaderField.from_dict(_item) for _item in obj["set"]] if obj.get("set") is not None else None, + "append": [RuleActionHeaderField.from_dict(_item) for _item in obj["append"]] if obj.get("append") is not None else None + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/root_apps.py b/fingerprint_server_sdk/models/root_apps.py deleted file mode 100644 index b2ed3fb2..00000000 --- a/fingerprint_server_sdk/models/root_apps.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class RootApps(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """RootApps - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - self.result = result - - @property - def result(self) -> bool: - """Gets the result of this RootApps. # noqa: E501 - - Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. # noqa: E501 - - :return: The result of this RootApps. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this RootApps. - - Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. # noqa: E501 - - :param result: The result of this RootApps. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - diff --git a/fingerprint_server_sdk/models/rule_action_header_field.py b/fingerprint_server_sdk/models/rule_action_header_field.py new file mode 100644 index 00000000..c83cd567 --- /dev/null +++ b/fingerprint_server_sdk/models/rule_action_header_field.py @@ -0,0 +1,90 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self + +class RuleActionHeaderField(BaseModel): + """ + RuleActionHeaderField + """ # noqa: E501 + name: StrictStr = Field(description="The header field name.") + value: StrictStr = Field(description="The value of the header field.") + __properties: ClassVar[List[str]] = ["name", "value"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of RuleActionHeaderField from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of RuleActionHeaderField from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "name": obj.get("name"), + "value": obj.get("value") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/rule_action_type.py b/fingerprint_server_sdk/models/rule_action_type.py new file mode 100644 index 00000000..f8681c3a --- /dev/null +++ b/fingerprint_server_sdk/models/rule_action_type.py @@ -0,0 +1,38 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class RuleActionType(str, Enum): + """ + Describes the action to take with the request. + """ + + """ + allowed enum values + """ + ALLOW = 'allow' + BLOCK = 'block' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of RuleActionType from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/fingerprint_server_sdk/models/sdk.py b/fingerprint_server_sdk/models/sdk.py index bd3e1ced..0299ddf6 100644 --- a/fingerprint_server_sdk/models/sdk.py +++ b/fingerprint_server_sdk/models/sdk.py @@ -1,101 +1,107 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + +from __future__ import annotations +import pprint import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel +import json +from pydantic import BaseModel, ConfigDict, Field, StrictStr, field_validator +from typing import Any, ClassVar, Dict, List, Optional +from fingerprint_server_sdk.models.integration import Integration +from typing import Optional, Set +from typing_extensions import Self class SDK(BaseModel): """ Contains information about the SDK used to perform the request. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'platform': 'str', - 'version': 'str' - } - - nullable_map = { - 'platform': False, - 'version': False - } - - attribute_map = { - 'platform': 'platform', - 'version': 'version' - } - - def __init__(self, platform=None, version=None): # noqa: E501 - """SDK - a model defined in Swagger""" # noqa: E501 - self._platform = None - self._version = None - self.discriminator = None - self.platform = platform - self.version = version - - @property - def platform(self) -> str: - """Gets the platform of this SDK. # noqa: E501 - - Platform of the SDK. # noqa: E501 - - :return: The platform of this SDK. # noqa: E501 - """ - return self._platform - - @platform.setter - def platform(self, platform: str): - """Sets the platform of this SDK. - - Platform of the SDK. # noqa: E501 - - :param platform: The platform of this SDK. # noqa: E501 - """ - if platform is None: - raise ValueError("Invalid value for `platform`, must not be `None`") # noqa: E501 - - self._platform = platform - - @property - def version(self) -> str: - """Gets the version of this SDK. # noqa: E501 - - SDK version string. # noqa: E501 - - :return: The version of this SDK. # noqa: E501 - """ - return self._version - - @version.setter - def version(self, version: str): - """Sets the version of this SDK. - - SDK version string. # noqa: E501 - - :param version: The version of this SDK. # noqa: E501 + """ # noqa: E501 + platform: StrictStr = Field(description="Platform of the SDK used for the identification request.") + version: StrictStr = Field(description="Version string of the SDK used for the identification request. For example: `\"3.12.1\"` ") + integrations: Optional[List[Integration]] = None + __properties: ClassVar[List[str]] = ["platform", "version", "integrations"] + + @field_validator('platform') + def platform_validate_enum(cls, value): + """Validates the enum""" + if value not in set(['js', 'android', 'ios', 'unknown']): + raise ValueError("must be one of enum values ('js', 'android', 'ios', 'unknown')") + return value + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SDK from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - if version is None: - raise ValueError("Invalid value for `version`, must not be `None`") # noqa: E501 + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of each item in integrations (list) + _items = [] + if self.integrations: + for _item_integrations in self.integrations: + if _item_integrations: + _items.append(_item_integrations.to_dict()) + _dict['integrations'] = _items + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SDK from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "platform": obj.get("platform"), + "version": obj.get("version"), + "integrations": [Integration.from_dict(_item) for _item in obj["integrations"]] if obj.get("integrations") is not None else None + }) + return _obj - self._version = version diff --git a/fingerprint_server_sdk/models/search_events_bot.py b/fingerprint_server_sdk/models/search_events_bot.py new file mode 100644 index 00000000..15d7e1c5 --- /dev/null +++ b/fingerprint_server_sdk/models/search_events_bot.py @@ -0,0 +1,40 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SearchEventsBot(str, Enum): + """ + 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 `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. + """ + + """ + allowed enum values + """ + ALL = 'all' + GOOD = 'good' + BAD = 'bad' + NONE = 'none' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SearchEventsBot from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/fingerprint_server_sdk/models/search_events_response.py b/fingerprint_server_sdk/models/search_events_response.py deleted file mode 100644 index ae78fe50..00000000 --- a/fingerprint_server_sdk/models/search_events_response.py +++ /dev/null @@ -1,98 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.search_events_response_events import SearchEventsResponseEvents - - -class SearchEventsResponse(BaseModel): - """ - Contains a list of all identification events matching the specified search criteria. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'events': 'list[SearchEventsResponseEvents]', - 'pagination_key': 'str' - } - - nullable_map = { - 'events': False, - 'pagination_key': False - } - - attribute_map = { - 'events': 'events', - 'pagination_key': 'paginationKey' - } - - def __init__(self, events=None, pagination_key=None): # noqa: E501 - """SearchEventsResponse - a model defined in Swagger""" # noqa: E501 - self._events = None - self._pagination_key = None - self.discriminator = None - if events is not None: - self.events = events - if pagination_key is not None: - self.pagination_key = pagination_key - - @property - def events(self) -> Optional[List[SearchEventsResponseEvents]]: - """Gets the events of this SearchEventsResponse. # noqa: E501 - - - :return: The events of this SearchEventsResponse. # noqa: E501 - """ - return self._events - - @events.setter - def events(self, events: Optional[List[SearchEventsResponseEvents]]): - """Sets the events of this SearchEventsResponse. - - - :param events: The events of this SearchEventsResponse. # noqa: E501 - """ - - self._events = events - - @property - def pagination_key(self) -> Optional[str]: - """Gets the pagination_key of this SearchEventsResponse. # noqa: E501 - - Use this value in the `pagination_key` parameter to request the next page of search results. # noqa: E501 - - :return: The pagination_key of this SearchEventsResponse. # noqa: E501 - """ - return self._pagination_key - - @pagination_key.setter - def pagination_key(self, pagination_key: Optional[str]): - """Sets the pagination_key of this SearchEventsResponse. - - Use this value in the `pagination_key` parameter to request the next page of search results. # noqa: E501 - - :param pagination_key: The pagination_key of this SearchEventsResponse. # noqa: E501 - """ - - self._pagination_key = pagination_key - diff --git a/fingerprint_server_sdk/models/search_events_response_events.py b/fingerprint_server_sdk/models/search_events_response_events.py deleted file mode 100644 index 4d4e3643..00000000 --- a/fingerprint_server_sdk/models/search_events_response_events.py +++ /dev/null @@ -1,72 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.products import Products - - -class SearchEventsResponseEvents(BaseModel): - """ - Device intelligence results for the identification event. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'products': 'Products' - } - - nullable_map = { - 'products': False - } - - attribute_map = { - 'products': 'products' - } - - def __init__(self, products=None): # noqa: E501 - """SearchEventsResponseEvents - a model defined in Swagger""" # noqa: E501 - self._products = None - self.discriminator = None - self.products = products - - @property - def products(self) -> Products: - """Gets the products of this SearchEventsResponseEvents. # noqa: E501 - - - :return: The products of this SearchEventsResponseEvents. # noqa: E501 - """ - return self._products - - @products.setter - def products(self, products: Products): - """Sets the products of this SearchEventsResponseEvents. - - - :param products: The products of this SearchEventsResponseEvents. # noqa: E501 - """ - if products is None: - raise ValueError("Invalid value for `products`, must not be `None`") # noqa: E501 - - self._products = products - diff --git a/fingerprint_server_sdk/models/search_events_sdk_platform.py b/fingerprint_server_sdk/models/search_events_sdk_platform.py new file mode 100644 index 00000000..19335e47 --- /dev/null +++ b/fingerprint_server_sdk/models/search_events_sdk_platform.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SearchEventsSdkPlatform(str, Enum): + """ + Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. + """ + + """ + allowed enum values + """ + JS = 'js' + ANDROID = 'android' + IOS = 'ios' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SearchEventsSdkPlatform from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/fingerprint_server_sdk/models/search_events_vpn_confidence.py b/fingerprint_server_sdk/models/search_events_vpn_confidence.py new file mode 100644 index 00000000..e8129a1b --- /dev/null +++ b/fingerprint_server_sdk/models/search_events_vpn_confidence.py @@ -0,0 +1,39 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self + + +class SearchEventsVpnConfidence(str, Enum): + """ + 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 `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. + """ + + """ + allowed enum values + """ + HIGH = 'high' + MEDIUM = 'medium' + LOW = 'low' + + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of SearchEventsVpnConfidence from a JSON string""" + return cls(json.loads(json_str)) + + diff --git a/fingerprint_server_sdk/models/supplementary_id.py b/fingerprint_server_sdk/models/supplementary_id.py deleted file mode 100644 index cc7269f7..00000000 --- a/fingerprint_server_sdk/models/supplementary_id.py +++ /dev/null @@ -1,174 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.identification_confidence import IdentificationConfidence -from fingerprint_server_sdk.models.identification_seen_at import IdentificationSeenAt -from fingerprint_server_sdk.models.identification_seen_at import IdentificationSeenAt - - -class SupplementaryID(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'visitor_id': 'str', - 'visitor_found': 'bool', - 'confidence': 'IdentificationConfidence', - 'first_seen_at': 'IdentificationSeenAt', - 'last_seen_at': 'IdentificationSeenAt' - } - - nullable_map = { - 'visitor_id': False, - 'visitor_found': False, - 'confidence': False, - 'first_seen_at': False, - 'last_seen_at': False - } - - attribute_map = { - 'visitor_id': 'visitorId', - 'visitor_found': 'visitorFound', - 'confidence': 'confidence', - 'first_seen_at': 'firstSeenAt', - 'last_seen_at': 'lastSeenAt' - } - - def __init__(self, visitor_id=None, visitor_found=None, confidence=None, first_seen_at=None, last_seen_at=None): # noqa: E501 - """SupplementaryID - a model defined in Swagger""" # noqa: E501 - self._visitor_id = None - self._visitor_found = None - self._confidence = None - self._first_seen_at = None - self._last_seen_at = None - self.discriminator = None - if visitor_id is not None: - self.visitor_id = visitor_id - if visitor_found is not None: - self.visitor_found = visitor_found - if confidence is not None: - self.confidence = confidence - if first_seen_at is not None: - self.first_seen_at = first_seen_at - if last_seen_at is not None: - self.last_seen_at = last_seen_at - - @property - def visitor_id(self) -> Optional[str]: - """Gets the visitor_id of this SupplementaryID. # noqa: E501 - - String of 20 characters that uniquely identifies the visitor's browser or mobile device. # noqa: E501 - - :return: The visitor_id of this SupplementaryID. # noqa: E501 - """ - return self._visitor_id - - @visitor_id.setter - def visitor_id(self, visitor_id: Optional[str]): - """Sets the visitor_id of this SupplementaryID. - - String of 20 characters that uniquely identifies the visitor's browser or mobile device. # noqa: E501 - - :param visitor_id: The visitor_id of this SupplementaryID. # noqa: E501 - """ - - self._visitor_id = visitor_id - - @property - def visitor_found(self) -> Optional[bool]: - """Gets the visitor_found of this SupplementaryID. # noqa: E501 - - Attribute represents if a visitor had been identified before. # noqa: E501 - - :return: The visitor_found of this SupplementaryID. # noqa: E501 - """ - return self._visitor_found - - @visitor_found.setter - def visitor_found(self, visitor_found: Optional[bool]): - """Sets the visitor_found of this SupplementaryID. - - Attribute represents if a visitor had been identified before. # noqa: E501 - - :param visitor_found: The visitor_found of this SupplementaryID. # noqa: E501 - """ - - self._visitor_found = visitor_found - - @property - def confidence(self) -> Optional[IdentificationConfidence]: - """Gets the confidence of this SupplementaryID. # noqa: E501 - - - :return: The confidence of this SupplementaryID. # noqa: E501 - """ - return self._confidence - - @confidence.setter - def confidence(self, confidence: Optional[IdentificationConfidence]): - """Sets the confidence of this SupplementaryID. - - - :param confidence: The confidence of this SupplementaryID. # noqa: E501 - """ - - self._confidence = confidence - - @property - def first_seen_at(self) -> Optional[IdentificationSeenAt]: - """Gets the first_seen_at of this SupplementaryID. # noqa: E501 - - - :return: The first_seen_at of this SupplementaryID. # noqa: E501 - """ - return self._first_seen_at - - @first_seen_at.setter - def first_seen_at(self, first_seen_at: Optional[IdentificationSeenAt]): - """Sets the first_seen_at of this SupplementaryID. - - - :param first_seen_at: The first_seen_at of this SupplementaryID. # noqa: E501 - """ - - self._first_seen_at = first_seen_at - - @property - def last_seen_at(self) -> Optional[IdentificationSeenAt]: - """Gets the last_seen_at of this SupplementaryID. # noqa: E501 - - - :return: The last_seen_at of this SupplementaryID. # noqa: E501 - """ - return self._last_seen_at - - @last_seen_at.setter - def last_seen_at(self, last_seen_at: Optional[IdentificationSeenAt]): - """Sets the last_seen_at of this SupplementaryID. - - - :param last_seen_at: The last_seen_at of this SupplementaryID. # noqa: E501 - """ - - self._last_seen_at = last_seen_at - diff --git a/fingerprint_server_sdk/models/supplementary_id_high_recall.py b/fingerprint_server_sdk/models/supplementary_id_high_recall.py new file mode 100644 index 00000000..afda3141 --- /dev/null +++ b/fingerprint_server_sdk/models/supplementary_id_high_recall.py @@ -0,0 +1,100 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from fingerprint_server_sdk.models.identification_confidence import IdentificationConfidence +from typing import Optional, Set +from typing_extensions import Self + +class SupplementaryIDHighRecall(BaseModel): + """ + A supplementary browser identifier that prioritizes coverage over precision. The High Recall ID algorithm matches more generously, i.e., this identifier will remain the same even when there are subtle differences between two requests. This algorithm does not create as many new visitor IDs as the standard algorithms do, but there could be an increase in false-positive identification. + """ # noqa: E501 + visitor_id: StrictStr = Field(description="String of 20 characters that uniquely identifies the visitor's browser or mobile device.") + visitor_found: StrictBool = Field(description="Attribute represents if a visitor had been identified before.") + confidence: Optional[IdentificationConfidence] = None + first_seen_at: Optional[StrictInt] = Field(default=None, description="Unix epoch time milliseconds timestamp indicating the time at which this ID was first seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 ") + last_seen_at: Optional[StrictInt] = Field(default=None, description="Unix epoch time milliseconds timestamp indicating the time at which this ID was last seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 ") + __properties: ClassVar[List[str]] = ["visitor_id", "visitor_found", "confidence", "first_seen_at", "last_seen_at"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of SupplementaryIDHighRecall from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of confidence + if self.confidence: + _dict['confidence'] = self.confidence.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of SupplementaryIDHighRecall from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "visitor_id": obj.get("visitor_id"), + "visitor_found": obj.get("visitor_found"), + "confidence": IdentificationConfidence.from_dict(obj["confidence"]) if obj.get("confidence") is not None else None, + "first_seen_at": obj.get("first_seen_at"), + "last_seen_at": obj.get("last_seen_at") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/suspect_score.py b/fingerprint_server_sdk/models/suspect_score.py deleted file mode 100644 index 56aff796..00000000 --- a/fingerprint_server_sdk/models/suspect_score.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class SuspectScore(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'int' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """SuspectScore - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - self.result = result - - @property - def result(self) -> int: - """Gets the result of this SuspectScore. # noqa: E501 - - Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score # noqa: E501 - - :return: The result of this SuspectScore. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: int): - """Sets the result of this SuspectScore. - - Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score # noqa: E501 - - :param result: The result of this SuspectScore. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - diff --git a/fingerprint_server_sdk/models/tag.py b/fingerprint_server_sdk/models/tag.py deleted file mode 100644 index 065f1476..00000000 --- a/fingerprint_server_sdk/models/tag.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class Tag(dict): - """ - A customer-provided value or an object that was sent with identification request. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - nullable_map = { - } - - attribute_map = { - } - - __parent_class__ = 'dict' - diff --git a/fingerprint_server_sdk/models/tampering.py b/fingerprint_server_sdk/models/tampering.py deleted file mode 100644 index 903247f4..00000000 --- a/fingerprint_server_sdk/models/tampering.py +++ /dev/null @@ -1,126 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class Tampering(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool', - 'anomaly_score': 'float', - 'anti_detect_browser': 'bool' - } - - nullable_map = { - 'result': False, - 'anomaly_score': False, - 'anti_detect_browser': False - } - - attribute_map = { - 'result': 'result', - 'anomaly_score': 'anomalyScore', - 'anti_detect_browser': 'antiDetectBrowser' - } - - def __init__(self, result=None, anomaly_score=None, anti_detect_browser=None): # noqa: E501 - """Tampering - a model defined in Swagger""" # noqa: E501 - self._result = None - self._anomaly_score = None - self._anti_detect_browser = None - self.discriminator = None - self.result = result - self.anomaly_score = anomaly_score - self.anti_detect_browser = anti_detect_browser - - @property - def result(self) -> bool: - """Gets the result of this Tampering. # noqa: E501 - - Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. # noqa: E501 - - :return: The result of this Tampering. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this Tampering. - - Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. # noqa: E501 - - :param result: The result of this Tampering. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - - @property - def anomaly_score(self) -> float: - """Gets the anomaly_score of this Tampering. # noqa: E501 - - A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. # noqa: E501 - - :return: The anomaly_score of this Tampering. # noqa: E501 - """ - return self._anomaly_score - - @anomaly_score.setter - def anomaly_score(self, anomaly_score: float): - """Sets the anomaly_score of this Tampering. - - A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. # noqa: E501 - - :param anomaly_score: The anomaly_score of this Tampering. # noqa: E501 - """ - if anomaly_score is None: - raise ValueError("Invalid value for `anomaly_score`, must not be `None`") # noqa: E501 - - self._anomaly_score = anomaly_score - - @property - def anti_detect_browser(self) -> bool: - """Gets the anti_detect_browser of this Tampering. # noqa: E501 - - Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. # noqa: E501 - - :return: The anti_detect_browser of this Tampering. # noqa: E501 - """ - return self._anti_detect_browser - - @anti_detect_browser.setter - def anti_detect_browser(self, anti_detect_browser: bool): - """Sets the anti_detect_browser of this Tampering. - - Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. # noqa: E501 - - :param anti_detect_browser: The anti_detect_browser of this Tampering. # noqa: E501 - """ - if anti_detect_browser is None: - raise ValueError("Invalid value for `anti_detect_browser`, must not be `None`") # noqa: E501 - - self._anti_detect_browser = anti_detect_browser - diff --git a/fingerprint_server_sdk/models/tampering_details.py b/fingerprint_server_sdk/models/tampering_details.py new file mode 100644 index 00000000..c50ed622 --- /dev/null +++ b/fingerprint_server_sdk/models/tampering_details.py @@ -0,0 +1,91 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self + +class TamperingDetails(BaseModel): + """ + TamperingDetails + """ # noqa: E501 + anomaly_score: Optional[Union[Annotated[float, Field(le=1, strict=True, ge=0)], Annotated[int, Field(le=1, strict=True, ge=0)]]] = Field(default=None, description="Confidence score (`0.0 - 1.0`) for tampering detection: * Values above `0.5` indicate tampering. * Values below `0.5` indicate genuine browsers. ") + anti_detect_browser: Optional[StrictBool] = Field(default=None, description="True if the identified browser resembles an \"anti-detect\" browser, such as Incognition, which attempts to evade identification by manipulating its fingerprint. ") + __properties: ClassVar[List[str]] = ["anomaly_score", "anti_detect_browser"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TamperingDetails from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TamperingDetails from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "anomaly_score": obj.get("anomaly_score"), + "anti_detect_browser": obj.get("anti_detect_browser") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/tor.py b/fingerprint_server_sdk/models/tor.py deleted file mode 100644 index 7e598cbb..00000000 --- a/fingerprint_server_sdk/models/tor.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class Tor(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """Tor - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - self.result = result - - @property - def result(self) -> bool: - """Gets the result of this Tor. # noqa: E501 - - `true` if the request IP address is a known tor exit node, `false` otherwise. # noqa: E501 - - :return: The result of this Tor. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this Tor. - - `true` if the request IP address is a known tor exit node, `false` otherwise. # noqa: E501 - - :param result: The result of this Tor. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - diff --git a/fingerprint_server_sdk/models/touch_support.py b/fingerprint_server_sdk/models/touch_support.py new file mode 100644 index 00000000..fbc11077 --- /dev/null +++ b/fingerprint_server_sdk/models/touch_support.py @@ -0,0 +1,92 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class TouchSupport(BaseModel): + """ + Browser-reported touch capabilities. + """ # noqa: E501 + touch_event: Optional[StrictBool] = None + touch_start: Optional[StrictBool] = None + max_touch_points: Optional[StrictInt] = None + __properties: ClassVar[List[str]] = ["touch_event", "touch_start", "max_touch_points"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of TouchSupport from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of TouchSupport from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "touch_event": obj.get("touch_event"), + "touch_start": obj.get("touch_start"), + "max_touch_points": obj.get("max_touch_points") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/velocity.py b/fingerprint_server_sdk/models/velocity.py index db8a9be4..d41fa812 100644 --- a/fingerprint_server_sdk/models/velocity.py +++ b/fingerprint_server_sdk/models/velocity.py @@ -1,234 +1,122 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.velocity_data import VelocityData -from fingerprint_server_sdk.models.velocity_data import VelocityData -from fingerprint_server_sdk.models.velocity_data import VelocityData -from fingerprint_server_sdk.models.velocity_data import VelocityData -from fingerprint_server_sdk.models.velocity_data import VelocityData -from fingerprint_server_sdk.models.velocity_data import VelocityData -from fingerprint_server_sdk.models.velocity_data import VelocityData - - -class Velocity(BaseModel): - """ - Sums key data points for a specific `visitorId`, `ipAddress` and `linkedId` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: - Number of distinct IP addresses associated to the visitor ID. - Number of distinct linked IDs associated with the visitor ID. - Number of distinct countries associated with the visitor ID. - Number of identification events associated with the visitor ID. - Number of identification events associated with the detected IP address. - Number of distinct IP addresses associated with the provided linked ID. - Number of distinct visitor IDs associated with the provided linked ID. The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted if the number of `events` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. - - NOTE: This class is auto generated by the swagger code generator program. + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'distinct_ip': 'VelocityData', - 'distinct_linked_id': 'VelocityData', - 'distinct_country': 'VelocityData', - 'events': 'VelocityData', - 'ip_events': 'VelocityData', - 'distinct_ip_by_linked_id': 'VelocityData', - 'distinct_visitor_id_by_linked_id': 'VelocityData' - } - - nullable_map = { - 'distinct_ip': False, - 'distinct_linked_id': False, - 'distinct_country': False, - 'events': False, - 'ip_events': False, - 'distinct_ip_by_linked_id': False, - 'distinct_visitor_id_by_linked_id': False - } - - attribute_map = { - 'distinct_ip': 'distinctIp', - 'distinct_linked_id': 'distinctLinkedId', - 'distinct_country': 'distinctCountry', - 'events': 'events', - 'ip_events': 'ipEvents', - 'distinct_ip_by_linked_id': 'distinctIpByLinkedId', - 'distinct_visitor_id_by_linked_id': 'distinctVisitorIdByLinkedId' - } - - def __init__(self, distinct_ip=None, distinct_linked_id=None, distinct_country=None, events=None, ip_events=None, distinct_ip_by_linked_id=None, distinct_visitor_id_by_linked_id=None): # noqa: E501 - """Velocity - a model defined in Swagger""" # noqa: E501 - self._distinct_ip = None - self._distinct_linked_id = None - self._distinct_country = None - self._events = None - self._ip_events = None - self._distinct_ip_by_linked_id = None - self._distinct_visitor_id_by_linked_id = None - self.discriminator = None - self.distinct_ip = distinct_ip - self.distinct_linked_id = distinct_linked_id - self.distinct_country = distinct_country - self.events = events - self.ip_events = ip_events - self.distinct_ip_by_linked_id = distinct_ip_by_linked_id - self.distinct_visitor_id_by_linked_id = distinct_visitor_id_by_linked_id - - @property - def distinct_ip(self) -> VelocityData: - """Gets the distinct_ip of this Velocity. # noqa: E501 - - - :return: The distinct_ip of this Velocity. # noqa: E501 - """ - return self._distinct_ip - - @distinct_ip.setter - def distinct_ip(self, distinct_ip: VelocityData): - """Sets the distinct_ip of this Velocity. - - - :param distinct_ip: The distinct_ip of this Velocity. # noqa: E501 - """ - if distinct_ip is None: - raise ValueError("Invalid value for `distinct_ip`, must not be `None`") # noqa: E501 - - self._distinct_ip = distinct_ip - - @property - def distinct_linked_id(self) -> VelocityData: - """Gets the distinct_linked_id of this Velocity. # noqa: E501 - - - :return: The distinct_linked_id of this Velocity. # noqa: E501 - """ - return self._distinct_linked_id - - @distinct_linked_id.setter - def distinct_linked_id(self, distinct_linked_id: VelocityData): - """Sets the distinct_linked_id of this Velocity. - - - :param distinct_linked_id: The distinct_linked_id of this Velocity. # noqa: E501 - """ - if distinct_linked_id is None: - raise ValueError("Invalid value for `distinct_linked_id`, must not be `None`") # noqa: E501 - - self._distinct_linked_id = distinct_linked_id - - @property - def distinct_country(self) -> VelocityData: - """Gets the distinct_country of this Velocity. # noqa: E501 - - - :return: The distinct_country of this Velocity. # noqa: E501 - """ - return self._distinct_country - - @distinct_country.setter - def distinct_country(self, distinct_country: VelocityData): - """Sets the distinct_country of this Velocity. +""" # noqa: E501 - :param distinct_country: The distinct_country of this Velocity. # noqa: E501 - """ - if distinct_country is None: - raise ValueError("Invalid value for `distinct_country`, must not be `None`") # noqa: E501 - - self._distinct_country = distinct_country - - @property - def events(self) -> VelocityData: - """Gets the events of this Velocity. # noqa: E501 - - - :return: The events of this Velocity. # noqa: E501 - """ - return self._events - - @events.setter - def events(self, events: VelocityData): - """Sets the events of this Velocity. - - - :param events: The events of this Velocity. # noqa: E501 - """ - if events is None: - raise ValueError("Invalid value for `events`, must not be `None`") # noqa: E501 - - self._events = events - - @property - def ip_events(self) -> VelocityData: - """Gets the ip_events of this Velocity. # noqa: E501 - - - :return: The ip_events of this Velocity. # noqa: E501 - """ - return self._ip_events - - @ip_events.setter - def ip_events(self, ip_events: VelocityData): - """Sets the ip_events of this Velocity. - - - :param ip_events: The ip_events of this Velocity. # noqa: E501 - """ - if ip_events is None: - raise ValueError("Invalid value for `ip_events`, must not be `None`") # noqa: E501 - - self._ip_events = ip_events - - @property - def distinct_ip_by_linked_id(self) -> VelocityData: - """Gets the distinct_ip_by_linked_id of this Velocity. # noqa: E501 - - - :return: The distinct_ip_by_linked_id of this Velocity. # noqa: E501 - """ - return self._distinct_ip_by_linked_id - - @distinct_ip_by_linked_id.setter - def distinct_ip_by_linked_id(self, distinct_ip_by_linked_id: VelocityData): - """Sets the distinct_ip_by_linked_id of this Velocity. - - - :param distinct_ip_by_linked_id: The distinct_ip_by_linked_id of this Velocity. # noqa: E501 - """ - if distinct_ip_by_linked_id is None: - raise ValueError("Invalid value for `distinct_ip_by_linked_id`, must not be `None`") # noqa: E501 - - self._distinct_ip_by_linked_id = distinct_ip_by_linked_id - - @property - def distinct_visitor_id_by_linked_id(self) -> VelocityData: - """Gets the distinct_visitor_id_by_linked_id of this Velocity. # noqa: E501 - - - :return: The distinct_visitor_id_by_linked_id of this Velocity. # noqa: E501 - """ - return self._distinct_visitor_id_by_linked_id - - @distinct_visitor_id_by_linked_id.setter - def distinct_visitor_id_by_linked_id(self, distinct_visitor_id_by_linked_id: VelocityData): - """Sets the distinct_visitor_id_by_linked_id of this Velocity. +from __future__ import annotations +import pprint +import re # noqa: F401 +import json +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List, Optional +from fingerprint_server_sdk.models.velocity_data import VelocityData +from typing import Optional, Set +from typing_extensions import Self - :param distinct_visitor_id_by_linked_id: The distinct_visitor_id_by_linked_id of this Velocity. # noqa: E501 +class Velocity(BaseModel): + """ + Sums key data points for a specific `visitor_id`, `ip_address` and `linked_id` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: - Number of distinct IP addresses associated to the visitor Id. - Number of distinct linked Ids associated with the visitor Id. - Number of distinct countries associated with the visitor Id. - Number of identification events associated with the visitor Id. - Number of identification events associated with the detected IP address. - Number of distinct IP addresses associated with the provided linked Id. - Number of distinct visitor Ids associated with the provided linked Id. The `24h` interval of `distinct_ip`, `distinct_linked_id`, `distinct_country`, `distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will be omitted if the number of `events` for the visitor Id in the last 24 hours (`events.['24h']`) is higher than 20.000. All will not necessarily be returned in a response, some may be omitted if the associated event does not have the required data, such as a linked_id. + """ # noqa: E501 + distinct_ip: Optional[VelocityData] = None + distinct_linked_id: Optional[VelocityData] = None + distinct_country: Optional[VelocityData] = None + events: Optional[VelocityData] = None + ip_events: Optional[VelocityData] = None + distinct_ip_by_linked_id: Optional[VelocityData] = None + distinct_visitor_id_by_linked_id: Optional[VelocityData] = None + __properties: ClassVar[List[str]] = ["distinct_ip", "distinct_linked_id", "distinct_country", "events", "ip_events", "distinct_ip_by_linked_id", "distinct_visitor_id_by_linked_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of Velocity from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - if distinct_visitor_id_by_linked_id is None: - raise ValueError("Invalid value for `distinct_visitor_id_by_linked_id`, must not be `None`") # noqa: E501 + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + # override the default output from pydantic by calling `to_dict()` of distinct_ip + if self.distinct_ip: + _dict['distinct_ip'] = self.distinct_ip.to_dict() + # override the default output from pydantic by calling `to_dict()` of distinct_linked_id + if self.distinct_linked_id: + _dict['distinct_linked_id'] = self.distinct_linked_id.to_dict() + # override the default output from pydantic by calling `to_dict()` of distinct_country + if self.distinct_country: + _dict['distinct_country'] = self.distinct_country.to_dict() + # override the default output from pydantic by calling `to_dict()` of events + if self.events: + _dict['events'] = self.events.to_dict() + # override the default output from pydantic by calling `to_dict()` of ip_events + if self.ip_events: + _dict['ip_events'] = self.ip_events.to_dict() + # override the default output from pydantic by calling `to_dict()` of distinct_ip_by_linked_id + if self.distinct_ip_by_linked_id: + _dict['distinct_ip_by_linked_id'] = self.distinct_ip_by_linked_id.to_dict() + # override the default output from pydantic by calling `to_dict()` of distinct_visitor_id_by_linked_id + if self.distinct_visitor_id_by_linked_id: + _dict['distinct_visitor_id_by_linked_id'] = self.distinct_visitor_id_by_linked_id.to_dict() + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of Velocity from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "distinct_ip": VelocityData.from_dict(obj["distinct_ip"]) if obj.get("distinct_ip") is not None else None, + "distinct_linked_id": VelocityData.from_dict(obj["distinct_linked_id"]) if obj.get("distinct_linked_id") is not None else None, + "distinct_country": VelocityData.from_dict(obj["distinct_country"]) if obj.get("distinct_country") is not None else None, + "events": VelocityData.from_dict(obj["events"]) if obj.get("events") is not None else None, + "ip_events": VelocityData.from_dict(obj["ip_events"]) if obj.get("ip_events") is not None else None, + "distinct_ip_by_linked_id": VelocityData.from_dict(obj["distinct_ip_by_linked_id"]) if obj.get("distinct_ip_by_linked_id") is not None else None, + "distinct_visitor_id_by_linked_id": VelocityData.from_dict(obj["distinct_visitor_id_by_linked_id"]) if obj.get("distinct_visitor_id_by_linked_id") is not None else None + }) + return _obj - self._distinct_visitor_id_by_linked_id = distinct_visitor_id_by_linked_id diff --git a/fingerprint_server_sdk/models/velocity_data.py b/fingerprint_server_sdk/models/velocity_data.py index 21bb8aa1..57d02645 100644 --- a/fingerprint_server_sdk/models/velocity_data.py +++ b/fingerprint_server_sdk/models/velocity_data.py @@ -1,68 +1,92 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.velocity_intervals import VelocityIntervals - - -class VelocityData(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'intervals': 'VelocityIntervals' - } +""" # noqa: E501 - nullable_map = { - 'intervals': False - } - attribute_map = { - 'intervals': 'intervals' - } - - def __init__(self, intervals=None): # noqa: E501 - """VelocityData - a model defined in Swagger""" # noqa: E501 - self._intervals = None - self.discriminator = None - if intervals is not None: - self.intervals = intervals - - @property - def intervals(self) -> Optional[VelocityIntervals]: - """Gets the intervals of this VelocityData. # noqa: E501 - - - :return: The intervals of this VelocityData. # noqa: E501 - """ - return self._intervals - - @intervals.setter - def intervals(self, intervals: Optional[VelocityIntervals]): - """Sets the intervals of this VelocityData. +from __future__ import annotations +import pprint +import re # noqa: F401 +import json +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self - :param intervals: The intervals of this VelocityData. # noqa: E501 +class VelocityData(BaseModel): + """ + Is absent if the velocity data could not be generated for the visitor Id. + """ # noqa: E501 + var_5_minutes: StrictInt = Field(description="Count for the last 5 minutes of velocity data, from the time of the event. ", alias="5_minutes") + var_1_hour: StrictInt = Field(description="Count for the last 1 hour of velocity data, from the time of the event. ", alias="1_hour") + var_24_hours: Optional[StrictInt] = Field(default=None, description="The `24_hours` interval of `distinct_ip`, `distinct_linked_id`, `distinct_country`, `distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will be omitted if the number of `events` for the visitor Id in the last 24 hours (`events.['24_hours']`) is higher than 20.000. ", alias="24_hours") + __properties: ClassVar[List[str]] = ["5_minutes", "1_hour", "24_hours"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of VelocityData from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VelocityData from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "5_minutes": obj.get("5_minutes"), + "1_hour": obj.get("1_hour"), + "24_hours": obj.get("24_hours") + }) + return _obj - self._intervals = intervals diff --git a/fingerprint_server_sdk/models/velocity_intervals.py b/fingerprint_server_sdk/models/velocity_intervals.py deleted file mode 100644 index 6d8cc51c..00000000 --- a/fingerprint_server_sdk/models/velocity_intervals.py +++ /dev/null @@ -1,124 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class VelocityIntervals(BaseModel): - """ - Is absent if the velocity data could not be generated for the visitor ID. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - '_5m': 'int', - '_1h': 'int', - '_24h': 'int' - } - - nullable_map = { - '_5m': False, - '_1h': False, - '_24h': False - } - - attribute_map = { - '_5m': '5m', - '_1h': '1h', - '_24h': '24h' - } - - def __init__(self, _5m=None, _1h=None, _24h=None): # noqa: E501 - """VelocityIntervals - a model defined in Swagger""" # noqa: E501 - self.__5m = None - self.__1h = None - self.__24h = None - self.discriminator = None - self._5m = _5m - self._1h = _1h - if _24h is not None: - self._24h = _24h - - @property - def _5m(self) -> int: - """Gets the _5m of this VelocityIntervals. # noqa: E501 - - - :return: The _5m of this VelocityIntervals. # noqa: E501 - """ - return self.__5m - - @_5m.setter - def _5m(self, _5m: int): - """Sets the _5m of this VelocityIntervals. - - - :param _5m: The _5m of this VelocityIntervals. # noqa: E501 - """ - if _5m is None: - raise ValueError("Invalid value for `_5m`, must not be `None`") # noqa: E501 - - self.__5m = _5m - - @property - def _1h(self) -> int: - """Gets the _1h of this VelocityIntervals. # noqa: E501 - - - :return: The _1h of this VelocityIntervals. # noqa: E501 - """ - return self.__1h - - @_1h.setter - def _1h(self, _1h: int): - """Sets the _1h of this VelocityIntervals. - - - :param _1h: The _1h of this VelocityIntervals. # noqa: E501 - """ - if _1h is None: - raise ValueError("Invalid value for `_1h`, must not be `None`") # noqa: E501 - - self.__1h = _1h - - @property - def _24h(self) -> Optional[int]: - """Gets the _24h of this VelocityIntervals. # noqa: E501 - - The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. # noqa: E501 - - :return: The _24h of this VelocityIntervals. # noqa: E501 - """ - return self.__24h - - @_24h.setter - def _24h(self, _24h: Optional[int]): - """Sets the _24h of this VelocityIntervals. - - The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. # noqa: E501 - - :param _24h: The _24h of this VelocityIntervals. # noqa: E501 - """ - - self.__24h = _24h - diff --git a/fingerprint_server_sdk/models/virtual_machine.py b/fingerprint_server_sdk/models/virtual_machine.py deleted file mode 100644 index 19c21bc0..00000000 --- a/fingerprint_server_sdk/models/virtual_machine.py +++ /dev/null @@ -1,70 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class VirtualMachine(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """VirtualMachine - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - self.result = result - - @property - def result(self) -> bool: - """Gets the result of this VirtualMachine. # noqa: E501 - - `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. # noqa: E501 - - :return: The result of this VirtualMachine. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this VirtualMachine. - - `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. # noqa: E501 - - :param result: The result of this VirtualMachine. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - diff --git a/fingerprint_server_sdk/models/visit.py b/fingerprint_server_sdk/models/visit.py deleted file mode 100644 index 97ca893f..00000000 --- a/fingerprint_server_sdk/models/visit.py +++ /dev/null @@ -1,452 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.browser_details import BrowserDetails -from fingerprint_server_sdk.models.deprecated_geolocation import DeprecatedGeolocation -from datetime import datetime -from fingerprint_server_sdk.models.tag import Tag -from fingerprint_server_sdk.models.identification_confidence import IdentificationConfidence -from fingerprint_server_sdk.models.identification_seen_at import IdentificationSeenAt -from fingerprint_server_sdk.models.identification_seen_at import IdentificationSeenAt -from fingerprint_server_sdk.models.raw_device_attributes import RawDeviceAttributes - - -class Visit(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'request_id': 'str', - 'browser_details': 'BrowserDetails', - 'incognito': 'bool', - 'ip': 'str', - 'ip_location': 'DeprecatedGeolocation', - 'linked_id': 'str', - 'timestamp': 'int', - 'time': 'datetime', - 'url': 'str', - 'tag': 'Tag', - 'confidence': 'IdentificationConfidence', - 'visitor_found': 'bool', - 'first_seen_at': 'IdentificationSeenAt', - 'last_seen_at': 'IdentificationSeenAt', - 'components': 'RawDeviceAttributes' - } - - nullable_map = { - 'request_id': False, - 'browser_details': False, - 'incognito': False, - 'ip': False, - 'ip_location': False, - 'linked_id': False, - 'timestamp': False, - 'time': False, - 'url': False, - 'tag': False, - 'confidence': False, - 'visitor_found': False, - 'first_seen_at': False, - 'last_seen_at': False, - 'components': False - } - - attribute_map = { - 'request_id': 'requestId', - 'browser_details': 'browserDetails', - 'incognito': 'incognito', - 'ip': 'ip', - 'ip_location': 'ipLocation', - 'linked_id': 'linkedId', - 'timestamp': 'timestamp', - 'time': 'time', - 'url': 'url', - 'tag': 'tag', - 'confidence': 'confidence', - 'visitor_found': 'visitorFound', - 'first_seen_at': 'firstSeenAt', - 'last_seen_at': 'lastSeenAt', - 'components': 'components' - } - - def __init__(self, request_id=None, browser_details=None, incognito=None, ip=None, ip_location=None, linked_id=None, timestamp=None, time=None, url=None, tag=None, confidence=None, visitor_found=None, first_seen_at=None, last_seen_at=None, components=None): # noqa: E501 - """Visit - a model defined in Swagger""" # noqa: E501 - self._request_id = None - self._browser_details = None - self._incognito = None - self._ip = None - self._ip_location = None - self._linked_id = None - self._timestamp = None - self._time = None - self._url = None - self._tag = None - self._confidence = None - self._visitor_found = None - self._first_seen_at = None - self._last_seen_at = None - self._components = None - self.discriminator = None - self.request_id = request_id - self.browser_details = browser_details - self.incognito = incognito - self.ip = ip - if ip_location is not None: - self.ip_location = ip_location - if linked_id is not None: - self.linked_id = linked_id - self.timestamp = timestamp - self.time = time - self.url = url - self.tag = tag - if confidence is not None: - self.confidence = confidence - self.visitor_found = visitor_found - self.first_seen_at = first_seen_at - self.last_seen_at = last_seen_at - if components is not None: - self.components = components - - @property - def request_id(self) -> str: - """Gets the request_id of this Visit. # noqa: E501 - - Unique identifier of the user's request. # noqa: E501 - - :return: The request_id of this Visit. # noqa: E501 - """ - return self._request_id - - @request_id.setter - def request_id(self, request_id: str): - """Sets the request_id of this Visit. - - Unique identifier of the user's request. # noqa: E501 - - :param request_id: The request_id of this Visit. # noqa: E501 - """ - if request_id is None: - raise ValueError("Invalid value for `request_id`, must not be `None`") # noqa: E501 - - self._request_id = request_id - - @property - def browser_details(self) -> BrowserDetails: - """Gets the browser_details of this Visit. # noqa: E501 - - - :return: The browser_details of this Visit. # noqa: E501 - """ - return self._browser_details - - @browser_details.setter - def browser_details(self, browser_details: BrowserDetails): - """Sets the browser_details of this Visit. - - - :param browser_details: The browser_details of this Visit. # noqa: E501 - """ - if browser_details is None: - raise ValueError("Invalid value for `browser_details`, must not be `None`") # noqa: E501 - - self._browser_details = browser_details - - @property - def incognito(self) -> bool: - """Gets the incognito of this Visit. # noqa: E501 - - Flag if user used incognito session. # noqa: E501 - - :return: The incognito of this Visit. # noqa: E501 - """ - return self._incognito - - @incognito.setter - def incognito(self, incognito: bool): - """Sets the incognito of this Visit. - - Flag if user used incognito session. # noqa: E501 - - :param incognito: The incognito of this Visit. # noqa: E501 - """ - if incognito is None: - raise ValueError("Invalid value for `incognito`, must not be `None`") # noqa: E501 - - self._incognito = incognito - - @property - def ip(self) -> str: - """Gets the ip of this Visit. # noqa: E501 - - IP address of the requesting browser or bot. # noqa: E501 - - :return: The ip of this Visit. # noqa: E501 - """ - return self._ip - - @ip.setter - def ip(self, ip: str): - """Sets the ip of this Visit. - - IP address of the requesting browser or bot. # noqa: E501 - - :param ip: The ip of this Visit. # noqa: E501 - """ - if ip is None: - raise ValueError("Invalid value for `ip`, must not be `None`") # noqa: E501 - - self._ip = ip - - @property - def ip_location(self) -> Optional[DeprecatedGeolocation]: - """Gets the ip_location of this Visit. # noqa: E501 - - - :return: The ip_location of this Visit. # noqa: E501 - """ - return self._ip_location - - @ip_location.setter - def ip_location(self, ip_location: Optional[DeprecatedGeolocation]): - """Sets the ip_location of this Visit. - - - :param ip_location: The ip_location of this Visit. # noqa: E501 - """ - - self._ip_location = ip_location - - @property - def linked_id(self) -> Optional[str]: - """Gets the linked_id of this Visit. # noqa: E501 - - A customer-provided id that was sent with the request. # noqa: E501 - - :return: The linked_id of this Visit. # noqa: E501 - """ - return self._linked_id - - @linked_id.setter - def linked_id(self, linked_id: Optional[str]): - """Sets the linked_id of this Visit. - - A customer-provided id that was sent with the request. # noqa: E501 - - :param linked_id: The linked_id of this Visit. # noqa: E501 - """ - - self._linked_id = linked_id - - @property - def timestamp(self) -> int: - """Gets the timestamp of this Visit. # noqa: E501 - - Timestamp of the event with millisecond precision in Unix time. # noqa: E501 - - :return: The timestamp of this Visit. # noqa: E501 - """ - return self._timestamp - - @timestamp.setter - def timestamp(self, timestamp: int): - """Sets the timestamp of this Visit. - - Timestamp of the event with millisecond precision in Unix time. # noqa: E501 - - :param timestamp: The timestamp of this Visit. # noqa: E501 - """ - if timestamp is None: - raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 - - self._timestamp = timestamp - - @property - def time(self) -> datetime: - """Gets the time of this Visit. # noqa: E501 - - Time expressed according to ISO 8601 in UTC format, when the request from the client agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. # noqa: E501 - - :return: The time of this Visit. # noqa: E501 - """ - return self._time - - @time.setter - def time(self, time: datetime): - """Sets the time of this Visit. - - Time expressed according to ISO 8601 in UTC format, when the request from the client agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. # noqa: E501 - - :param time: The time of this Visit. # noqa: E501 - """ - if time is None: - raise ValueError("Invalid value for `time`, must not be `None`") # noqa: E501 - - self._time = time - - @property - def url(self) -> str: - """Gets the url of this Visit. # noqa: E501 - - Page URL from which the request was sent. # noqa: E501 - - :return: The url of this Visit. # noqa: E501 - """ - return self._url - - @url.setter - def url(self, url: str): - """Sets the url of this Visit. - - Page URL from which the request was sent. # noqa: E501 - - :param url: The url of this Visit. # noqa: E501 - """ - if url is None: - raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 - - self._url = url - - @property - def tag(self) -> Tag: - """Gets the tag of this Visit. # noqa: E501 - - - :return: The tag of this Visit. # noqa: E501 - """ - return self._tag - - @tag.setter - def tag(self, tag: Tag): - """Sets the tag of this Visit. - - - :param tag: The tag of this Visit. # noqa: E501 - """ - if tag is None: - raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 - - self._tag = tag - - @property - def confidence(self) -> Optional[IdentificationConfidence]: - """Gets the confidence of this Visit. # noqa: E501 - - - :return: The confidence of this Visit. # noqa: E501 - """ - return self._confidence - - @confidence.setter - def confidence(self, confidence: Optional[IdentificationConfidence]): - """Sets the confidence of this Visit. - - - :param confidence: The confidence of this Visit. # noqa: E501 - """ - - self._confidence = confidence - - @property - def visitor_found(self) -> bool: - """Gets the visitor_found of this Visit. # noqa: E501 - - Attribute represents if a visitor had been identified before. # noqa: E501 - - :return: The visitor_found of this Visit. # noqa: E501 - """ - return self._visitor_found - - @visitor_found.setter - def visitor_found(self, visitor_found: bool): - """Sets the visitor_found of this Visit. - - Attribute represents if a visitor had been identified before. # noqa: E501 - - :param visitor_found: The visitor_found of this Visit. # noqa: E501 - """ - if visitor_found is None: - raise ValueError("Invalid value for `visitor_found`, must not be `None`") # noqa: E501 - - self._visitor_found = visitor_found - - @property - def first_seen_at(self) -> IdentificationSeenAt: - """Gets the first_seen_at of this Visit. # noqa: E501 - - - :return: The first_seen_at of this Visit. # noqa: E501 - """ - return self._first_seen_at - - @first_seen_at.setter - def first_seen_at(self, first_seen_at: IdentificationSeenAt): - """Sets the first_seen_at of this Visit. - - - :param first_seen_at: The first_seen_at of this Visit. # noqa: E501 - """ - if first_seen_at is None: - raise ValueError("Invalid value for `first_seen_at`, must not be `None`") # noqa: E501 - - self._first_seen_at = first_seen_at - - @property - def last_seen_at(self) -> IdentificationSeenAt: - """Gets the last_seen_at of this Visit. # noqa: E501 - - - :return: The last_seen_at of this Visit. # noqa: E501 - """ - return self._last_seen_at - - @last_seen_at.setter - def last_seen_at(self, last_seen_at: IdentificationSeenAt): - """Sets the last_seen_at of this Visit. - - - :param last_seen_at: The last_seen_at of this Visit. # noqa: E501 - """ - if last_seen_at is None: - raise ValueError("Invalid value for `last_seen_at`, must not be `None`") # noqa: E501 - - self._last_seen_at = last_seen_at - - @property - def components(self) -> Optional[RawDeviceAttributes]: - """Gets the components of this Visit. # noqa: E501 - - - :return: The components of this Visit. # noqa: E501 - """ - return self._components - - @components.setter - def components(self, components: Optional[RawDeviceAttributes]): - """Sets the components of this Visit. - - - :param components: The components of this Visit. # noqa: E501 - """ - - self._components = components - diff --git a/fingerprint_server_sdk/models/visitors_get_response.py b/fingerprint_server_sdk/models/visitors_get_response.py deleted file mode 100644 index 248d650d..00000000 --- a/fingerprint_server_sdk/models/visitors_get_response.py +++ /dev/null @@ -1,152 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.visit import Visit - - -class VisitorsGetResponse(BaseModel): - """ - Pagination-related fields `lastTimestamp` and `paginationKey` are included if you use a pagination parameter like `limit` or `before` and there is more data available on the next page. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'visitor_id': 'str', - 'visits': 'list[Visit]', - 'last_timestamp': 'int', - 'pagination_key': 'str' - } - - nullable_map = { - 'visitor_id': False, - 'visits': False, - 'last_timestamp': False, - 'pagination_key': False - } - - attribute_map = { - 'visitor_id': 'visitorId', - 'visits': 'visits', - 'last_timestamp': 'lastTimestamp', - 'pagination_key': 'paginationKey' - } - - def __init__(self, visitor_id=None, visits=None, last_timestamp=None, pagination_key=None): # noqa: E501 - """VisitorsGetResponse - a model defined in Swagger""" # noqa: E501 - self._visitor_id = None - self._visits = None - self._last_timestamp = None - self._pagination_key = None - self.discriminator = None - self.visitor_id = visitor_id - self.visits = visits - if last_timestamp is not None: - self.last_timestamp = last_timestamp - if pagination_key is not None: - self.pagination_key = pagination_key - - @property - def visitor_id(self) -> str: - """Gets the visitor_id of this VisitorsGetResponse. # noqa: E501 - - - :return: The visitor_id of this VisitorsGetResponse. # noqa: E501 - """ - return self._visitor_id - - @visitor_id.setter - def visitor_id(self, visitor_id: str): - """Sets the visitor_id of this VisitorsGetResponse. - - - :param visitor_id: The visitor_id of this VisitorsGetResponse. # noqa: E501 - """ - if visitor_id is None: - raise ValueError("Invalid value for `visitor_id`, must not be `None`") # noqa: E501 - - self._visitor_id = visitor_id - - @property - def visits(self) -> List[Visit]: - """Gets the visits of this VisitorsGetResponse. # noqa: E501 - - - :return: The visits of this VisitorsGetResponse. # noqa: E501 - """ - return self._visits - - @visits.setter - def visits(self, visits: List[Visit]): - """Sets the visits of this VisitorsGetResponse. - - - :param visits: The visits of this VisitorsGetResponse. # noqa: E501 - """ - if visits is None: - raise ValueError("Invalid value for `visits`, must not be `None`") # noqa: E501 - - self._visits = visits - - @property - def last_timestamp(self) -> Optional[int]: - """Gets the last_timestamp of this VisitorsGetResponse. # noqa: E501 - - ⚠️ Deprecated paging attribute, please use `paginationKey` instead. Timestamp of the last visit in the current page of results. # noqa: E501 - - :return: The last_timestamp of this VisitorsGetResponse. # noqa: E501 - """ - return self._last_timestamp - - @last_timestamp.setter - def last_timestamp(self, last_timestamp: Optional[int]): - """Sets the last_timestamp of this VisitorsGetResponse. - - ⚠️ Deprecated paging attribute, please use `paginationKey` instead. Timestamp of the last visit in the current page of results. # noqa: E501 - - :param last_timestamp: The last_timestamp of this VisitorsGetResponse. # noqa: E501 - """ - - self._last_timestamp = last_timestamp - - @property - def pagination_key(self) -> Optional[str]: - """Gets the pagination_key of this VisitorsGetResponse. # noqa: E501 - - Request ID of the last visit in the current page of results. Use this value in the following request as the `paginationKey` parameter to get the next page of results. # noqa: E501 - - :return: The pagination_key of this VisitorsGetResponse. # noqa: E501 - """ - return self._pagination_key - - @pagination_key.setter - def pagination_key(self, pagination_key: Optional[str]): - """Sets the pagination_key of this VisitorsGetResponse. - - Request ID of the last visit in the current page of results. Use this value in the following request as the `paginationKey` parameter to get the next page of results. # noqa: E501 - - :param pagination_key: The pagination_key of this VisitorsGetResponse. # noqa: E501 - """ - - self._pagination_key = pagination_key - diff --git a/fingerprint_server_sdk/models/vpn.py b/fingerprint_server_sdk/models/vpn.py deleted file mode 100644 index ce789de5..00000000 --- a/fingerprint_server_sdk/models/vpn.py +++ /dev/null @@ -1,180 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.vpn_confidence import VPNConfidence -from fingerprint_server_sdk.models.vpn_methods import VPNMethods - - -class VPN(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool', - 'confidence': 'VPNConfidence', - 'origin_timezone': 'str', - 'origin_country': 'str', - 'methods': 'VPNMethods' - } - - nullable_map = { - 'result': False, - 'confidence': False, - 'origin_timezone': False, - 'origin_country': False, - 'methods': False - } - - attribute_map = { - 'result': 'result', - 'confidence': 'confidence', - 'origin_timezone': 'originTimezone', - 'origin_country': 'originCountry', - 'methods': 'methods' - } - - def __init__(self, result=None, confidence=None, origin_timezone=None, origin_country=None, methods=None): # noqa: E501 - """VPN - a model defined in Swagger""" # noqa: E501 - self._result = None - self._confidence = None - self._origin_timezone = None - self._origin_country = None - self._methods = None - self.discriminator = None - self.result = result - self.confidence = confidence - self.origin_timezone = origin_timezone - self.origin_country = origin_country - self.methods = methods - - @property - def result(self) -> bool: - """Gets the result of this VPN. # noqa: E501 - - VPN or other anonymizing service has been used when sending the request. # noqa: E501 - - :return: The result of this VPN. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this VPN. - - VPN or other anonymizing service has been used when sending the request. # noqa: E501 - - :param result: The result of this VPN. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - - @property - def confidence(self) -> VPNConfidence: - """Gets the confidence of this VPN. # noqa: E501 - - - :return: The confidence of this VPN. # noqa: E501 - """ - return self._confidence - - @confidence.setter - def confidence(self, confidence: VPNConfidence): - """Sets the confidence of this VPN. - - - :param confidence: The confidence of this VPN. # noqa: E501 - """ - if confidence is None: - raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501 - - self._confidence = confidence - - @property - def origin_timezone(self) -> str: - """Gets the origin_timezone of this VPN. # noqa: E501 - - Local timezone which is used in timezoneMismatch method. # noqa: E501 - - :return: The origin_timezone of this VPN. # noqa: E501 - """ - return self._origin_timezone - - @origin_timezone.setter - def origin_timezone(self, origin_timezone: str): - """Sets the origin_timezone of this VPN. - - Local timezone which is used in timezoneMismatch method. # noqa: E501 - - :param origin_timezone: The origin_timezone of this VPN. # noqa: E501 - """ - if origin_timezone is None: - raise ValueError("Invalid value for `origin_timezone`, must not be `None`") # noqa: E501 - - self._origin_timezone = origin_timezone - - @property - def origin_country(self) -> str: - """Gets the origin_country of this VPN. # noqa: E501 - - Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). # noqa: E501 - - :return: The origin_country of this VPN. # noqa: E501 - """ - return self._origin_country - - @origin_country.setter - def origin_country(self, origin_country: str): - """Sets the origin_country of this VPN. - - Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). # noqa: E501 - - :param origin_country: The origin_country of this VPN. # noqa: E501 - """ - if origin_country is None: - raise ValueError("Invalid value for `origin_country`, must not be `None`") # noqa: E501 - - self._origin_country = origin_country - - @property - def methods(self) -> VPNMethods: - """Gets the methods of this VPN. # noqa: E501 - - - :return: The methods of this VPN. # noqa: E501 - """ - return self._methods - - @methods.setter - def methods(self, methods: VPNMethods): - """Sets the methods of this VPN. - - - :param methods: The methods of this VPN. # noqa: E501 - """ - if methods is None: - raise ValueError("Invalid value for `methods`, must not be `None`") # noqa: E501 - - self._methods = methods - diff --git a/fingerprint_server_sdk/models/vpn_confidence.py b/fingerprint_server_sdk/models/vpn_confidence.py index 60e95598..acf360af 100644 --- a/fingerprint_server_sdk/models/vpn_confidence.py +++ b/fingerprint_server_sdk/models/vpn_confidence.py @@ -1,52 +1,39 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel + Do not edit the class manually. +""" # noqa: E501 -class VPNConfidence(BaseModel): - """ - A confidence rating for the VPN detection result — \"low\", \"medium\", or \"high\". Depends on the combination of results returned from all VPN detection methods. +from __future__ import annotations +import json +from enum import Enum +from typing_extensions import Self - NOTE: This class is auto generated by the swagger code generator program. - Do not edit the class manually. +class VpnConfidence(str, Enum): + """ + A confidence rating for the VPN detection result — \"low\", \"medium\", or \"high\". Depends on the combination of results returned from all VPN detection methods. """ """ allowed enum values """ - LOW = "low" - MEDIUM = "medium" - HIGH = "high" - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - nullable_map = { - } + LOW = 'low' + MEDIUM = 'medium' + HIGH = 'high' - attribute_map = { - } + @classmethod + def from_json(cls, json_str: str) -> Self: + """Create an instance of VpnConfidence from a JSON string""" + return cls(json.loads(json_str)) - def __init__(self): # noqa: E501 - """VPNConfidence - a model defined in Swagger""" # noqa: E501 - self.discriminator = None diff --git a/fingerprint_server_sdk/models/vpn_methods.py b/fingerprint_server_sdk/models/vpn_methods.py index cc4c0d6f..9bca0696 100644 --- a/fingerprint_server_sdk/models/vpn_methods.py +++ b/fingerprint_server_sdk/models/vpn_methods.py @@ -1,182 +1,96 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class VPNMethods(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. + Generated by OpenAPI Generator (https://openapi-generator.tech) Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'timezone_mismatch': 'bool', - 'public_vpn': 'bool', - 'auxiliary_mobile': 'bool', - 'os_mismatch': 'bool', - 'relay': 'bool' - } - - nullable_map = { - 'timezone_mismatch': False, - 'public_vpn': False, - 'auxiliary_mobile': False, - 'os_mismatch': False, - 'relay': False - } - - attribute_map = { - 'timezone_mismatch': 'timezoneMismatch', - 'public_vpn': 'publicVPN', - 'auxiliary_mobile': 'auxiliaryMobile', - 'os_mismatch': 'osMismatch', - 'relay': 'relay' - } - - def __init__(self, timezone_mismatch=None, public_vpn=None, auxiliary_mobile=None, os_mismatch=None, relay=None): # noqa: E501 - """VPNMethods - a model defined in Swagger""" # noqa: E501 - self._timezone_mismatch = None - self._public_vpn = None - self._auxiliary_mobile = None - self._os_mismatch = None - self._relay = None - self.discriminator = None - self.timezone_mismatch = timezone_mismatch - self.public_vpn = public_vpn - self.auxiliary_mobile = auxiliary_mobile - self.os_mismatch = os_mismatch - self.relay = relay - - @property - def timezone_mismatch(self) -> bool: - """Gets the timezone_mismatch of this VPNMethods. # noqa: E501 - - The browser timezone doesn't match the timezone inferred from the request IP address. # noqa: E501 - - :return: The timezone_mismatch of this VPNMethods. # noqa: E501 - """ - return self._timezone_mismatch - - @timezone_mismatch.setter - def timezone_mismatch(self, timezone_mismatch: bool): - """Sets the timezone_mismatch of this VPNMethods. - - The browser timezone doesn't match the timezone inferred from the request IP address. # noqa: E501 - - :param timezone_mismatch: The timezone_mismatch of this VPNMethods. # noqa: E501 - """ - if timezone_mismatch is None: - raise ValueError("Invalid value for `timezone_mismatch`, must not be `None`") # noqa: E501 - - self._timezone_mismatch = timezone_mismatch - - @property - def public_vpn(self) -> bool: - """Gets the public_vpn of this VPNMethods. # noqa: E501 - - Request IP address is owned and used by a public VPN service provider. # noqa: E501 - - :return: The public_vpn of this VPNMethods. # noqa: E501 - """ - return self._public_vpn - - @public_vpn.setter - def public_vpn(self, public_vpn: bool): - """Sets the public_vpn of this VPNMethods. - - Request IP address is owned and used by a public VPN service provider. # noqa: E501 - - :param public_vpn: The public_vpn of this VPNMethods. # noqa: E501 - """ - if public_vpn is None: - raise ValueError("Invalid value for `public_vpn`, must not be `None`") # noqa: E501 - - self._public_vpn = public_vpn +""" # noqa: E501 - @property - def auxiliary_mobile(self) -> bool: - """Gets the auxiliary_mobile of this VPNMethods. # noqa: E501 - This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. # noqa: E501 - - :return: The auxiliary_mobile of this VPNMethods. # noqa: E501 - """ - return self._auxiliary_mobile - - @auxiliary_mobile.setter - def auxiliary_mobile(self, auxiliary_mobile: bool): - """Sets the auxiliary_mobile of this VPNMethods. - - This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. # noqa: E501 - - :param auxiliary_mobile: The auxiliary_mobile of this VPNMethods. # noqa: E501 - """ - if auxiliary_mobile is None: - raise ValueError("Invalid value for `auxiliary_mobile`, must not be `None`") # noqa: E501 - - self._auxiliary_mobile = auxiliary_mobile - - @property - def os_mismatch(self) -> bool: - """Gets the os_mismatch of this VPNMethods. # noqa: E501 - - The browser runs on a different operating system than the operating system inferred from the request network signature. # noqa: E501 - - :return: The os_mismatch of this VPNMethods. # noqa: E501 - """ - return self._os_mismatch - - @os_mismatch.setter - def os_mismatch(self, os_mismatch: bool): - """Sets the os_mismatch of this VPNMethods. - - The browser runs on a different operating system than the operating system inferred from the request network signature. # noqa: E501 - - :param os_mismatch: The os_mismatch of this VPNMethods. # noqa: E501 - """ - if os_mismatch is None: - raise ValueError("Invalid value for `os_mismatch`, must not be `None`") # noqa: E501 - - self._os_mismatch = os_mismatch - - @property - def relay(self) -> bool: - """Gets the relay of this VPNMethods. # noqa: E501 - - Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. # noqa: E501 - - :return: The relay of this VPNMethods. # noqa: E501 - """ - return self._relay - - @relay.setter - def relay(self, relay: bool): - """Sets the relay of this VPNMethods. +from __future__ import annotations +import pprint +import re # noqa: F401 +import json - Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. # noqa: E501 +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self - :param relay: The relay of this VPNMethods. # noqa: E501 +class VpnMethods(BaseModel): + """ + VpnMethods + """ # noqa: E501 + timezone_mismatch: Optional[StrictBool] = Field(default=None, description="The browser timezone doesn't match the timezone inferred from the request IP address.") + public_vpn: Optional[StrictBool] = Field(default=None, description="Request IP address is owned and used by a public VPN service provider.") + auxiliary_mobile: Optional[StrictBool] = Field(default=None, description="This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices.") + os_mismatch: Optional[StrictBool] = Field(default=None, description="The browser runs on a different operating system than the operating system inferred from the request network signature.") + relay: Optional[StrictBool] = Field(default=None, description="Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. ") + __properties: ClassVar[List[str]] = ["timezone_mismatch", "public_vpn", "auxiliary_mobile", "os_mismatch", "relay"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of VpnMethods from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. """ - if relay is None: - raise ValueError("Invalid value for `relay`, must not be `None`") # noqa: E501 + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of VpnMethods from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "timezone_mismatch": obj.get("timezone_mismatch"), + "public_vpn": obj.get("public_vpn"), + "auxiliary_mobile": obj.get("auxiliary_mobile"), + "os_mismatch": obj.get("os_mismatch"), + "relay": obj.get("relay") + }) + return _obj - self._relay = relay diff --git a/fingerprint_server_sdk/models/web_gl_basics.py b/fingerprint_server_sdk/models/web_gl_basics.py new file mode 100644 index 00000000..e85a8c5c --- /dev/null +++ b/fingerprint_server_sdk/models/web_gl_basics.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class WebGlBasics(BaseModel): + """ + Render and vendor strings reported by the WebGL context. + """ # noqa: E501 + version: Optional[StrictStr] = None + vendor: Optional[StrictStr] = None + vendor_unmasked: Optional[StrictStr] = None + renderer: Optional[StrictStr] = None + renderer_unmasked: Optional[StrictStr] = None + shading_language_version: Optional[StrictStr] = None + __properties: ClassVar[List[str]] = ["version", "vendor", "vendor_unmasked", "renderer", "renderer_unmasked", "shading_language_version"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebGlBasics from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebGlBasics from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "version": obj.get("version"), + "vendor": obj.get("vendor"), + "vendor_unmasked": obj.get("vendor_unmasked"), + "renderer": obj.get("renderer"), + "renderer_unmasked": obj.get("renderer_unmasked"), + "shading_language_version": obj.get("shading_language_version") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/web_gl_extensions.py b/fingerprint_server_sdk/models/web_gl_extensions.py new file mode 100644 index 00000000..f8e320d1 --- /dev/null +++ b/fingerprint_server_sdk/models/web_gl_extensions.py @@ -0,0 +1,98 @@ +# coding: utf-8 + +""" + Server API + + Fingerprint Server API allows you to get, search, and update 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. + + The version of the OpenAPI document: 4 + Contact: support@fingerprint.com + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + + +from __future__ import annotations +import pprint +import re # noqa: F401 +import json + +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Optional, Set +from typing_extensions import Self + +class WebGlExtensions(BaseModel): + """ + Hashes of WebGL context attributes and extension support. + """ # noqa: E501 + context_attributes: Optional[StrictStr] = None + parameters: Optional[StrictStr] = None + shader_precisions: Optional[StrictStr] = None + extensions: Optional[StrictStr] = None + extension_parameters: Optional[StrictStr] = None + unsupported_extensions: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["context_attributes", "parameters", "shader_precisions", "extensions", "extension_parameters", "unsupported_extensions"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + + + def to_str(self) -> str: + """Returns the string representation of the model using alias""" + return pprint.pformat(self.model_dump(by_alias=True)) + + def to_json(self) -> str: + """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead + return json.dumps(self.to_dict()) + + @classmethod + def from_json(cls, json_str: str) -> Optional[Self]: + """Create an instance of WebGlExtensions from a JSON string""" + return cls.from_dict(json.loads(json_str)) + + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) + return _dict + + @classmethod + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: + """Create an instance of WebGlExtensions from a dict""" + if obj is None: + return None + + if not isinstance(obj, dict): + return cls.model_validate(obj) + + _obj = cls.model_validate({ + "context_attributes": obj.get("context_attributes"), + "parameters": obj.get("parameters"), + "shader_precisions": obj.get("shader_precisions"), + "extensions": obj.get("extensions"), + "extension_parameters": obj.get("extension_parameters"), + "unsupported_extensions": obj.get("unsupported_extensions") + }) + return _obj + + diff --git a/fingerprint_server_sdk/models/webhook.py b/fingerprint_server_sdk/models/webhook.py deleted file mode 100644 index 21b7cf10..00000000 --- a/fingerprint_server_sdk/models/webhook.py +++ /dev/null @@ -1,1254 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.tag import Tag -from datetime import datetime -from fingerprint_server_sdk.models.deprecated_geolocation import DeprecatedGeolocation -from fingerprint_server_sdk.models.identification_confidence import IdentificationConfidence -from fingerprint_server_sdk.models.identification_seen_at import IdentificationSeenAt -from fingerprint_server_sdk.models.identification_seen_at import IdentificationSeenAt -from fingerprint_server_sdk.models.browser_details import BrowserDetails -from fingerprint_server_sdk.models.raw_device_attributes import RawDeviceAttributes -from fingerprint_server_sdk.models.botd_bot import BotdBot -from fingerprint_server_sdk.models.webhook_root_apps import WebhookRootApps -from fingerprint_server_sdk.models.webhook_emulator import WebhookEmulator -from fingerprint_server_sdk.models.webhook_ip_info import WebhookIPInfo -from fingerprint_server_sdk.models.webhook_ip_blocklist import WebhookIPBlocklist -from fingerprint_server_sdk.models.webhook_tor import WebhookTor -from fingerprint_server_sdk.models.webhook_vpn import WebhookVPN -from fingerprint_server_sdk.models.webhook_proxy import WebhookProxy -from fingerprint_server_sdk.models.webhook_tampering import WebhookTampering -from fingerprint_server_sdk.models.webhook_cloned_app import WebhookClonedApp -from fingerprint_server_sdk.models.webhook_factory_reset import WebhookFactoryReset -from fingerprint_server_sdk.models.webhook_jailbroken import WebhookJailbroken -from fingerprint_server_sdk.models.webhook_frida import WebhookFrida -from fingerprint_server_sdk.models.webhook_privacy_settings import WebhookPrivacySettings -from fingerprint_server_sdk.models.webhook_virtual_machine import WebhookVirtualMachine -from fingerprint_server_sdk.models.webhook_raw_device_attributes import WebhookRawDeviceAttributes -from fingerprint_server_sdk.models.webhook_high_activity import WebhookHighActivity -from fingerprint_server_sdk.models.webhook_location_spoofing import WebhookLocationSpoofing -from fingerprint_server_sdk.models.webhook_suspect_score import WebhookSuspectScore -from fingerprint_server_sdk.models.webhook_remote_control import WebhookRemoteControl -from fingerprint_server_sdk.models.webhook_velocity import WebhookVelocity -from fingerprint_server_sdk.models.webhook_developer_tools import WebhookDeveloperTools -from fingerprint_server_sdk.models.webhook_mit_m_attack import WebhookMitMAttack -from fingerprint_server_sdk.models.sdk import SDK -from fingerprint_server_sdk.models.webhook_supplementary_i_ds import WebhookSupplementaryIDs -from fingerprint_server_sdk.models.webhook_proximity import WebhookProximity - - -class Webhook(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'request_id': 'str', - 'url': 'str', - 'ip': 'str', - 'environment_id': 'str', - 'tag': 'Tag', - 'time': 'datetime', - 'timestamp': 'int', - 'ip_location': 'DeprecatedGeolocation', - 'linked_id': 'str', - 'visitor_id': 'str', - 'visitor_found': 'bool', - 'confidence': 'IdentificationConfidence', - 'first_seen_at': 'IdentificationSeenAt', - 'last_seen_at': 'IdentificationSeenAt', - 'browser_details': 'BrowserDetails', - 'incognito': 'bool', - 'client_referrer': 'str', - 'components': 'RawDeviceAttributes', - 'bot': 'BotdBot', - 'user_agent': 'str', - 'root_apps': 'WebhookRootApps', - 'emulator': 'WebhookEmulator', - 'ip_info': 'WebhookIPInfo', - 'ip_blocklist': 'WebhookIPBlocklist', - 'tor': 'WebhookTor', - 'vpn': 'WebhookVPN', - 'proxy': 'WebhookProxy', - 'tampering': 'WebhookTampering', - 'cloned_app': 'WebhookClonedApp', - 'factory_reset': 'WebhookFactoryReset', - 'jailbroken': 'WebhookJailbroken', - 'frida': 'WebhookFrida', - 'privacy_settings': 'WebhookPrivacySettings', - 'virtual_machine': 'WebhookVirtualMachine', - 'raw_device_attributes': 'WebhookRawDeviceAttributes', - 'high_activity': 'WebhookHighActivity', - 'location_spoofing': 'WebhookLocationSpoofing', - 'suspect_score': 'WebhookSuspectScore', - 'remote_control': 'WebhookRemoteControl', - 'velocity': 'WebhookVelocity', - 'developer_tools': 'WebhookDeveloperTools', - 'mitm_attack': 'WebhookMitMAttack', - 'replayed': 'bool', - 'sdk': 'SDK', - 'supplementary_ids': 'WebhookSupplementaryIDs', - 'proximity': 'WebhookProximity' - } - - nullable_map = { - 'request_id': False, - 'url': False, - 'ip': False, - 'environment_id': False, - 'tag': False, - 'time': False, - 'timestamp': False, - 'ip_location': False, - 'linked_id': False, - 'visitor_id': False, - 'visitor_found': False, - 'confidence': False, - 'first_seen_at': False, - 'last_seen_at': False, - 'browser_details': False, - 'incognito': False, - 'client_referrer': False, - 'components': False, - 'bot': False, - 'user_agent': False, - 'root_apps': False, - 'emulator': False, - 'ip_info': False, - 'ip_blocklist': False, - 'tor': False, - 'vpn': False, - 'proxy': False, - 'tampering': False, - 'cloned_app': False, - 'factory_reset': False, - 'jailbroken': False, - 'frida': False, - 'privacy_settings': False, - 'virtual_machine': False, - 'raw_device_attributes': False, - 'high_activity': False, - 'location_spoofing': False, - 'suspect_score': False, - 'remote_control': False, - 'velocity': False, - 'developer_tools': False, - 'mitm_attack': False, - 'replayed': False, - 'sdk': False, - 'supplementary_ids': False, - 'proximity': False - } - - attribute_map = { - 'request_id': 'requestId', - 'url': 'url', - 'ip': 'ip', - 'environment_id': 'environmentId', - 'tag': 'tag', - 'time': 'time', - 'timestamp': 'timestamp', - 'ip_location': 'ipLocation', - 'linked_id': 'linkedId', - 'visitor_id': 'visitorId', - 'visitor_found': 'visitorFound', - 'confidence': 'confidence', - 'first_seen_at': 'firstSeenAt', - 'last_seen_at': 'lastSeenAt', - 'browser_details': 'browserDetails', - 'incognito': 'incognito', - 'client_referrer': 'clientReferrer', - 'components': 'components', - 'bot': 'bot', - 'user_agent': 'userAgent', - 'root_apps': 'rootApps', - 'emulator': 'emulator', - 'ip_info': 'ipInfo', - 'ip_blocklist': 'ipBlocklist', - 'tor': 'tor', - 'vpn': 'vpn', - 'proxy': 'proxy', - 'tampering': 'tampering', - 'cloned_app': 'clonedApp', - 'factory_reset': 'factoryReset', - 'jailbroken': 'jailbroken', - 'frida': 'frida', - 'privacy_settings': 'privacySettings', - 'virtual_machine': 'virtualMachine', - 'raw_device_attributes': 'rawDeviceAttributes', - 'high_activity': 'highActivity', - 'location_spoofing': 'locationSpoofing', - 'suspect_score': 'suspectScore', - 'remote_control': 'remoteControl', - 'velocity': 'velocity', - 'developer_tools': 'developerTools', - 'mitm_attack': 'mitmAttack', - 'replayed': 'replayed', - 'sdk': 'sdk', - 'supplementary_ids': 'supplementaryIds', - 'proximity': 'proximity' - } - - def __init__(self, request_id=None, url=None, ip=None, environment_id=None, tag=None, time=None, timestamp=None, ip_location=None, linked_id=None, visitor_id=None, visitor_found=None, confidence=None, first_seen_at=None, last_seen_at=None, browser_details=None, incognito=None, client_referrer=None, components=None, bot=None, user_agent=None, root_apps=None, emulator=None, ip_info=None, ip_blocklist=None, tor=None, vpn=None, proxy=None, tampering=None, cloned_app=None, factory_reset=None, jailbroken=None, frida=None, privacy_settings=None, virtual_machine=None, raw_device_attributes=None, high_activity=None, location_spoofing=None, suspect_score=None, remote_control=None, velocity=None, developer_tools=None, mitm_attack=None, replayed=None, sdk=None, supplementary_ids=None, proximity=None): # noqa: E501 - """Webhook - a model defined in Swagger""" # noqa: E501 - self._request_id = None - self._url = None - self._ip = None - self._environment_id = None - self._tag = None - self._time = None - self._timestamp = None - self._ip_location = None - self._linked_id = None - self._visitor_id = None - self._visitor_found = None - self._confidence = None - self._first_seen_at = None - self._last_seen_at = None - self._browser_details = None - self._incognito = None - self._client_referrer = None - self._components = None - self._bot = None - self._user_agent = None - self._root_apps = None - self._emulator = None - self._ip_info = None - self._ip_blocklist = None - self._tor = None - self._vpn = None - self._proxy = None - self._tampering = None - self._cloned_app = None - self._factory_reset = None - self._jailbroken = None - self._frida = None - self._privacy_settings = None - self._virtual_machine = None - self._raw_device_attributes = None - self._high_activity = None - self._location_spoofing = None - self._suspect_score = None - self._remote_control = None - self._velocity = None - self._developer_tools = None - self._mitm_attack = None - self._replayed = None - self._sdk = None - self._supplementary_ids = None - self._proximity = None - self.discriminator = None - self.request_id = request_id - self.url = url - self.ip = ip - if environment_id is not None: - self.environment_id = environment_id - if tag is not None: - self.tag = tag - self.time = time - self.timestamp = timestamp - if ip_location is not None: - self.ip_location = ip_location - if linked_id is not None: - self.linked_id = linked_id - if visitor_id is not None: - self.visitor_id = visitor_id - if visitor_found is not None: - self.visitor_found = visitor_found - if confidence is not None: - self.confidence = confidence - if first_seen_at is not None: - self.first_seen_at = first_seen_at - if last_seen_at is not None: - self.last_seen_at = last_seen_at - if browser_details is not None: - self.browser_details = browser_details - if incognito is not None: - self.incognito = incognito - if client_referrer is not None: - self.client_referrer = client_referrer - if components is not None: - self.components = components - if bot is not None: - self.bot = bot - if user_agent is not None: - self.user_agent = user_agent - if root_apps is not None: - self.root_apps = root_apps - if emulator is not None: - self.emulator = emulator - if ip_info is not None: - self.ip_info = ip_info - if ip_blocklist is not None: - self.ip_blocklist = ip_blocklist - if tor is not None: - self.tor = tor - if vpn is not None: - self.vpn = vpn - if proxy is not None: - self.proxy = proxy - if tampering is not None: - self.tampering = tampering - if cloned_app is not None: - self.cloned_app = cloned_app - if factory_reset is not None: - self.factory_reset = factory_reset - if jailbroken is not None: - self.jailbroken = jailbroken - if frida is not None: - self.frida = frida - if privacy_settings is not None: - self.privacy_settings = privacy_settings - if virtual_machine is not None: - self.virtual_machine = virtual_machine - if raw_device_attributes is not None: - self.raw_device_attributes = raw_device_attributes - if high_activity is not None: - self.high_activity = high_activity - if location_spoofing is not None: - self.location_spoofing = location_spoofing - if suspect_score is not None: - self.suspect_score = suspect_score - if remote_control is not None: - self.remote_control = remote_control - if velocity is not None: - self.velocity = velocity - if developer_tools is not None: - self.developer_tools = developer_tools - if mitm_attack is not None: - self.mitm_attack = mitm_attack - if replayed is not None: - self.replayed = replayed - self.sdk = sdk - if supplementary_ids is not None: - self.supplementary_ids = supplementary_ids - if proximity is not None: - self.proximity = proximity - - @property - def request_id(self) -> str: - """Gets the request_id of this Webhook. # noqa: E501 - - Unique identifier of the user's request. # noqa: E501 - - :return: The request_id of this Webhook. # noqa: E501 - """ - return self._request_id - - @request_id.setter - def request_id(self, request_id: str): - """Sets the request_id of this Webhook. - - Unique identifier of the user's request. # noqa: E501 - - :param request_id: The request_id of this Webhook. # noqa: E501 - """ - if request_id is None: - raise ValueError("Invalid value for `request_id`, must not be `None`") # noqa: E501 - - self._request_id = request_id - - @property - def url(self) -> str: - """Gets the url of this Webhook. # noqa: E501 - - Page URL from which the request was sent. # noqa: E501 - - :return: The url of this Webhook. # noqa: E501 - """ - return self._url - - @url.setter - def url(self, url: str): - """Sets the url of this Webhook. - - Page URL from which the request was sent. # noqa: E501 - - :param url: The url of this Webhook. # noqa: E501 - """ - if url is None: - raise ValueError("Invalid value for `url`, must not be `None`") # noqa: E501 - - self._url = url - - @property - def ip(self) -> str: - """Gets the ip of this Webhook. # noqa: E501 - - IP address of the requesting browser or bot. # noqa: E501 - - :return: The ip of this Webhook. # noqa: E501 - """ - return self._ip - - @ip.setter - def ip(self, ip: str): - """Sets the ip of this Webhook. - - IP address of the requesting browser or bot. # noqa: E501 - - :param ip: The ip of this Webhook. # noqa: E501 - """ - if ip is None: - raise ValueError("Invalid value for `ip`, must not be `None`") # noqa: E501 - - self._ip = ip - - @property - def environment_id(self) -> Optional[str]: - """Gets the environment_id of this Webhook. # noqa: E501 - - Environment ID of the event. # noqa: E501 - - :return: The environment_id of this Webhook. # noqa: E501 - """ - return self._environment_id - - @environment_id.setter - def environment_id(self, environment_id: Optional[str]): - """Sets the environment_id of this Webhook. - - Environment ID of the event. # noqa: E501 - - :param environment_id: The environment_id of this Webhook. # noqa: E501 - """ - - self._environment_id = environment_id - - @property - def tag(self) -> Optional[Tag]: - """Gets the tag of this Webhook. # noqa: E501 - - - :return: The tag of this Webhook. # noqa: E501 - """ - return self._tag - - @tag.setter - def tag(self, tag: Optional[Tag]): - """Sets the tag of this Webhook. - - - :param tag: The tag of this Webhook. # noqa: E501 - """ - - self._tag = tag - - @property - def time(self) -> datetime: - """Gets the time of this Webhook. # noqa: E501 - - Time expressed according to ISO 8601 in UTC format, when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. # noqa: E501 - - :return: The time of this Webhook. # noqa: E501 - """ - return self._time - - @time.setter - def time(self, time: datetime): - """Sets the time of this Webhook. - - Time expressed according to ISO 8601 in UTC format, when the request from the JS agent was made. We recommend to treat requests that are older than 2 minutes as malicious. Otherwise, request replay attacks are possible. # noqa: E501 - - :param time: The time of this Webhook. # noqa: E501 - """ - if time is None: - raise ValueError("Invalid value for `time`, must not be `None`") # noqa: E501 - - self._time = time - - @property - def timestamp(self) -> int: - """Gets the timestamp of this Webhook. # noqa: E501 - - Timestamp of the event with millisecond precision in Unix time. # noqa: E501 - - :return: The timestamp of this Webhook. # noqa: E501 - """ - return self._timestamp - - @timestamp.setter - def timestamp(self, timestamp: int): - """Sets the timestamp of this Webhook. - - Timestamp of the event with millisecond precision in Unix time. # noqa: E501 - - :param timestamp: The timestamp of this Webhook. # noqa: E501 - """ - if timestamp is None: - raise ValueError("Invalid value for `timestamp`, must not be `None`") # noqa: E501 - - self._timestamp = timestamp - - @property - def ip_location(self) -> Optional[DeprecatedGeolocation]: - """Gets the ip_location of this Webhook. # noqa: E501 - - - :return: The ip_location of this Webhook. # noqa: E501 - """ - return self._ip_location - - @ip_location.setter - def ip_location(self, ip_location: Optional[DeprecatedGeolocation]): - """Sets the ip_location of this Webhook. - - - :param ip_location: The ip_location of this Webhook. # noqa: E501 - """ - - self._ip_location = ip_location - - @property - def linked_id(self) -> Optional[str]: - """Gets the linked_id of this Webhook. # noqa: E501 - - A customer-provided id that was sent with the request. # noqa: E501 - - :return: The linked_id of this Webhook. # noqa: E501 - """ - return self._linked_id - - @linked_id.setter - def linked_id(self, linked_id: Optional[str]): - """Sets the linked_id of this Webhook. - - A customer-provided id that was sent with the request. # noqa: E501 - - :param linked_id: The linked_id of this Webhook. # noqa: E501 - """ - - self._linked_id = linked_id - - @property - def visitor_id(self) -> Optional[str]: - """Gets the visitor_id of this Webhook. # noqa: E501 - - String of 20 characters that uniquely identifies the visitor's browser or mobile device. # noqa: E501 - - :return: The visitor_id of this Webhook. # noqa: E501 - """ - return self._visitor_id - - @visitor_id.setter - def visitor_id(self, visitor_id: Optional[str]): - """Sets the visitor_id of this Webhook. - - String of 20 characters that uniquely identifies the visitor's browser or mobile device. # noqa: E501 - - :param visitor_id: The visitor_id of this Webhook. # noqa: E501 - """ - - self._visitor_id = visitor_id - - @property - def visitor_found(self) -> Optional[bool]: - """Gets the visitor_found of this Webhook. # noqa: E501 - - Attribute represents if a visitor had been identified before. # noqa: E501 - - :return: The visitor_found of this Webhook. # noqa: E501 - """ - return self._visitor_found - - @visitor_found.setter - def visitor_found(self, visitor_found: Optional[bool]): - """Sets the visitor_found of this Webhook. - - Attribute represents if a visitor had been identified before. # noqa: E501 - - :param visitor_found: The visitor_found of this Webhook. # noqa: E501 - """ - - self._visitor_found = visitor_found - - @property - def confidence(self) -> Optional[IdentificationConfidence]: - """Gets the confidence of this Webhook. # noqa: E501 - - - :return: The confidence of this Webhook. # noqa: E501 - """ - return self._confidence - - @confidence.setter - def confidence(self, confidence: Optional[IdentificationConfidence]): - """Sets the confidence of this Webhook. - - - :param confidence: The confidence of this Webhook. # noqa: E501 - """ - - self._confidence = confidence - - @property - def first_seen_at(self) -> Optional[IdentificationSeenAt]: - """Gets the first_seen_at of this Webhook. # noqa: E501 - - - :return: The first_seen_at of this Webhook. # noqa: E501 - """ - return self._first_seen_at - - @first_seen_at.setter - def first_seen_at(self, first_seen_at: Optional[IdentificationSeenAt]): - """Sets the first_seen_at of this Webhook. - - - :param first_seen_at: The first_seen_at of this Webhook. # noqa: E501 - """ - - self._first_seen_at = first_seen_at - - @property - def last_seen_at(self) -> Optional[IdentificationSeenAt]: - """Gets the last_seen_at of this Webhook. # noqa: E501 - - - :return: The last_seen_at of this Webhook. # noqa: E501 - """ - return self._last_seen_at - - @last_seen_at.setter - def last_seen_at(self, last_seen_at: Optional[IdentificationSeenAt]): - """Sets the last_seen_at of this Webhook. - - - :param last_seen_at: The last_seen_at of this Webhook. # noqa: E501 - """ - - self._last_seen_at = last_seen_at - - @property - def browser_details(self) -> Optional[BrowserDetails]: - """Gets the browser_details of this Webhook. # noqa: E501 - - - :return: The browser_details of this Webhook. # noqa: E501 - """ - return self._browser_details - - @browser_details.setter - def browser_details(self, browser_details: Optional[BrowserDetails]): - """Sets the browser_details of this Webhook. - - - :param browser_details: The browser_details of this Webhook. # noqa: E501 - """ - - self._browser_details = browser_details - - @property - def incognito(self) -> Optional[bool]: - """Gets the incognito of this Webhook. # noqa: E501 - - Flag if user used incognito session. # noqa: E501 - - :return: The incognito of this Webhook. # noqa: E501 - """ - return self._incognito - - @incognito.setter - def incognito(self, incognito: Optional[bool]): - """Sets the incognito of this Webhook. - - Flag if user used incognito session. # noqa: E501 - - :param incognito: The incognito of this Webhook. # noqa: E501 - """ - - self._incognito = incognito - - @property - def client_referrer(self) -> Optional[str]: - """Gets the client_referrer of this Webhook. # noqa: E501 - - - :return: The client_referrer of this Webhook. # noqa: E501 - """ - return self._client_referrer - - @client_referrer.setter - def client_referrer(self, client_referrer: Optional[str]): - """Sets the client_referrer of this Webhook. - - - :param client_referrer: The client_referrer of this Webhook. # noqa: E501 - """ - - self._client_referrer = client_referrer - - @property - def components(self) -> Optional[RawDeviceAttributes]: - """Gets the components of this Webhook. # noqa: E501 - - - :return: The components of this Webhook. # noqa: E501 - """ - return self._components - - @components.setter - def components(self, components: Optional[RawDeviceAttributes]): - """Sets the components of this Webhook. - - - :param components: The components of this Webhook. # noqa: E501 - """ - - self._components = components - - @property - def bot(self) -> Optional[BotdBot]: - """Gets the bot of this Webhook. # noqa: E501 - - - :return: The bot of this Webhook. # noqa: E501 - """ - return self._bot - - @bot.setter - def bot(self, bot: Optional[BotdBot]): - """Sets the bot of this Webhook. - - - :param bot: The bot of this Webhook. # noqa: E501 - """ - - self._bot = bot - - @property - def user_agent(self) -> Optional[str]: - """Gets the user_agent of this Webhook. # noqa: E501 - - - :return: The user_agent of this Webhook. # noqa: E501 - """ - return self._user_agent - - @user_agent.setter - def user_agent(self, user_agent: Optional[str]): - """Sets the user_agent of this Webhook. - - - :param user_agent: The user_agent of this Webhook. # noqa: E501 - """ - - self._user_agent = user_agent - - @property - def root_apps(self) -> Optional[WebhookRootApps]: - """Gets the root_apps of this Webhook. # noqa: E501 - - - :return: The root_apps of this Webhook. # noqa: E501 - """ - return self._root_apps - - @root_apps.setter - def root_apps(self, root_apps: Optional[WebhookRootApps]): - """Sets the root_apps of this Webhook. - - - :param root_apps: The root_apps of this Webhook. # noqa: E501 - """ - - self._root_apps = root_apps - - @property - def emulator(self) -> Optional[WebhookEmulator]: - """Gets the emulator of this Webhook. # noqa: E501 - - - :return: The emulator of this Webhook. # noqa: E501 - """ - return self._emulator - - @emulator.setter - def emulator(self, emulator: Optional[WebhookEmulator]): - """Sets the emulator of this Webhook. - - - :param emulator: The emulator of this Webhook. # noqa: E501 - """ - - self._emulator = emulator - - @property - def ip_info(self) -> Optional[WebhookIPInfo]: - """Gets the ip_info of this Webhook. # noqa: E501 - - - :return: The ip_info of this Webhook. # noqa: E501 - """ - return self._ip_info - - @ip_info.setter - def ip_info(self, ip_info: Optional[WebhookIPInfo]): - """Sets the ip_info of this Webhook. - - - :param ip_info: The ip_info of this Webhook. # noqa: E501 - """ - - self._ip_info = ip_info - - @property - def ip_blocklist(self) -> Optional[WebhookIPBlocklist]: - """Gets the ip_blocklist of this Webhook. # noqa: E501 - - - :return: The ip_blocklist of this Webhook. # noqa: E501 - """ - return self._ip_blocklist - - @ip_blocklist.setter - def ip_blocklist(self, ip_blocklist: Optional[WebhookIPBlocklist]): - """Sets the ip_blocklist of this Webhook. - - - :param ip_blocklist: The ip_blocklist of this Webhook. # noqa: E501 - """ - - self._ip_blocklist = ip_blocklist - - @property - def tor(self) -> Optional[WebhookTor]: - """Gets the tor of this Webhook. # noqa: E501 - - - :return: The tor of this Webhook. # noqa: E501 - """ - return self._tor - - @tor.setter - def tor(self, tor: Optional[WebhookTor]): - """Sets the tor of this Webhook. - - - :param tor: The tor of this Webhook. # noqa: E501 - """ - - self._tor = tor - - @property - def vpn(self) -> Optional[WebhookVPN]: - """Gets the vpn of this Webhook. # noqa: E501 - - - :return: The vpn of this Webhook. # noqa: E501 - """ - return self._vpn - - @vpn.setter - def vpn(self, vpn: Optional[WebhookVPN]): - """Sets the vpn of this Webhook. - - - :param vpn: The vpn of this Webhook. # noqa: E501 - """ - - self._vpn = vpn - - @property - def proxy(self) -> Optional[WebhookProxy]: - """Gets the proxy of this Webhook. # noqa: E501 - - - :return: The proxy of this Webhook. # noqa: E501 - """ - return self._proxy - - @proxy.setter - def proxy(self, proxy: Optional[WebhookProxy]): - """Sets the proxy of this Webhook. - - - :param proxy: The proxy of this Webhook. # noqa: E501 - """ - - self._proxy = proxy - - @property - def tampering(self) -> Optional[WebhookTampering]: - """Gets the tampering of this Webhook. # noqa: E501 - - - :return: The tampering of this Webhook. # noqa: E501 - """ - return self._tampering - - @tampering.setter - def tampering(self, tampering: Optional[WebhookTampering]): - """Sets the tampering of this Webhook. - - - :param tampering: The tampering of this Webhook. # noqa: E501 - """ - - self._tampering = tampering - - @property - def cloned_app(self) -> Optional[WebhookClonedApp]: - """Gets the cloned_app of this Webhook. # noqa: E501 - - - :return: The cloned_app of this Webhook. # noqa: E501 - """ - return self._cloned_app - - @cloned_app.setter - def cloned_app(self, cloned_app: Optional[WebhookClonedApp]): - """Sets the cloned_app of this Webhook. - - - :param cloned_app: The cloned_app of this Webhook. # noqa: E501 - """ - - self._cloned_app = cloned_app - - @property - def factory_reset(self) -> Optional[WebhookFactoryReset]: - """Gets the factory_reset of this Webhook. # noqa: E501 - - - :return: The factory_reset of this Webhook. # noqa: E501 - """ - return self._factory_reset - - @factory_reset.setter - def factory_reset(self, factory_reset: Optional[WebhookFactoryReset]): - """Sets the factory_reset of this Webhook. - - - :param factory_reset: The factory_reset of this Webhook. # noqa: E501 - """ - - self._factory_reset = factory_reset - - @property - def jailbroken(self) -> Optional[WebhookJailbroken]: - """Gets the jailbroken of this Webhook. # noqa: E501 - - - :return: The jailbroken of this Webhook. # noqa: E501 - """ - return self._jailbroken - - @jailbroken.setter - def jailbroken(self, jailbroken: Optional[WebhookJailbroken]): - """Sets the jailbroken of this Webhook. - - - :param jailbroken: The jailbroken of this Webhook. # noqa: E501 - """ - - self._jailbroken = jailbroken - - @property - def frida(self) -> Optional[WebhookFrida]: - """Gets the frida of this Webhook. # noqa: E501 - - - :return: The frida of this Webhook. # noqa: E501 - """ - return self._frida - - @frida.setter - def frida(self, frida: Optional[WebhookFrida]): - """Sets the frida of this Webhook. - - - :param frida: The frida of this Webhook. # noqa: E501 - """ - - self._frida = frida - - @property - def privacy_settings(self) -> Optional[WebhookPrivacySettings]: - """Gets the privacy_settings of this Webhook. # noqa: E501 - - - :return: The privacy_settings of this Webhook. # noqa: E501 - """ - return self._privacy_settings - - @privacy_settings.setter - def privacy_settings(self, privacy_settings: Optional[WebhookPrivacySettings]): - """Sets the privacy_settings of this Webhook. - - - :param privacy_settings: The privacy_settings of this Webhook. # noqa: E501 - """ - - self._privacy_settings = privacy_settings - - @property - def virtual_machine(self) -> Optional[WebhookVirtualMachine]: - """Gets the virtual_machine of this Webhook. # noqa: E501 - - - :return: The virtual_machine of this Webhook. # noqa: E501 - """ - return self._virtual_machine - - @virtual_machine.setter - def virtual_machine(self, virtual_machine: Optional[WebhookVirtualMachine]): - """Sets the virtual_machine of this Webhook. - - - :param virtual_machine: The virtual_machine of this Webhook. # noqa: E501 - """ - - self._virtual_machine = virtual_machine - - @property - def raw_device_attributes(self) -> Optional[WebhookRawDeviceAttributes]: - """Gets the raw_device_attributes of this Webhook. # noqa: E501 - - - :return: The raw_device_attributes of this Webhook. # noqa: E501 - """ - return self._raw_device_attributes - - @raw_device_attributes.setter - def raw_device_attributes(self, raw_device_attributes: Optional[WebhookRawDeviceAttributes]): - """Sets the raw_device_attributes of this Webhook. - - - :param raw_device_attributes: The raw_device_attributes of this Webhook. # noqa: E501 - """ - - self._raw_device_attributes = raw_device_attributes - - @property - def high_activity(self) -> Optional[WebhookHighActivity]: - """Gets the high_activity of this Webhook. # noqa: E501 - - - :return: The high_activity of this Webhook. # noqa: E501 - """ - return self._high_activity - - @high_activity.setter - def high_activity(self, high_activity: Optional[WebhookHighActivity]): - """Sets the high_activity of this Webhook. - - - :param high_activity: The high_activity of this Webhook. # noqa: E501 - """ - - self._high_activity = high_activity - - @property - def location_spoofing(self) -> Optional[WebhookLocationSpoofing]: - """Gets the location_spoofing of this Webhook. # noqa: E501 - - - :return: The location_spoofing of this Webhook. # noqa: E501 - """ - return self._location_spoofing - - @location_spoofing.setter - def location_spoofing(self, location_spoofing: Optional[WebhookLocationSpoofing]): - """Sets the location_spoofing of this Webhook. - - - :param location_spoofing: The location_spoofing of this Webhook. # noqa: E501 - """ - - self._location_spoofing = location_spoofing - - @property - def suspect_score(self) -> Optional[WebhookSuspectScore]: - """Gets the suspect_score of this Webhook. # noqa: E501 - - - :return: The suspect_score of this Webhook. # noqa: E501 - """ - return self._suspect_score - - @suspect_score.setter - def suspect_score(self, suspect_score: Optional[WebhookSuspectScore]): - """Sets the suspect_score of this Webhook. - - - :param suspect_score: The suspect_score of this Webhook. # noqa: E501 - """ - - self._suspect_score = suspect_score - - @property - def remote_control(self) -> Optional[WebhookRemoteControl]: - """Gets the remote_control of this Webhook. # noqa: E501 - - - :return: The remote_control of this Webhook. # noqa: E501 - """ - return self._remote_control - - @remote_control.setter - def remote_control(self, remote_control: Optional[WebhookRemoteControl]): - """Sets the remote_control of this Webhook. - - - :param remote_control: The remote_control of this Webhook. # noqa: E501 - """ - - self._remote_control = remote_control - - @property - def velocity(self) -> Optional[WebhookVelocity]: - """Gets the velocity of this Webhook. # noqa: E501 - - - :return: The velocity of this Webhook. # noqa: E501 - """ - return self._velocity - - @velocity.setter - def velocity(self, velocity: Optional[WebhookVelocity]): - """Sets the velocity of this Webhook. - - - :param velocity: The velocity of this Webhook. # noqa: E501 - """ - - self._velocity = velocity - - @property - def developer_tools(self) -> Optional[WebhookDeveloperTools]: - """Gets the developer_tools of this Webhook. # noqa: E501 - - - :return: The developer_tools of this Webhook. # noqa: E501 - """ - return self._developer_tools - - @developer_tools.setter - def developer_tools(self, developer_tools: Optional[WebhookDeveloperTools]): - """Sets the developer_tools of this Webhook. - - - :param developer_tools: The developer_tools of this Webhook. # noqa: E501 - """ - - self._developer_tools = developer_tools - - @property - def mitm_attack(self) -> Optional[WebhookMitMAttack]: - """Gets the mitm_attack of this Webhook. # noqa: E501 - - - :return: The mitm_attack of this Webhook. # noqa: E501 - """ - return self._mitm_attack - - @mitm_attack.setter - def mitm_attack(self, mitm_attack: Optional[WebhookMitMAttack]): - """Sets the mitm_attack of this Webhook. - - - :param mitm_attack: The mitm_attack of this Webhook. # noqa: E501 - """ - - self._mitm_attack = mitm_attack - - @property - def replayed(self) -> Optional[bool]: - """Gets the replayed of this Webhook. # noqa: E501 - - `true` if we determined that this payload was replayed, `false` otherwise. # noqa: E501 - - :return: The replayed of this Webhook. # noqa: E501 - """ - return self._replayed - - @replayed.setter - def replayed(self, replayed: Optional[bool]): - """Sets the replayed of this Webhook. - - `true` if we determined that this payload was replayed, `false` otherwise. # noqa: E501 - - :param replayed: The replayed of this Webhook. # noqa: E501 - """ - - self._replayed = replayed - - @property - def sdk(self) -> SDK: - """Gets the sdk of this Webhook. # noqa: E501 - - - :return: The sdk of this Webhook. # noqa: E501 - """ - return self._sdk - - @sdk.setter - def sdk(self, sdk: SDK): - """Sets the sdk of this Webhook. - - - :param sdk: The sdk of this Webhook. # noqa: E501 - """ - if sdk is None: - raise ValueError("Invalid value for `sdk`, must not be `None`") # noqa: E501 - - self._sdk = sdk - - @property - def supplementary_ids(self) -> Optional[WebhookSupplementaryIDs]: - """Gets the supplementary_ids of this Webhook. # noqa: E501 - - - :return: The supplementary_ids of this Webhook. # noqa: E501 - """ - return self._supplementary_ids - - @supplementary_ids.setter - def supplementary_ids(self, supplementary_ids: Optional[WebhookSupplementaryIDs]): - """Sets the supplementary_ids of this Webhook. - - - :param supplementary_ids: The supplementary_ids of this Webhook. # noqa: E501 - """ - - self._supplementary_ids = supplementary_ids - - @property - def proximity(self) -> Optional[WebhookProximity]: - """Gets the proximity of this Webhook. # noqa: E501 - - - :return: The proximity of this Webhook. # noqa: E501 - """ - return self._proximity - - @proximity.setter - def proximity(self, proximity: Optional[WebhookProximity]): - """Sets the proximity of this Webhook. - - - :param proximity: The proximity of this Webhook. # noqa: E501 - """ - - self._proximity = proximity - diff --git a/fingerprint_server_sdk/models/webhook_cloned_app.py b/fingerprint_server_sdk/models/webhook_cloned_app.py deleted file mode 100644 index 7d35e01a..00000000 --- a/fingerprint_server_sdk/models/webhook_cloned_app.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class WebhookClonedApp(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """WebhookClonedApp - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - if result is not None: - self.result = result - - @property - def result(self) -> Optional[bool]: - """Gets the result of this WebhookClonedApp. # noqa: E501 - - Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. # noqa: E501 - - :return: The result of this WebhookClonedApp. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[bool]): - """Sets the result of this WebhookClonedApp. - - Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. # noqa: E501 - - :param result: The result of this WebhookClonedApp. # noqa: E501 - """ - - self._result = result - diff --git a/fingerprint_server_sdk/models/webhook_developer_tools.py b/fingerprint_server_sdk/models/webhook_developer_tools.py deleted file mode 100644 index f6c8d7d1..00000000 --- a/fingerprint_server_sdk/models/webhook_developer_tools.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class WebhookDeveloperTools(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """WebhookDeveloperTools - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - if result is not None: - self.result = result - - @property - def result(self) -> Optional[bool]: - """Gets the result of this WebhookDeveloperTools. # noqa: E501 - - `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. # noqa: E501 - - :return: The result of this WebhookDeveloperTools. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[bool]): - """Sets the result of this WebhookDeveloperTools. - - `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. # noqa: E501 - - :param result: The result of this WebhookDeveloperTools. # noqa: E501 - """ - - self._result = result - diff --git a/fingerprint_server_sdk/models/webhook_emulator.py b/fingerprint_server_sdk/models/webhook_emulator.py deleted file mode 100644 index 8f650ea1..00000000 --- a/fingerprint_server_sdk/models/webhook_emulator.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class WebhookEmulator(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """WebhookEmulator - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - if result is not None: - self.result = result - - @property - def result(self) -> Optional[bool]: - """Gets the result of this WebhookEmulator. # noqa: E501 - - Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. # noqa: E501 - - :return: The result of this WebhookEmulator. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[bool]): - """Sets the result of this WebhookEmulator. - - Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. # noqa: E501 - - :param result: The result of this WebhookEmulator. # noqa: E501 - """ - - self._result = result - diff --git a/fingerprint_server_sdk/models/webhook_factory_reset.py b/fingerprint_server_sdk/models/webhook_factory_reset.py deleted file mode 100644 index 9cf078d0..00000000 --- a/fingerprint_server_sdk/models/webhook_factory_reset.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from datetime import datetime - - -class WebhookFactoryReset(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'time': 'datetime', - 'timestamp': 'int' - } - - nullable_map = { - 'time': False, - 'timestamp': False - } - - attribute_map = { - 'time': 'time', - 'timestamp': 'timestamp' - } - - def __init__(self, time=None, timestamp=None): # noqa: E501 - """WebhookFactoryReset - a model defined in Swagger""" # noqa: E501 - self._time = None - self._timestamp = None - self.discriminator = None - if time is not None: - self.time = time - if timestamp is not None: - self.timestamp = timestamp - - @property - def time(self) -> Optional[datetime]: - """Gets the time of this WebhookFactoryReset. # noqa: E501 - - Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. # noqa: E501 - - :return: The time of this WebhookFactoryReset. # noqa: E501 - """ - return self._time - - @time.setter - def time(self, time: Optional[datetime]): - """Sets the time of this WebhookFactoryReset. - - Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. # noqa: E501 - - :param time: The time of this WebhookFactoryReset. # noqa: E501 - """ - - self._time = time - - @property - def timestamp(self) -> Optional[int]: - """Gets the timestamp of this WebhookFactoryReset. # noqa: E501 - - This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. # noqa: E501 - - :return: The timestamp of this WebhookFactoryReset. # noqa: E501 - """ - return self._timestamp - - @timestamp.setter - def timestamp(self, timestamp: Optional[int]): - """Sets the timestamp of this WebhookFactoryReset. - - This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. # noqa: E501 - - :param timestamp: The timestamp of this WebhookFactoryReset. # noqa: E501 - """ - - self._timestamp = timestamp - diff --git a/fingerprint_server_sdk/models/webhook_frida.py b/fingerprint_server_sdk/models/webhook_frida.py deleted file mode 100644 index bdea65a6..00000000 --- a/fingerprint_server_sdk/models/webhook_frida.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class WebhookFrida(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """WebhookFrida - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - if result is not None: - self.result = result - - @property - def result(self) -> Optional[bool]: - """Gets the result of this WebhookFrida. # noqa: E501 - - [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. # noqa: E501 - - :return: The result of this WebhookFrida. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[bool]): - """Sets the result of this WebhookFrida. - - [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. # noqa: E501 - - :param result: The result of this WebhookFrida. # noqa: E501 - """ - - self._result = result - diff --git a/fingerprint_server_sdk/models/webhook_high_activity.py b/fingerprint_server_sdk/models/webhook_high_activity.py deleted file mode 100644 index a8bbf66a..00000000 --- a/fingerprint_server_sdk/models/webhook_high_activity.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class WebhookHighActivity(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool', - 'daily_requests': 'int' - } - - nullable_map = { - 'result': False, - 'daily_requests': False - } - - attribute_map = { - 'result': 'result', - 'daily_requests': 'dailyRequests' - } - - def __init__(self, result=None, daily_requests=None): # noqa: E501 - """WebhookHighActivity - a model defined in Swagger""" # noqa: E501 - self._result = None - self._daily_requests = None - self.discriminator = None - self.result = result - if daily_requests is not None: - self.daily_requests = daily_requests - - @property - def result(self) -> bool: - """Gets the result of this WebhookHighActivity. # noqa: E501 - - Flag indicating if the request came from a high-activity visitor. # noqa: E501 - - :return: The result of this WebhookHighActivity. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: bool): - """Sets the result of this WebhookHighActivity. - - Flag indicating if the request came from a high-activity visitor. # noqa: E501 - - :param result: The result of this WebhookHighActivity. # noqa: E501 - """ - if result is None: - raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 - - self._result = result - - @property - def daily_requests(self) -> Optional[int]: - """Gets the daily_requests of this WebhookHighActivity. # noqa: E501 - - Number of requests from the same visitor in the previous day. # noqa: E501 - - :return: The daily_requests of this WebhookHighActivity. # noqa: E501 - """ - return self._daily_requests - - @daily_requests.setter - def daily_requests(self, daily_requests: Optional[int]): - """Sets the daily_requests of this WebhookHighActivity. - - Number of requests from the same visitor in the previous day. # noqa: E501 - - :param daily_requests: The daily_requests of this WebhookHighActivity. # noqa: E501 - """ - - self._daily_requests = daily_requests - diff --git a/fingerprint_server_sdk/models/webhook_ip_blocklist.py b/fingerprint_server_sdk/models/webhook_ip_blocklist.py deleted file mode 100644 index 3bf21670..00000000 --- a/fingerprint_server_sdk/models/webhook_ip_blocklist.py +++ /dev/null @@ -1,95 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.ip_blocklist_details import IPBlocklistDetails - - -class WebhookIPBlocklist(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool', - 'details': 'IPBlocklistDetails' - } - - nullable_map = { - 'result': False, - 'details': False - } - - attribute_map = { - 'result': 'result', - 'details': 'details' - } - - def __init__(self, result=None, details=None): # noqa: E501 - """WebhookIPBlocklist - a model defined in Swagger""" # noqa: E501 - self._result = None - self._details = None - self.discriminator = None - if result is not None: - self.result = result - if details is not None: - self.details = details - - @property - def result(self) -> Optional[bool]: - """Gets the result of this WebhookIPBlocklist. # noqa: E501 - - `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. # noqa: E501 - - :return: The result of this WebhookIPBlocklist. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[bool]): - """Sets the result of this WebhookIPBlocklist. - - `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. # noqa: E501 - - :param result: The result of this WebhookIPBlocklist. # noqa: E501 - """ - - self._result = result - - @property - def details(self) -> Optional[IPBlocklistDetails]: - """Gets the details of this WebhookIPBlocklist. # noqa: E501 - - - :return: The details of this WebhookIPBlocklist. # noqa: E501 - """ - return self._details - - @details.setter - def details(self, details: Optional[IPBlocklistDetails]): - """Sets the details of this WebhookIPBlocklist. - - - :param details: The details of this WebhookIPBlocklist. # noqa: E501 - """ - - self._details = details - diff --git a/fingerprint_server_sdk/models/webhook_ip_info.py b/fingerprint_server_sdk/models/webhook_ip_info.py deleted file mode 100644 index 845fbca9..00000000 --- a/fingerprint_server_sdk/models/webhook_ip_info.py +++ /dev/null @@ -1,97 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.ip_info_v4 import IPInfoV4 -from fingerprint_server_sdk.models.ip_info_v6 import IPInfoV6 - - -class WebhookIPInfo(BaseModel): - """ - Details about the request IP address. Has separate fields for v4 and v6 IP address versions. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'v4': 'IPInfoV4', - 'v6': 'IPInfoV6' - } - - nullable_map = { - 'v4': False, - 'v6': False - } - - attribute_map = { - 'v4': 'v4', - 'v6': 'v6' - } - - def __init__(self, v4=None, v6=None): # noqa: E501 - """WebhookIPInfo - a model defined in Swagger""" # noqa: E501 - self._v4 = None - self._v6 = None - self.discriminator = None - if v4 is not None: - self.v4 = v4 - if v6 is not None: - self.v6 = v6 - - @property - def v4(self) -> Optional[IPInfoV4]: - """Gets the v4 of this WebhookIPInfo. # noqa: E501 - - - :return: The v4 of this WebhookIPInfo. # noqa: E501 - """ - return self._v4 - - @v4.setter - def v4(self, v4: Optional[IPInfoV4]): - """Sets the v4 of this WebhookIPInfo. - - - :param v4: The v4 of this WebhookIPInfo. # noqa: E501 - """ - - self._v4 = v4 - - @property - def v6(self) -> Optional[IPInfoV6]: - """Gets the v6 of this WebhookIPInfo. # noqa: E501 - - - :return: The v6 of this WebhookIPInfo. # noqa: E501 - """ - return self._v6 - - @v6.setter - def v6(self, v6: Optional[IPInfoV6]): - """Sets the v6 of this WebhookIPInfo. - - - :param v6: The v6 of this WebhookIPInfo. # noqa: E501 - """ - - self._v6 = v6 - diff --git a/fingerprint_server_sdk/models/webhook_jailbroken.py b/fingerprint_server_sdk/models/webhook_jailbroken.py deleted file mode 100644 index c6783ad8..00000000 --- a/fingerprint_server_sdk/models/webhook_jailbroken.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class WebhookJailbroken(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """WebhookJailbroken - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - if result is not None: - self.result = result - - @property - def result(self) -> Optional[bool]: - """Gets the result of this WebhookJailbroken. # noqa: E501 - - iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. # noqa: E501 - - :return: The result of this WebhookJailbroken. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[bool]): - """Sets the result of this WebhookJailbroken. - - iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. # noqa: E501 - - :param result: The result of this WebhookJailbroken. # noqa: E501 - """ - - self._result = result - diff --git a/fingerprint_server_sdk/models/webhook_location_spoofing.py b/fingerprint_server_sdk/models/webhook_location_spoofing.py deleted file mode 100644 index dfb51c8d..00000000 --- a/fingerprint_server_sdk/models/webhook_location_spoofing.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class WebhookLocationSpoofing(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """WebhookLocationSpoofing - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - if result is not None: - self.result = result - - @property - def result(self) -> Optional[bool]: - """Gets the result of this WebhookLocationSpoofing. # noqa: E501 - - Flag indicating whether the request came from a mobile device with location spoofing enabled. # noqa: E501 - - :return: The result of this WebhookLocationSpoofing. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[bool]): - """Sets the result of this WebhookLocationSpoofing. - - Flag indicating whether the request came from a mobile device with location spoofing enabled. # noqa: E501 - - :param result: The result of this WebhookLocationSpoofing. # noqa: E501 - """ - - self._result = result - diff --git a/fingerprint_server_sdk/models/webhook_mit_m_attack.py b/fingerprint_server_sdk/models/webhook_mit_m_attack.py deleted file mode 100644 index ccd685fb..00000000 --- a/fingerprint_server_sdk/models/webhook_mit_m_attack.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class WebhookMitMAttack(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """WebhookMitMAttack - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - if result is not None: - self.result = result - - @property - def result(self) -> Optional[bool]: - """Gets the result of this WebhookMitMAttack. # noqa: E501 - - * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-overview#mitm-attack-detection) to learn more about this Smart Signal. # noqa: E501 - - :return: The result of this WebhookMitMAttack. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[bool]): - """Sets the result of this WebhookMitMAttack. - - * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-overview#mitm-attack-detection) to learn more about this Smart Signal. # noqa: E501 - - :param result: The result of this WebhookMitMAttack. # noqa: E501 - """ - - self._result = result - diff --git a/fingerprint_server_sdk/models/webhook_privacy_settings.py b/fingerprint_server_sdk/models/webhook_privacy_settings.py deleted file mode 100644 index 2eaa78e3..00000000 --- a/fingerprint_server_sdk/models/webhook_privacy_settings.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class WebhookPrivacySettings(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """WebhookPrivacySettings - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - if result is not None: - self.result = result - - @property - def result(self) -> Optional[bool]: - """Gets the result of this WebhookPrivacySettings. # noqa: E501 - - `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. # noqa: E501 - - :return: The result of this WebhookPrivacySettings. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[bool]): - """Sets the result of this WebhookPrivacySettings. - - `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. # noqa: E501 - - :param result: The result of this WebhookPrivacySettings. # noqa: E501 - """ - - self._result = result - diff --git a/fingerprint_server_sdk/models/webhook_proximity.py b/fingerprint_server_sdk/models/webhook_proximity.py deleted file mode 100644 index 90fd725b..00000000 --- a/fingerprint_server_sdk/models/webhook_proximity.py +++ /dev/null @@ -1,135 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class WebhookProximity(BaseModel): - """ - Proximity ID represents a fixed geographical zone in a discrete global grid within which the device is observed. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'id': 'str', - 'precision_radius': 'int', - 'confidence': 'float' - } - - nullable_map = { - 'id': False, - 'precision_radius': False, - 'confidence': False - } - - attribute_map = { - 'id': 'id', - 'precision_radius': 'precisionRadius', - 'confidence': 'confidence' - } - - def __init__(self, id=None, precision_radius=None, confidence=None): # noqa: E501 - """WebhookProximity - a model defined in Swagger""" # noqa: E501 - self._id = None - self._precision_radius = None - self._confidence = None - self.discriminator = None - self.id = id - self.precision_radius = precision_radius - self.confidence = confidence - - @property - def id(self) -> str: - """Gets the id of this WebhookProximity. # noqa: E501 - - A stable privacy-preserving identifier for a given proximity zone. # noqa: E501 - - :return: The id of this WebhookProximity. # noqa: E501 - """ - return self._id - - @id.setter - def id(self, id: str): - """Sets the id of this WebhookProximity. - - A stable privacy-preserving identifier for a given proximity zone. # noqa: E501 - - :param id: The id of this WebhookProximity. # noqa: E501 - """ - if id is None: - raise ValueError("Invalid value for `id`, must not be `None`") # noqa: E501 - - self._id = id - - @property - def precision_radius(self) -> int: - """Gets the precision_radius of this WebhookProximity. # noqa: E501 - - The radius of the proximity zone’s precision level, in meters. # noqa: E501 - - :return: The precision_radius of this WebhookProximity. # noqa: E501 - """ - return self._precision_radius - - @precision_radius.setter - def precision_radius(self, precision_radius: int): - """Sets the precision_radius of this WebhookProximity. - - The radius of the proximity zone’s precision level, in meters. # noqa: E501 - - :param precision_radius: The precision_radius of this WebhookProximity. # noqa: E501 - """ - if precision_radius is None: - raise ValueError("Invalid value for `precision_radius`, must not be `None`") # noqa: E501 - allowed_values = [10, 25, 65, 175, 450, 1200, 3300, 8500, 22500] # noqa: E501 - if (precision_radius not in allowed_values): - raise ValueError( - "Invalid value for `precision_radius` ({0}), must be one of {1}" # noqa: E501 - .format(precision_radius, allowed_values) - ) - - self._precision_radius = precision_radius - - @property - def confidence(self) -> float: - """Gets the confidence of this WebhookProximity. # noqa: E501 - - A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. # noqa: E501 - - :return: The confidence of this WebhookProximity. # noqa: E501 - """ - return self._confidence - - @confidence.setter - def confidence(self, confidence: float): - """Sets the confidence of this WebhookProximity. - - A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. # noqa: E501 - - :param confidence: The confidence of this WebhookProximity. # noqa: E501 - """ - if confidence is None: - raise ValueError("Invalid value for `confidence`, must not be `None`") # noqa: E501 - - self._confidence = confidence - diff --git a/fingerprint_server_sdk/models/webhook_proxy.py b/fingerprint_server_sdk/models/webhook_proxy.py deleted file mode 100644 index 14c35cde..00000000 --- a/fingerprint_server_sdk/models/webhook_proxy.py +++ /dev/null @@ -1,121 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.proxy_confidence import ProxyConfidence -from fingerprint_server_sdk.models.proxy_details import ProxyDetails - - -class WebhookProxy(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool', - 'confidence': 'ProxyConfidence', - 'details': 'ProxyDetails' - } - - nullable_map = { - 'result': False, - 'confidence': False, - 'details': False - } - - attribute_map = { - 'result': 'result', - 'confidence': 'confidence', - 'details': 'details' - } - - def __init__(self, result=None, confidence=None, details=None): # noqa: E501 - """WebhookProxy - a model defined in Swagger""" # noqa: E501 - self._result = None - self._confidence = None - self._details = None - self.discriminator = None - if result is not None: - self.result = result - if confidence is not None: - self.confidence = confidence - if details is not None: - self.details = details - - @property - def result(self) -> Optional[bool]: - """Gets the result of this WebhookProxy. # noqa: E501 - - IP address was used by a public proxy provider or belonged to a known recent residential proxy # noqa: E501 - - :return: The result of this WebhookProxy. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[bool]): - """Sets the result of this WebhookProxy. - - IP address was used by a public proxy provider or belonged to a known recent residential proxy # noqa: E501 - - :param result: The result of this WebhookProxy. # noqa: E501 - """ - - self._result = result - - @property - def confidence(self) -> Optional[ProxyConfidence]: - """Gets the confidence of this WebhookProxy. # noqa: E501 - - - :return: The confidence of this WebhookProxy. # noqa: E501 - """ - return self._confidence - - @confidence.setter - def confidence(self, confidence: Optional[ProxyConfidence]): - """Sets the confidence of this WebhookProxy. - - - :param confidence: The confidence of this WebhookProxy. # noqa: E501 - """ - - self._confidence = confidence - - @property - def details(self) -> Optional[ProxyDetails]: - """Gets the details of this WebhookProxy. # noqa: E501 - - - :return: The details of this WebhookProxy. # noqa: E501 - """ - return self._details - - @details.setter - def details(self, details: Optional[ProxyDetails]): - """Sets the details of this WebhookProxy. - - - :param details: The details of this WebhookProxy. # noqa: E501 - """ - - self._details = details - diff --git a/fingerprint_server_sdk/models/webhook_raw_device_attributes.py b/fingerprint_server_sdk/models/webhook_raw_device_attributes.py deleted file mode 100644 index eff95983..00000000 --- a/fingerprint_server_sdk/models/webhook_raw_device_attributes.py +++ /dev/null @@ -1,43 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class WebhookRawDeviceAttributes(dict): - """ - It includes 35+ raw browser identification attributes to provide Fingerprint users with even more information than our standard visitor ID provides. This enables Fingerprint users to not have to run our open-source product in conjunction with Fingerprint Pro Plus and Enterprise to get those additional attributes. Warning: The raw signals data can change at any moment as we improve the product. We cannot guarantee the internal shape of raw device attributes to be stable, so typical semantic versioning rules do not apply here. Use this data with caution without assuming a specific structure beyond the generic type provided here. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - } - - nullable_map = { - } - - attribute_map = { - } - - __parent_class__ = 'dict' - diff --git a/fingerprint_server_sdk/models/webhook_remote_control.py b/fingerprint_server_sdk/models/webhook_remote_control.py deleted file mode 100644 index 838fe5fe..00000000 --- a/fingerprint_server_sdk/models/webhook_remote_control.py +++ /dev/null @@ -1,74 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from typing_extensions import deprecated - - -@deprecated("This class is deprecated. Please avoid using it in new code.") -class WebhookRemoteControl(BaseModel): - """ - This signal is deprecated. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """WebhookRemoteControl - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - if result is not None: - self.result = result - - @property - def result(self) -> Optional[bool]: - """Gets the result of this WebhookRemoteControl. # noqa: E501 - - `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. # noqa: E501 - - :return: The result of this WebhookRemoteControl. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[bool]): - """Sets the result of this WebhookRemoteControl. - - `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. # noqa: E501 - - :param result: The result of this WebhookRemoteControl. # noqa: E501 - """ - - self._result = result - diff --git a/fingerprint_server_sdk/models/webhook_root_apps.py b/fingerprint_server_sdk/models/webhook_root_apps.py deleted file mode 100644 index da5df5eb..00000000 --- a/fingerprint_server_sdk/models/webhook_root_apps.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class WebhookRootApps(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """WebhookRootApps - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - if result is not None: - self.result = result - - @property - def result(self) -> Optional[bool]: - """Gets the result of this WebhookRootApps. # noqa: E501 - - Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. # noqa: E501 - - :return: The result of this WebhookRootApps. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[bool]): - """Sets the result of this WebhookRootApps. - - Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. # noqa: E501 - - :param result: The result of this WebhookRootApps. # noqa: E501 - """ - - self._result = result - diff --git a/fingerprint_server_sdk/models/webhook_supplementary_i_ds.py b/fingerprint_server_sdk/models/webhook_supplementary_i_ds.py deleted file mode 100644 index 5c833426..00000000 --- a/fingerprint_server_sdk/models/webhook_supplementary_i_ds.py +++ /dev/null @@ -1,99 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.supplementary_id import SupplementaryID -from fingerprint_server_sdk.models.supplementary_id import SupplementaryID - - -class WebhookSupplementaryIDs(BaseModel): - """ - Other identities that have been established for a given Visitor. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'standard': 'SupplementaryID', - 'high_recall': 'SupplementaryID' - } - - nullable_map = { - 'standard': False, - 'high_recall': False - } - - attribute_map = { - 'standard': 'standard', - 'high_recall': 'highRecall' - } - - def __init__(self, standard=None, high_recall=None): # noqa: E501 - """WebhookSupplementaryIDs - a model defined in Swagger""" # noqa: E501 - self._standard = None - self._high_recall = None - self.discriminator = None - self.standard = standard - self.high_recall = high_recall - - @property - def standard(self) -> SupplementaryID: - """Gets the standard of this WebhookSupplementaryIDs. # noqa: E501 - - - :return: The standard of this WebhookSupplementaryIDs. # noqa: E501 - """ - return self._standard - - @standard.setter - def standard(self, standard: SupplementaryID): - """Sets the standard of this WebhookSupplementaryIDs. - - - :param standard: The standard of this WebhookSupplementaryIDs. # noqa: E501 - """ - if standard is None: - raise ValueError("Invalid value for `standard`, must not be `None`") # noqa: E501 - - self._standard = standard - - @property - def high_recall(self) -> SupplementaryID: - """Gets the high_recall of this WebhookSupplementaryIDs. # noqa: E501 - - - :return: The high_recall of this WebhookSupplementaryIDs. # noqa: E501 - """ - return self._high_recall - - @high_recall.setter - def high_recall(self, high_recall: SupplementaryID): - """Sets the high_recall of this WebhookSupplementaryIDs. - - - :param high_recall: The high_recall of this WebhookSupplementaryIDs. # noqa: E501 - """ - if high_recall is None: - raise ValueError("Invalid value for `high_recall`, must not be `None`") # noqa: E501 - - self._high_recall = high_recall - diff --git a/fingerprint_server_sdk/models/webhook_suspect_score.py b/fingerprint_server_sdk/models/webhook_suspect_score.py deleted file mode 100644 index 8f26443d..00000000 --- a/fingerprint_server_sdk/models/webhook_suspect_score.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class WebhookSuspectScore(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'int' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """WebhookSuspectScore - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - if result is not None: - self.result = result - - @property - def result(self) -> Optional[int]: - """Gets the result of this WebhookSuspectScore. # noqa: E501 - - Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score # noqa: E501 - - :return: The result of this WebhookSuspectScore. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[int]): - """Sets the result of this WebhookSuspectScore. - - Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score # noqa: E501 - - :param result: The result of this WebhookSuspectScore. # noqa: E501 - """ - - self._result = result - diff --git a/fingerprint_server_sdk/models/webhook_tampering.py b/fingerprint_server_sdk/models/webhook_tampering.py deleted file mode 100644 index a54ef829..00000000 --- a/fingerprint_server_sdk/models/webhook_tampering.py +++ /dev/null @@ -1,123 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class WebhookTampering(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool', - 'anomaly_score': 'float', - 'anti_detect_browser': 'bool' - } - - nullable_map = { - 'result': False, - 'anomaly_score': False, - 'anti_detect_browser': False - } - - attribute_map = { - 'result': 'result', - 'anomaly_score': 'anomalyScore', - 'anti_detect_browser': 'antiDetectBrowser' - } - - def __init__(self, result=None, anomaly_score=None, anti_detect_browser=None): # noqa: E501 - """WebhookTampering - a model defined in Swagger""" # noqa: E501 - self._result = None - self._anomaly_score = None - self._anti_detect_browser = None - self.discriminator = None - if result is not None: - self.result = result - if anomaly_score is not None: - self.anomaly_score = anomaly_score - if anti_detect_browser is not None: - self.anti_detect_browser = anti_detect_browser - - @property - def result(self) -> Optional[bool]: - """Gets the result of this WebhookTampering. # noqa: E501 - - Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. # noqa: E501 - - :return: The result of this WebhookTampering. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[bool]): - """Sets the result of this WebhookTampering. - - Indicates if an identification request from a browser or an Android SDK has been tampered with. Not supported in the iOS SDK, is always `false` for iOS requests. * `true` - If the request meets either of the following conditions: * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). * `false` - If the request is considered genuine or was generated by the iOS SDK. # noqa: E501 - - :param result: The result of this WebhookTampering. # noqa: E501 - """ - - self._result = result - - @property - def anomaly_score(self) -> Optional[float]: - """Gets the anomaly_score of this WebhookTampering. # noqa: E501 - - A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. # noqa: E501 - - :return: The anomaly_score of this WebhookTampering. # noqa: E501 - """ - return self._anomaly_score - - @anomaly_score.setter - def anomaly_score(self, anomaly_score: Optional[float]): - """Sets the anomaly_score of this WebhookTampering. - - A score that indicates the extent of anomalous data in the request. This field applies to requests originating from **both** browsers and Android SDKs. * Values above `0.5` indicate that the request has been tampered with. * Values below `0.5` indicate that the request is genuine. # noqa: E501 - - :param anomaly_score: The anomaly_score of this WebhookTampering. # noqa: E501 - """ - - self._anomaly_score = anomaly_score - - @property - def anti_detect_browser(self) -> Optional[bool]: - """Gets the anti_detect_browser of this WebhookTampering. # noqa: E501 - - Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. # noqa: E501 - - :return: The anti_detect_browser of this WebhookTampering. # noqa: E501 - """ - return self._anti_detect_browser - - @anti_detect_browser.setter - def anti_detect_browser(self, anti_detect_browser: Optional[bool]): - """Sets the anti_detect_browser of this WebhookTampering. - - Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. This field does not apply to requests originating from mobile SDKs. * `true` - The browser resembles a known anti-detect browser, for example, Incognition. * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. # noqa: E501 - - :param anti_detect_browser: The anti_detect_browser of this WebhookTampering. # noqa: E501 - """ - - self._anti_detect_browser = anti_detect_browser - diff --git a/fingerprint_server_sdk/models/webhook_tor.py b/fingerprint_server_sdk/models/webhook_tor.py deleted file mode 100644 index 7607c0f3..00000000 --- a/fingerprint_server_sdk/models/webhook_tor.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class WebhookTor(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """WebhookTor - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - if result is not None: - self.result = result - - @property - def result(self) -> Optional[bool]: - """Gets the result of this WebhookTor. # noqa: E501 - - `true` if the request IP address is a known tor exit node, `false` otherwise. # noqa: E501 - - :return: The result of this WebhookTor. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[bool]): - """Sets the result of this WebhookTor. - - `true` if the request IP address is a known tor exit node, `false` otherwise. # noqa: E501 - - :param result: The result of this WebhookTor. # noqa: E501 - """ - - self._result = result - diff --git a/fingerprint_server_sdk/models/webhook_velocity.py b/fingerprint_server_sdk/models/webhook_velocity.py deleted file mode 100644 index c54676e1..00000000 --- a/fingerprint_server_sdk/models/webhook_velocity.py +++ /dev/null @@ -1,227 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.velocity_data import VelocityData -from fingerprint_server_sdk.models.velocity_data import VelocityData -from fingerprint_server_sdk.models.velocity_data import VelocityData -from fingerprint_server_sdk.models.velocity_data import VelocityData -from fingerprint_server_sdk.models.velocity_data import VelocityData -from fingerprint_server_sdk.models.velocity_data import VelocityData -from fingerprint_server_sdk.models.velocity_data import VelocityData - - -class WebhookVelocity(BaseModel): - """ - Sums key data points for a specific `visitorId`, `ipAddress` and `linkedId` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: - Number of distinct IP addresses associated to the visitor ID. - Number of distinct linked IDs associated with the visitor ID. - Number of distinct countries associated with the visitor ID. - Number of identification events associated with the visitor ID. - Number of identification events associated with the detected IP address. - Number of distinct IP addresses associated with the provided linked ID. - Number of distinct visitor IDs associated with the provided linked ID. The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted if the number of `events` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. - - NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'distinct_ip': 'VelocityData', - 'distinct_linked_id': 'VelocityData', - 'distinct_country': 'VelocityData', - 'events': 'VelocityData', - 'ip_events': 'VelocityData', - 'distinct_ip_by_linked_id': 'VelocityData', - 'distinct_visitor_id_by_linked_id': 'VelocityData' - } - - nullable_map = { - 'distinct_ip': False, - 'distinct_linked_id': False, - 'distinct_country': False, - 'events': False, - 'ip_events': False, - 'distinct_ip_by_linked_id': False, - 'distinct_visitor_id_by_linked_id': False - } - - attribute_map = { - 'distinct_ip': 'distinctIp', - 'distinct_linked_id': 'distinctLinkedId', - 'distinct_country': 'distinctCountry', - 'events': 'events', - 'ip_events': 'ipEvents', - 'distinct_ip_by_linked_id': 'distinctIpByLinkedId', - 'distinct_visitor_id_by_linked_id': 'distinctVisitorIdByLinkedId' - } - - def __init__(self, distinct_ip=None, distinct_linked_id=None, distinct_country=None, events=None, ip_events=None, distinct_ip_by_linked_id=None, distinct_visitor_id_by_linked_id=None): # noqa: E501 - """WebhookVelocity - a model defined in Swagger""" # noqa: E501 - self._distinct_ip = None - self._distinct_linked_id = None - self._distinct_country = None - self._events = None - self._ip_events = None - self._distinct_ip_by_linked_id = None - self._distinct_visitor_id_by_linked_id = None - self.discriminator = None - if distinct_ip is not None: - self.distinct_ip = distinct_ip - if distinct_linked_id is not None: - self.distinct_linked_id = distinct_linked_id - if distinct_country is not None: - self.distinct_country = distinct_country - if events is not None: - self.events = events - if ip_events is not None: - self.ip_events = ip_events - if distinct_ip_by_linked_id is not None: - self.distinct_ip_by_linked_id = distinct_ip_by_linked_id - if distinct_visitor_id_by_linked_id is not None: - self.distinct_visitor_id_by_linked_id = distinct_visitor_id_by_linked_id - - @property - def distinct_ip(self) -> Optional[VelocityData]: - """Gets the distinct_ip of this WebhookVelocity. # noqa: E501 - - - :return: The distinct_ip of this WebhookVelocity. # noqa: E501 - """ - return self._distinct_ip - - @distinct_ip.setter - def distinct_ip(self, distinct_ip: Optional[VelocityData]): - """Sets the distinct_ip of this WebhookVelocity. - - - :param distinct_ip: The distinct_ip of this WebhookVelocity. # noqa: E501 - """ - - self._distinct_ip = distinct_ip - - @property - def distinct_linked_id(self) -> Optional[VelocityData]: - """Gets the distinct_linked_id of this WebhookVelocity. # noqa: E501 - - - :return: The distinct_linked_id of this WebhookVelocity. # noqa: E501 - """ - return self._distinct_linked_id - - @distinct_linked_id.setter - def distinct_linked_id(self, distinct_linked_id: Optional[VelocityData]): - """Sets the distinct_linked_id of this WebhookVelocity. - - - :param distinct_linked_id: The distinct_linked_id of this WebhookVelocity. # noqa: E501 - """ - - self._distinct_linked_id = distinct_linked_id - - @property - def distinct_country(self) -> Optional[VelocityData]: - """Gets the distinct_country of this WebhookVelocity. # noqa: E501 - - - :return: The distinct_country of this WebhookVelocity. # noqa: E501 - """ - return self._distinct_country - - @distinct_country.setter - def distinct_country(self, distinct_country: Optional[VelocityData]): - """Sets the distinct_country of this WebhookVelocity. - - - :param distinct_country: The distinct_country of this WebhookVelocity. # noqa: E501 - """ - - self._distinct_country = distinct_country - - @property - def events(self) -> Optional[VelocityData]: - """Gets the events of this WebhookVelocity. # noqa: E501 - - - :return: The events of this WebhookVelocity. # noqa: E501 - """ - return self._events - - @events.setter - def events(self, events: Optional[VelocityData]): - """Sets the events of this WebhookVelocity. - - - :param events: The events of this WebhookVelocity. # noqa: E501 - """ - - self._events = events - - @property - def ip_events(self) -> Optional[VelocityData]: - """Gets the ip_events of this WebhookVelocity. # noqa: E501 - - - :return: The ip_events of this WebhookVelocity. # noqa: E501 - """ - return self._ip_events - - @ip_events.setter - def ip_events(self, ip_events: Optional[VelocityData]): - """Sets the ip_events of this WebhookVelocity. - - - :param ip_events: The ip_events of this WebhookVelocity. # noqa: E501 - """ - - self._ip_events = ip_events - - @property - def distinct_ip_by_linked_id(self) -> Optional[VelocityData]: - """Gets the distinct_ip_by_linked_id of this WebhookVelocity. # noqa: E501 - - - :return: The distinct_ip_by_linked_id of this WebhookVelocity. # noqa: E501 - """ - return self._distinct_ip_by_linked_id - - @distinct_ip_by_linked_id.setter - def distinct_ip_by_linked_id(self, distinct_ip_by_linked_id: Optional[VelocityData]): - """Sets the distinct_ip_by_linked_id of this WebhookVelocity. - - - :param distinct_ip_by_linked_id: The distinct_ip_by_linked_id of this WebhookVelocity. # noqa: E501 - """ - - self._distinct_ip_by_linked_id = distinct_ip_by_linked_id - - @property - def distinct_visitor_id_by_linked_id(self) -> Optional[VelocityData]: - """Gets the distinct_visitor_id_by_linked_id of this WebhookVelocity. # noqa: E501 - - - :return: The distinct_visitor_id_by_linked_id of this WebhookVelocity. # noqa: E501 - """ - return self._distinct_visitor_id_by_linked_id - - @distinct_visitor_id_by_linked_id.setter - def distinct_visitor_id_by_linked_id(self, distinct_visitor_id_by_linked_id: Optional[VelocityData]): - """Sets the distinct_visitor_id_by_linked_id of this WebhookVelocity. - - - :param distinct_visitor_id_by_linked_id: The distinct_visitor_id_by_linked_id of this WebhookVelocity. # noqa: E501 - """ - - self._distinct_visitor_id_by_linked_id = distinct_visitor_id_by_linked_id - diff --git a/fingerprint_server_sdk/models/webhook_virtual_machine.py b/fingerprint_server_sdk/models/webhook_virtual_machine.py deleted file mode 100644 index 1f52af13..00000000 --- a/fingerprint_server_sdk/models/webhook_virtual_machine.py +++ /dev/null @@ -1,69 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel - - -class WebhookVirtualMachine(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool' - } - - nullable_map = { - 'result': False - } - - attribute_map = { - 'result': 'result' - } - - def __init__(self, result=None): # noqa: E501 - """WebhookVirtualMachine - a model defined in Swagger""" # noqa: E501 - self._result = None - self.discriminator = None - if result is not None: - self.result = result - - @property - def result(self) -> Optional[bool]: - """Gets the result of this WebhookVirtualMachine. # noqa: E501 - - `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. # noqa: E501 - - :return: The result of this WebhookVirtualMachine. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[bool]): - """Sets the result of this WebhookVirtualMachine. - - `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. # noqa: E501 - - :param result: The result of this WebhookVirtualMachine. # noqa: E501 - """ - - self._result = result - diff --git a/fingerprint_server_sdk/models/webhook_vpn.py b/fingerprint_server_sdk/models/webhook_vpn.py deleted file mode 100644 index 99a0f7b1..00000000 --- a/fingerprint_server_sdk/models/webhook_vpn.py +++ /dev/null @@ -1,175 +0,0 @@ -# coding: utf-8 - -""" - Fingerprint Server API - - 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 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from fingerprint_server_sdk.base_model import BaseModel -from fingerprint_server_sdk.models.vpn_confidence import VPNConfidence -from fingerprint_server_sdk.models.vpn_methods import VPNMethods - - -class WebhookVPN(BaseModel): - """NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """ - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { - 'result': 'bool', - 'confidence': 'VPNConfidence', - 'origin_timezone': 'str', - 'origin_country': 'str', - 'methods': 'VPNMethods' - } - - nullable_map = { - 'result': False, - 'confidence': False, - 'origin_timezone': False, - 'origin_country': False, - 'methods': False - } - - attribute_map = { - 'result': 'result', - 'confidence': 'confidence', - 'origin_timezone': 'originTimezone', - 'origin_country': 'originCountry', - 'methods': 'methods' - } - - def __init__(self, result=None, confidence=None, origin_timezone=None, origin_country=None, methods=None): # noqa: E501 - """WebhookVPN - a model defined in Swagger""" # noqa: E501 - self._result = None - self._confidence = None - self._origin_timezone = None - self._origin_country = None - self._methods = None - self.discriminator = None - if result is not None: - self.result = result - if confidence is not None: - self.confidence = confidence - if origin_timezone is not None: - self.origin_timezone = origin_timezone - if origin_country is not None: - self.origin_country = origin_country - if methods is not None: - self.methods = methods - - @property - def result(self) -> Optional[bool]: - """Gets the result of this WebhookVPN. # noqa: E501 - - VPN or other anonymizing service has been used when sending the request. # noqa: E501 - - :return: The result of this WebhookVPN. # noqa: E501 - """ - return self._result - - @result.setter - def result(self, result: Optional[bool]): - """Sets the result of this WebhookVPN. - - VPN or other anonymizing service has been used when sending the request. # noqa: E501 - - :param result: The result of this WebhookVPN. # noqa: E501 - """ - - self._result = result - - @property - def confidence(self) -> Optional[VPNConfidence]: - """Gets the confidence of this WebhookVPN. # noqa: E501 - - - :return: The confidence of this WebhookVPN. # noqa: E501 - """ - return self._confidence - - @confidence.setter - def confidence(self, confidence: Optional[VPNConfidence]): - """Sets the confidence of this WebhookVPN. - - - :param confidence: The confidence of this WebhookVPN. # noqa: E501 - """ - - self._confidence = confidence - - @property - def origin_timezone(self) -> Optional[str]: - """Gets the origin_timezone of this WebhookVPN. # noqa: E501 - - Local timezone which is used in timezoneMismatch method. # noqa: E501 - - :return: The origin_timezone of this WebhookVPN. # noqa: E501 - """ - return self._origin_timezone - - @origin_timezone.setter - def origin_timezone(self, origin_timezone: Optional[str]): - """Sets the origin_timezone of this WebhookVPN. - - Local timezone which is used in timezoneMismatch method. # noqa: E501 - - :param origin_timezone: The origin_timezone of this WebhookVPN. # noqa: E501 - """ - - self._origin_timezone = origin_timezone - - @property - def origin_country(self) -> Optional[str]: - """Gets the origin_country of this WebhookVPN. # noqa: E501 - - Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). # noqa: E501 - - :return: The origin_country of this WebhookVPN. # noqa: E501 - """ - return self._origin_country - - @origin_country.setter - def origin_country(self, origin_country: Optional[str]): - """Sets the origin_country of this WebhookVPN. - - Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). # noqa: E501 - - :param origin_country: The origin_country of this WebhookVPN. # noqa: E501 - """ - - self._origin_country = origin_country - - @property - def methods(self) -> Optional[VPNMethods]: - """Gets the methods of this WebhookVPN. # noqa: E501 - - - :return: The methods of this WebhookVPN. # noqa: E501 - """ - return self._methods - - @methods.setter - def methods(self, methods: Optional[VPNMethods]): - """Sets the methods of this WebhookVPN. - - - :param methods: The methods of this WebhookVPN. # noqa: E501 - """ - - self._methods = methods - diff --git a/fingerprint_server_sdk/py.typed b/fingerprint_server_sdk/py.typed new file mode 100644 index 00000000..e69de29b diff --git a/fingerprint_server_sdk/rest.py b/fingerprint_server_sdk/rest.py index a69e0c46..706824f7 100644 --- a/fingerprint_server_sdk/rest.py +++ b/fingerprint_server_sdk/rest.py @@ -1,60 +1,74 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + import io import json -import logging import re import ssl -import certifi -from typing import Optional, Dict, List, Tuple, Any -from urllib.parse import urlencode +import urllib3 -from fingerprint_server_sdk.configuration import Configuration +from fingerprint_server_sdk.exceptions import ApiException, ApiValueError -try: - import urllib3 -except ImportError: - raise ImportError('Swagger python client requires urllib3.') +SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse -logger = logging.getLogger(__name__) +def is_socks_proxy_url(url): + if url is None: + return False + split_section = url.split("://") + if len(split_section) < 2: + return False + else: + return split_section[0].lower() in SUPPORTED_SOCKS_PROXIES class RESTResponse(io.IOBase): - def __init__(self, resp: urllib3.HTTPResponse): - self.urllib3_response = resp + def __init__(self, resp) -> None: + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = resp.data + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data + + @property + def headers(self): + """Returns a dictionary of response headers.""" + return self.response.headers def getheaders(self): - """Returns a dictionary of the response headers.""" - return self.urllib3_response.headers + """Returns a dictionary of the response headers; use ``headers`` instead.""" + return self.response.headers def getheader(self, name, default=None): - """Returns a given response header.""" - return self.urllib3_response.headers.get(name, default) + """Returns a given response header; use ``headers.get()`` instead.""" + return self.response.headers.get(name, default) class RESTClientObject: - def __init__(self, configuration: Configuration, pools_size: int = 4, maxsize: int = None): + def __init__(self, configuration) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs @@ -63,74 +77,83 @@ def __init__(self, configuration: Configuration, pools_size: int = 4, maxsize: i else: cert_reqs = ssl.CERT_NONE - # ca_certs - if configuration.ssl_ca_cert: - ca_certs = configuration.ssl_ca_cert - else: - # if not set certificate file, use Mozilla's root certificates. - ca_certs = certifi.where() - - addition_pool_args = {} + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + "ca_cert_data": configuration.ca_cert_data, + } if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 + if configuration.retries is not None: + pool_args['retries'] = configuration.retries + + if configuration.tls_server_name: + pool_args['server_hostname'] = configuration.tls_server_name + + + if configuration.socket_options is not None: + pool_args['socket_options'] = configuration.socket_options + + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager + self.pool_manager: urllib3.PoolManager + if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - **addition_pool_args - ) + if is_socks_proxy_url(configuration.proxy): + from urllib3.contrib.socks import SOCKSProxyManager + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) + else: + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method: str, url: str, query_params: Optional[List[Tuple[str, Any]]] = None, - headers: Optional[Dict[str, Any]] = None, body: Any = None, - post_params: Optional[List[Tuple[str, Any]]] = None, - _preload_content: bool = True, _request_timeout: Optional[int] = None): + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Perform requests. :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: - raise ValueError( + raise ApiValueError( "body parameter cannot be used with post_params parameter." ) @@ -139,60 +162,83 @@ def request(self, method: str, url: str, query_params: Optional[List[Tuple[str, timeout = None if _request_timeout: - if isinstance(_request_timeout, int): + if isinstance(_request_timeout, (int, float)): timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) - - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' + connect=_request_timeout[0], + read=_request_timeout[1] + ) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if query_params: - url += '?' + urlencode(query_params) - if re.search('json', headers['Content-Type'], re.IGNORECASE): - request_body = '{}' + + # no content type provided or payload is json + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): + request_body = None if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( - method, url, + method, + url, body=request_body, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. del headers['Content-Type'] + # Ensures that dict objects are serialized + post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=True, - preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + preload_content=False + ) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str): - request_body = body + # other content types than JSON when `body` argument is + # provided in serialized form. + elif isinstance(body, str) or isinstance(body, bytes): + r = self.pool_manager.request( + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): + request_body = "true" if body else "false" r = self.pool_manager.request( - method, url, + method, + url, body=request_body, - preload_content=_preload_content, + preload_content=False, timeout=timeout, headers=headers) else: @@ -203,60 +249,16 @@ def request(self, method: str, url: str, query_params: Optional[List[Tuple[str, raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) + msg = "\n".join([type(e).__name__, str(e)]) raise ApiException(status=0, reason=msg) - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - raise ApiException(http_resp=r) - - return r - - -class ApiException(Exception): - - def __init__(self, status: Optional[int] = None, reason: Optional[str] = None, - http_resp: Optional[RESTResponse] = None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self) -> str: - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -class KnownApiException(ApiException): - - def __init__(self, original_exception: ApiException, structured_error: Any): - super(KnownApiException, self).__init__(status=original_exception.status, reason=original_exception.reason) - self.headers = original_exception.headers - self.body = original_exception.body - self.structured_error = structured_error + return RESTResponse(r) diff --git a/fingerprint_server_sdk/sealed.py b/fingerprint_server_sdk/sealed.py index 776d209e..2f0cd2f2 100644 --- a/fingerprint_server_sdk/sealed.py +++ b/fingerprint_server_sdk/sealed.py @@ -5,8 +5,7 @@ from cryptography.hazmat.backends import default_backend import zlib -from fingerprint_server_sdk.api_client import ApiClientDeserializer -from fingerprint_server_sdk.models.events_get_response import EventsGetResponse +from fingerprint_server_sdk.models.event import Event SEALED_HEADER = bytes([0x9e, 0x85, 0xdc, 0xed]) DecryptionAlgorithm = { @@ -43,20 +42,20 @@ def __init__(self, errors: List[UnsealError]): super().__init__("Unable to decrypt sealed data") -def unseal_event_response(sealed_data: bytes, decryption_keys: List[DecryptionKey]) -> EventsGetResponse: +def unseal_event_response(sealed_data: bytes, decryption_keys: List[DecryptionKey]) -> Event: """Unseal event response with one of the provided keys.""" unsealed = __unseal(sealed_data, decryption_keys) return __parse_event_response(unsealed) -def __parse_event_response(unsealed: str) -> EventsGetResponse: +def __parse_event_response(unsealed: str) -> Event: """Parse event response from unsealed data.""" json_data = json.loads(unsealed) - if 'products' not in json_data: + if 'event_id' not in json_data: raise ValueError('Sealed data is not valid event response') - result: EventsGetResponse = ApiClientDeserializer.deserialize(json_data, 'EventsGetResponse') + result: Event = Event.from_dict(json_data) return result diff --git a/fix_codegen_problems.py b/fix_codegen_problems.py deleted file mode 100644 index 6c87eb0c..00000000 --- a/fix_codegen_problems.py +++ /dev/null @@ -1,65 +0,0 @@ -import os -import re - - -def camel_to_snake(name): - """Converts CamelCase to snake_case.""" - s1 = re.sub('(.)([A-Z][a-z]+)', r'\1_\2', name) - return re.sub('([a-z0-9])([A-Z])', r'\1_\2', s1).lower() - - -def convert_to_snake_case(text): - """Converts __to__snake__case imports to correct imports.""" - pattern = r'__to__snake__case\(([a-zA-Z0-9]+)\)' - - def replacer(match): - class_name = match.group(1) - snake_case_name = camel_to_snake(class_name) - return snake_case_name - - return re.sub(pattern, replacer, text) - - -def convert_type_annotations(text): - """Replaces dict(str, object) with dict[str, object] in function annotations.""" - result = text - replacement_pairs = [ - (r'-> dict\((\w+), (\w+)\):', r'-> Dict[\1, \2]:'), - (r'-> Optional\[dict\((\w+), (\w+)\)\]:', r'-> Optional[Dict[\1, \2]]:'), - (r': dict\((\w+), (\w+)\)', r': Dict[\1, \2]'), - (r': Optional\[dict\((\w+), (\w+)\)\]', r': Optional[Dict[\1, \2]]'), - (r'-> list\[(\w+)\]:', r'-> List[\1]:'), - (r'-> Optional\[list\[(\w+)\]\]:', r'-> Optional[List[\1]]:'), - (r': list\[(\w+)\]', r': List[\1]'), - (r': Optional\[list\[(\w+)\]\]', r': Optional[List[\1]]') - ] - for pattern, replacement in replacement_pairs: - result = re.sub(pattern, replacement, result) - return result - - -def process_file(file_path: str): - """Reads file, performs conversion and writes back.""" - with open(file_path, 'r+', encoding='utf-8') as file: - content = file.read() - - content = convert_to_snake_case(content) - content = convert_type_annotations(content) - - with open(file_path, 'w', encoding='utf-8') as file: - file.write(content) - - -def process_models(): - """Run through all models.""" - directory = './fingerprint_server_sdk/models' - for root, _, files in os.walk(directory): - for file in files: - if file.endswith('.py'): - file_path = os.path.join(root, file) - process_file(file_path) - - -if __name__ == "__main__": - process_models() - diff --git a/generate.sh b/generate.sh index e12a3bc8..37e25515 100755 --- a/generate.sh +++ b/generate.sh @@ -17,40 +17,16 @@ if [[ $VERSION =~ (.*-test\.)([0-9]+) ]]; then VERSION="${BASE_VERSION%-rc.}.rc${DEV_NUMBER}" fi -# jar was downloaded from here https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/3.0.34/ - -find ./docs -type f ! -name "DecryptionKey.md" ! -name "SealedResults.md" -exec rm {} + -cd fingerprint_server_sdk/models -shopt -s extglob -rm !("error_plain_response.py") -cd ../.. -java -jar ./bin/swagger-codegen-cli.jar generate -t ./template -l python -i ./res/fingerprint-server-api.yaml -o ./ -c config.json -DpackageVersion=$VERSION - -python ./fix_codegen_problems.py - -# Ugly fix for codegen problem that I couldn't fix editing template. -# Platform check -platform=$(uname) -( - # Readme file fix - replacement=$(printf 'The rawAttributes object follows this general shape: `{ value: any } | { error: { name: string; message: string; } }`\n') - readme_filename="./docs/RawDeviceAttributes.md" - if [ "$platform" = "Darwin" ]; then - sed -i '' "s/^Name |.*/${replacement}/" "$readme_filename" - sed -i '' "/^------------ |/c\\" "$readme_filename" - else - sed -i "s/^Name |.*/${replacement}/" "$readme_filename" - sed -i "/^------------ |/c\\" "$readme_filename" - fi -) - -# Replace version in other files -( - if [ "$platform" = "Darwin" ]; then - sed -i '' "s/^VERSION = '[^']*'/VERSION = '${VERSION}'/" "./test/test_fingerprint_api.py" - sed -i '' "s/^version = [^']*/version = ${VERSION}/" "./setup.cfg" - else - sed -i "s/^VERSION = '[^']*'/VERSION = '${VERSION}'/" "./test/test_fingerprint_api.py" - sed -i "s/^version = [^']*/version = ${VERSION}/" "./setup.cfg" - fi -) +# Cleanup +rm -Rf fingerprint_server_sdk +rm -Rf docs + +OPENAPI_GENERATOR_IMAGE_VERSION="v7.19.0" + +docker run --rm -v "${PWD}:/local" -w /local "openapitools/openapi-generator-cli:${OPENAPI_GENERATOR_IMAGE_VERSION}" generate \ + -i ./res/fingerprint-server-api.yaml \ + -g python \ + -o ./ \ + -t ./template \ + -c ./config.json \ + --additional-properties=packageVersion="$VERSION" diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..68cf127f --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,78 @@ +[project] +name = "fingerprint_server_sdk" +version = "8.11.0" +description = "Fingerprint Server API allows you to get, search, and update 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. " +authors = [ + {name = "Fingerprint Support",email = "support@fingerprint.com"}, +] +license = { text = "MIT" } +readme = "README.md" +keywords = ["OpenAPI", "OpenAPI-Generator", "Server API"] +requires-python = ">=3.9" + +dependencies = [ + "urllib3 (>=2.1.0,<3.0.0)", + "python-dateutil (>=2.8.2)", + "pydantic (>=2)", + "typing-extensions (>=4.7.1)", + "cryptography" +] + +[project.urls] +Repository = "https://github.com/fingerprintjs/python-sdk" + +[tool.poetry] +requires-poetry = ">=2.0" + +[tool.poetry.group.dev.dependencies] +pytest = ">= 7.2.1" +pytest-cov = ">= 2.8.1" +tox = ">= 3.9.0" +flake8 = ">= 4.0.0" +types-python-dateutil = ">= 2.8.19.14" +mypy = ">= 1.5" +python-dotenv = ">= 1.0.0" + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "fingerprint_server_sdk", + "test", +] + +strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true +strict_equality = true +extra_checks = true +check_untyped_defs = true +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +[[tool.mypy.overrides]] +module = [ + "fingerprint_server_sdk.configuration", +] +warn_unused_ignores = true +strict_equality = true +extra_checks = true +check_untyped_defs = true +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true +disallow_untyped_calls = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +no_implicit_reexport = true +warn_return_any = true \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 29dd6a3b..6f85b936 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,5 @@ -certifi >= 2023.7.22 -python-dateutil >= 2.5.3 -setuptools >= 65.5.1 -urllib3>=1.23 -python-dotenv -cryptography -typing_extensions >= 4.5 \ No newline at end of file +urllib3 >= 2.1.0, < 3.0.0 +python_dateutil >= 2.8.2 +pydantic >= 2 +typing-extensions >= 4.7.1 +cryptography >= 41.0.0 \ No newline at end of file diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index 71a4fa75..db15fe10 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -1,14 +1,14 @@ -openapi: 3.0.3 +openapi: 3.1.1 info: - title: Fingerprint Server API + title: Server API description: > - 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. + Fingerprint Server API allows you to get, search, and update 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. - version: '3' + version: '4' contact: name: Fingerprint Support email: support@fingerprint.com @@ -23,54 +23,65 @@ tags: analysis events or event history of individual visitors. externalDocs: description: API documentation - url: https://dev.fingerprint.com/reference/pro-server-api + url: https://docs.fingerprint.com/reference/server-api servers: - - url: https://api.fpjs.io + - url: https://api.fpjs.io/v4 description: Global - - url: https://eu.api.fpjs.io + - url: https://eu.api.fpjs.io/v4 description: EU - - url: https://ap.api.fpjs.io + - url: https://ap.api.fpjs.io/v4 description: Asia (Mumbai) security: - - ApiKeyHeader: [] - - ApiKeyQuery: [] + - bearerAuth: [] paths: - /events/{request_id}: + /events/{event_id}: get: tags: - Fingerprint operationId: getEvent - summary: Get event by request ID + summary: Get an event by event ID description: > Get a detailed analysis of an individual identification event, including - Smart Signals. + 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`. + Use `event_id` as the URL path parameter. This API method is scoped to a + request, i.e. all returned information is by `event_id`. parameters: - - name: request_id + - name: event_id in: path required: true schema: type: string description: >- The unique - [identifier](https://dev.fingerprint.com/reference/get-function#requestid) - of each identification request. + [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) + of each identification request (`requestId` can be used in its + place). + - name: ruleset_id + in: query + required: false + schema: + type: string + description: > + The ID of the ruleset to evaluate against the event, producing the + action to take for this event. + + The resulting action is returned in the `rule_action` attribute of + the response. responses: '200': description: OK. content: application/json: schema: - $ref: '#/components/schemas/EventsGetResponse' + $ref: '#/components/schemas/Event' + '400': + description: Bad request. The event Id provided is not valid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' '403': description: Forbidden. Access to this API is denied. content: @@ -78,45 +89,64 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' '404': - description: >- - Not found. The request ID cannot be found in this application's - data. + description: Not found. The event Id cannot be found in this workspace's data. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '429': + description: Too Many Requests. The request is throttled. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: Workspace error. content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - put: + patch: tags: - Fingerprint operationId: updateEvent - summary: Update an event with a given request ID + summary: Update an event description: > - Change information in existing events specified by `requestId` or *flag + Change information in existing events specified by `event_id` 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. + When an event is created, it can be assigned `linked_id` and `tags` + submitted through the JS agent parameters. + This information might not have been available on the client initially, + so the Server API permits updating these attributes after the fact. - **Warning** It's not possible to update events older than 10 days. + + **Warning** It's not possible to update events older than one month. + + + **Warning** Trying to update an event immediately after creation may + temporarily result in an + + error (HTTP 409 Conflict. The event is not mutable yet.) as the event is + fully propagated across our systems. In such a case, simply retry the + request. parameters: - - name: request_id + - name: event_id in: path required: true schema: type: string description: >- The unique event - [identifier](https://dev.fingerprint.com/reference/get-function#requestid). + [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). requestBody: required: true content: application/json: schema: - $ref: '#/components/schemas/EventsUpdateRequest' + $ref: '#/components/schemas/EventUpdate' responses: '200': description: OK. @@ -133,9 +163,7 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' '404': - description: >- - Not found. The request ID cannot be found in this application's - data. + description: Not found. The event Id cannot be found in this workspace's data. content: application/json: schema: @@ -146,29 +174,69 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - /events/search: + /events: get: tags: - Fingerprint operationId: searchEvents - summary: Get events via search + x-dotnet-use-request-object: true + summary: Search events description: > - 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. + ## Search + + + The `/v4/events` endpoint provides a convenient way to search for past + events based on specific parameters. Typical use cases and queries + include: - 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. + - Searching for events associated with a single `visitor_id` within a + time range to get historical behavior of a visitor. + + - Searching for events associated with a single `linked_id` within a + time range to get all events associated with your internal account + identifier. + + - Excluding all bot traffic from the query (`good` and `bad` bots) + + + If you don't provide `start` or `end` parameters, the default search + range is the **last 7 days**. + + + ### Filtering events with the `suspect` flag + + + The `/v4/events` endpoint unlocks a powerful method for fraud protection + analytics. The `suspect` flag is exposed in all events where it was + previously set by the update API. + + + You can also apply the `suspect` query parameter as a filter to find all + potentially fraudulent activity that you previously marked as `suspect`. + This helps identify patterns of fraudulent behavior. + + + ### Environment scoping + + + If you use a secret key that is scoped to an environment, you will only + get events associated with the same environment. With a workspace-scoped + environment, you will get events from all environments. + + + Smart Signals not activated for your workspace or are not included in + the response. parameters: - name: limit in: query - required: true + required: false schema: type: integer format: int32 minimum: 1 + maximum: 100 + default: 10 example: 10 description: | Limit the number of events returned. @@ -177,77 +245,105 @@ paths: schema: type: string description: > - Use `pagination_key` to get the next page of results. + 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: + When more results are available (e.g., you requested up to 100 + results for your query using `limit`, but there are more than 100 + events total matching your request), the `pagination_key` field is + added to the response. The pagination key is an arbitrary string + that should not be interpreted in any way and should be passed + as-is. 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` + api-base-url/events?limit=100` - 2. Use `response.paginationKey` to get the next page of results: - `GET - api-base-url/events/search?limit=200&pagination_key=1740815825085` + 2. Use `response.pagination_key` to get the next page of results: + `GET api-base-url/events?limit=100&pagination_key=1740815825085` - name: visitor_id in: query schema: type: string description: > Unique [visitor - identifier](https://dev.fingerprint.com/reference/get-function#visitorid) - issued by Fingerprint Pro. + identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) + issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. - name: bot in: query schema: - type: string - enum: - - all - - good - - bad - - none + $ref: '#/components/schemas/SearchEventsBot' description: > - Filter events by the Bot Detection result, specifically: + 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. + > Note: When using this parameter, only events with the `bot` + property set to a valid value are returned. Events without a `bot` + Smart Signal result are left out of the response. - name: ip_address in: query schema: type: string description: > - Filter events by IP address range. The range can be as specific as a - single IP (/32 for IPv4 or /128 for IPv6) + Filter events by IP address or IP range (if CIDR notation is used). + If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is + assumed. + + Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 + - name: asn + in: query + schema: + type: string + description: > + Filter events by the ASN associated with the event's IP address. - All ip_address filters must use CIDR notation, for example, - 10.0.0.0/24, 192.168.0.1/32 + This corresponds to the `ip_info.(v4|v6).asn` property in the + response. - name: linked_id in: query schema: type: string description: > - Filter events by your custom identifier. + 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 + Ids](https://docs.fingerprint.com/reference/js-agent-v4-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. + - name: url + in: query + schema: + type: string + description: | + Filter events by the URL (`url` property) associated with the event. + - name: bundle_id + in: query + schema: + type: string + description: | + Filter events by the Bundle ID (iOS) associated with the event. + - name: package_name + in: query + schema: + type: string + description: > + Filter events by the Package Name (Android) associated with the + event. + - name: origin + in: query + schema: + type: string + description: > + Filter events by the origin field of the event. This is applicable + to web events only (e.g., https://example.com) - name: start in: query schema: @@ -276,7 +372,7 @@ paths: type: boolean description: > Filter events previously tagged as suspicious via the [Update - API](https://dev.fingerprint.com/reference/updateevent). + API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events @@ -286,143 +382,131 @@ paths: schema: type: boolean description: > - Filter events by VPN Detection result. + 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. + > Note: When using this parameter, only events with the `vpn` + property set to `true` or `false` are returned. Events without a + `vpn` Smart Signal result are left out of the response. - name: virtual_machine in: query schema: type: boolean description: > - Filter events by Virtual Machine Detection result. + 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. + `virtual_machine` property set to `true` or `false` are returned. + Events without a `virtual_machine` Smart Signal result are left out + of the response. - name: tampering in: query schema: type: boolean description: > - Filter events by Tampering Detection result. + Filter events by Browser 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. + `tampering.result` property set to `true` or `false` are returned. + Events without a `tampering` Smart Signal result are left out of the + response. - name: anti_detect_browser in: query schema: type: boolean description: > - Filter events by Anti-detect Browser Detection result. + 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. + `tampering.anti_detect_browser` property set to `true` or `false` + are returned. Events without a `tampering` Smart Signal result are + left out of the response. - name: incognito in: query schema: type: boolean description: > - Filter events by Browser Incognito Detection result. + 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. + > Note: When using this parameter, only events with the `incognito` + property set to `true` or `false` are returned. Events without an + `incognito` Smart Signal result are left out of the response. - name: privacy_settings in: query schema: type: boolean description: > - Filter events by Privacy Settings Detection result. + 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. + `privacy_settings` property set to `true` or `false` are returned. + Events without a `privacy_settings` Smart Signal result are left out + of the response. - name: jailbroken in: query schema: type: boolean description: > - Filter events by Jailbroken Device Detection result. + 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. + > Note: When using this parameter, only events with the `jailbroken` + property set to `true` or `false` are returned. Events without a + `jailbroken` Smart Signal result are left out of the response. - name: frida in: query schema: type: boolean description: > - Filter events by Frida Detection result. + 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. + > Note: When using this parameter, only events with the `frida` + property set to `true` or `false` are returned. Events without a + `frida` Smart Signal result are left out of the response. - name: factory_reset in: query schema: type: boolean description: > - Filter events by Factory Reset Detection result. + 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. + > Note: When using this parameter, only events with a + `factory_reset` time. Events without a `factory_reset` Smart Signal + result are left out of the response. - name: cloned_app in: query schema: type: boolean description: > - Filter events by Cloned App Detection result. + 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. + > Note: When using this parameter, only events with the `cloned_app` + property set to `true` or `false` are returned. Events without a + `cloned_app` Smart Signal result are left out of the response. - name: emulator in: query schema: type: boolean description: > - Filter events by Android Emulator Detection result. + 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. + > Note: When using this parameter, only events with the `emulator` + property set to `true` or `false` are returned. Events without an + `emulator` Smart Signal result are left out of the response. - name: root_apps in: query schema: type: boolean description: > - Filter events by Rooted Device Detection result. + 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. + > Note: When using this parameter, only events with the `root_apps` + property set to `true` or `false` are returned. Events without a + `root_apps` Smart Signal result are left out of the response. - name: vpn_confidence in: query schema: - type: string - enum: - - high - - medium - - low + $ref: '#/components/schemas/SearchEventsVpnConfidence' description: > - Filter events by VPN Detection result confidence level. + Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. @@ -431,9 +515,8 @@ paths: `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. + `vpn.confidence` property set to a valid value are returned. Events + without a `vpn` Smart Signal result are left out of the response. - name: min_suspect_score in: query schema: @@ -444,33 +527,9 @@ paths: 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. - - name: ip_blocklist - in: query - schema: - type: boolean - description: > - 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. - - name: datacenter - in: query - schema: - type: boolean - description: > - 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. + `suspect_score` property set to a value exceeding your threshold are + returned. Events without a `suspect_score` Smart Signal result are + left out of the response. - name: developer_tools in: query schema: @@ -479,9 +538,9 @@ paths: 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. + `developer_tools` property set to `true` or `false` are returned. + Events without a `developer_tools` Smart Signal result are left out + of the response. - name: location_spoofing in: query schema: @@ -490,9 +549,9 @@ paths: 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. + `location_spoofing` property set to `true` or `false` are returned. + Events without a `location_spoofing` Smart Signal result are left + out of the response. - name: mitm_attack in: query schema: @@ -501,9 +560,9 @@ paths: 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. + `mitm_attack` property set to `true` or `false` are returned. Events + without a `mitm_attack` Smart Signal result are left out of the + response. - name: proxy in: query schema: @@ -511,45 +570,40 @@ paths: description: > 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. + > Note: When using this parameter, only events with the `proxy` + property set to `true` or `false` are returned. Events without a + `proxy` Smart Signal result are left out of the response. - name: sdk_version in: query schema: type: string description: > Filter events by a specific SDK version associated with the - identification event. Example: `3.11.14` + identification event (`sdk.version` property). Example: `3.11.14` - name: sdk_platform in: query schema: - type: string - enum: - - js - - android - - ios + $ref: '#/components/schemas/SearchEventsSdkPlatform' description: > Filter events by the SDK Platform associated with the identification - event. + event (`sdk.platform` property) . - `js` - JavaScript agent (Web). + `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. - name: environment in: query - description: | - Filter for events by providing one or more environment IDs. + description: > + Filter for events by providing one or more environment IDs + (`environment_id` property). required: false schema: type: array items: type: string style: form - explode: true - name: proximity_id in: query schema: @@ -558,38 +612,36 @@ paths: 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. - - name: proximity_precision_radius + `proximity.id` property matching the provided ID are returned. + Events without a `proximity` result are left out of the response. + - name: total_hits in: query schema: type: integer - format: int32 - enum: - - 10 - - 25 - - 65 - - 175 - - 450 - - 1200 - - 3300 - - 8500 - - 22500 + format: int64 + minimum: 1 + maximum: 1000 + description: > + When set, the response will include a `total_hits` property with a + count of total query matches across all pages, up to the specified + limit. + - name: tor_node + in: query + schema: + type: boolean description: > - Filter events by Proximity Radius. + Filter events by Tor Node detection result. - > 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. + > Note: When using this parameter, only events with the `tor_node` + property set to `true` or `false` are returned. Events without a + `tor_node` detection result are left out of the response. responses: '200': description: Events matching the filter(s). content: application/json: schema: - $ref: '#/components/schemas/SearchEventsResponse' + $ref: '#/components/schemas/EventSearch' '400': description: >- Bad request. One or more supplied search parameters are invalid, or @@ -604,162 +656,13 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - /visitors/{visitor_id}: - get: - tags: - - Fingerprint - operationId: getVisits - summary: Get visits by visitor ID - description: > - 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. - x-flatten-optional-params: true - parameters: - - name: visitor_id - in: path - required: true - schema: - type: string - description: >- - Unique [visitor - identifier](https://dev.fingerprint.com/reference/get-function#visitorid) - issued by Fingerprint Pro. - - name: request_id - in: query - schema: - type: string - description: > - 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. - x-go-skip-pointer: true - - name: linked_id - in: query - schema: - type: string - description: > - 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. - x-go-skip-pointer: true - - name: limit - in: query - schema: - type: integer - format: int32 - minimum: 0 - description: > - 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. - x-go-skip-pointer: true - - name: paginationKey - in: query - schema: - type: string - description: > - 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. - x-go-skip-pointer: true - - name: before - in: query - deprecated: true - schema: - type: integer - format: int64 - minimum: 0 - description: > - ⚠️ Deprecated pagination method, please use `paginationKey` instead. - Timestamp (in milliseconds since epoch) used to paginate results. - x-go-skip-pointer: true - responses: - '200': - description: OK. - content: - application/json: - schema: - $ref: '#/components/schemas/VisitorsGetResponse' - '400': - description: >- - Bad request. The visitor ID or query parameters are missing or in - the wrong format. + '500': + description: Workspace error. content: application/json: schema: - $ref: '#/components/schemas/ErrorPlainResponse' - '403': - description: Forbidden. Access to this API is denied. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPlainResponse' - '429': - description: Too Many Requests. The request is throttled. - headers: - Retry-After: - description: >- - Indicates how many seconds you should wait before attempting the - next request. - schema: - type: integer - format: int32 - minimum: 0 - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorPlainResponse' + $ref: '#/components/schemas/ErrorResponse' + /visitors/{visitor_id}: delete: tags: - Fingerprint @@ -769,6 +672,7 @@ paths: 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 @@ -784,7 +688,7 @@ paths: - 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). + Workspace](https://docs.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) @@ -792,7 +696,7 @@ paths: - 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). + Retention](https://docs.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser @@ -806,15 +710,10 @@ paths: - 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. + - If you request [`/v4/events` + API](https://docs.fingerprint.com/reference/server-api-v4-get-event) + with an `event_id` that was made outside of the 10 days, you will still + receive a valid response. ### Interested? @@ -829,7 +728,7 @@ paths: type: string description: >- The [visitor - ID](https://dev.fingerprint.com/reference/get-function#visitorid) + ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. responses: '200': @@ -849,9 +748,7 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' '404': - description: >- - Not found. The visitor ID cannot be found in this application's - data. + description: Not found. The visitor ID cannot be found in this workspace's data. content: application/json: schema: @@ -862,246 +759,88 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' - /related-visitors: - get: - tags: - - Fingerprint - operationId: getRelatedVisitors - summary: Get Related Visitors +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + bearerFormat: string + description: >- + Add your Secret API Key to the Authorization header using the standard + Bearer format: `Authorization: Bearer ` + schemas: + EventId: + type: string description: > - 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). - parameters: - - name: visitor_id - in: query - required: true - schema: - type: string - description: >- - 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. - responses: - '200': - description: OK. - content: - application/json: - schema: - $ref: '#/components/schemas/RelatedVisitorsResponse' - '400': - description: >- - Bad request. The visitor ID parameter is missing or in the wrong - format. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '403': - description: Forbidden. Access to this API is denied. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '404': - description: >- - Not found. The visitor ID cannot be found in this application's - data. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - '429': - description: Too Many Requests. The request is throttled. - content: - application/json: - schema: - $ref: '#/components/schemas/ErrorResponse' - /webhook: - trace: - summary: Dummy path to describe webhook format. - tags: - - Fingerprint + Unique identifier of the user's request. The first portion of the + event_id is a unix epoch milliseconds timestamp For example: + `1758130560902.8tRtrH` + Timestamp: + description: Timestamp of the event with millisecond precision in Unix time. + type: integer + format: int64 + LinkedId: + type: string + description: A customer-provided id that was sent with the request. + EnvironmentId: + type: string + description: | + Environment Id of the event. For example: `ae_47abaca3db2c7c43` + Suspect: + type: boolean description: >- - Fake path to describe webhook format. More information about webhooks - can be found in the - [documentation](https://dev.fingerprint.com/docs/webhooks) - x-flatten-optional-params: true - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Webhook' - responses: - default: - description: Dummy for the schema - callbacks: - webhook: - webhook: - post: - summary: Webhook example - description: >- - You can use HTTP basic authentication and set up credentials in - your [Fingerprint - account](https://dashboard.fingerprint.com/login) - requestBody: - content: - application/json: - schema: - $ref: '#/components/schemas/Webhook' - responses: - default: - description: The server doesn't validate the answer. -components: - securitySchemes: - ApiKeyHeader: - type: apiKey - in: header - name: Auth-API-Key - ApiKeyQuery: - type: apiKey - in: query - name: api_key - schemas: - BrowserDetails: - type: object - additionalProperties: false - required: - - browserName - - browserFullVersion - - browserMajorVersion - - os - - osVersion - - device - - userAgent - properties: - browserName: - type: string - browserMajorVersion: - type: string - browserFullVersion: - type: string - os: - type: string - osVersion: - type: string - device: - type: string - userAgent: - type: string - GeolocationCity: - type: object - additionalProperties: false - required: - - name - properties: - name: - type: string - GeolocationCountry: + Field is `true` if you have previously set the `suspect` flag for this + event using the [Server API Update event + endpoint](https://docs.fingerprint.com/reference/server-api-v4-update-event). + Integration: type: object - additionalProperties: false - required: - - code - - name properties: - code: - type: string - minLength: 2 - maxLength: 2 name: type: string - GeolocationContinent: - type: object - additionalProperties: false - required: - - code - - name - properties: - code: - type: string - minLength: 2 - maxLength: 2 - name: + description: The name of the specific integration, e.g. "fingerprint-pro-react". + version: type: string - GeolocationSubdivision: + description: The version of the specific integration, e.g. "3.11.10". + subintegration: + type: object + properties: + name: + type: string + description: The name of the specific subintegration, e.g. "preact". + version: + type: string + description: The version of the specific subintegration, e.g. "10.21.0". + SDK: type: object - additionalProperties: false + description: Contains information about the SDK used to perform the request. required: - - isoCode - - name - properties: - isoCode: - type: string - name: - type: string - GeolocationSubdivisions: - type: array - items: - $ref: '#/components/schemas/GeolocationSubdivision' - DeprecatedGeolocation: - deprecated: true - type: object - description: >- - This field is **deprecated** and will not return a result for - **applications created after January 23rd, 2024**. Please use the [IP - Geolocation Smart - signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) - for geolocation information. - additionalProperties: false + - platform + - version properties: - accuracyRadius: - type: integer - minimum: 0 - description: >- - The IP address is likely to be within this radius (in km) of the - specified location. - latitude: - type: number - format: double - minimum: -90 - maximum: 90 - longitude: - type: number - format: double - minimum: -180 - maximum: 180 - postalCode: + platform: type: string - timezone: + enum: + - js + - android + - ios + - unknown + description: Platform of the SDK used for the identification request. + version: type: string - format: timezone - city: - $ref: '#/components/schemas/GeolocationCity' - country: - $ref: '#/components/schemas/GeolocationCountry' - continent: - $ref: '#/components/schemas/GeolocationContinent' - subdivisions: - $ref: '#/components/schemas/GeolocationSubdivisions' - Tag: - type: object - description: >- - A customer-provided value or an object that was sent with identification - request. - additionalProperties: true + description: > + Version string of the SDK used for the identification request. For + example: `"3.12.1"` + integrations: + type: array + items: + $ref: '#/components/schemas/Integration' + Replayed: + type: boolean + description: > + `true` if we determined that this payload was replayed, `false` + otherwise. IdentificationConfidence: type: object - additionalProperties: false required: - score properties: @@ -1113,328 +852,294 @@ components: description: >- The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. - revision: + version: type: string description: >- - The revision name of the method used to calculate the Confidence + The version 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. comment: type: string - IdentificationSeenAt: - type: object - additionalProperties: false - required: - - global - - subscription - properties: - global: - type: string - nullable: true - format: date-time - x-ogen-time-format: 2006-01-02T15:04:05.999Z07:00 - subscription: - type: string - nullable: true - format: date-time - x-ogen-time-format: 2006-01-02T15:04:05.999Z07:00 - RawDeviceAttributeError: - type: object - additionalProperties: false - properties: - name: - type: string - message: - type: string - RawDeviceAttribute: - type: object - additionalProperties: false - properties: - value: - title: value - error: - $ref: '#/components/schemas/RawDeviceAttributeError' - RawDeviceAttributes: - type: object - description: > - It includes 35+ raw browser identification attributes to provide - Fingerprint users with even more information than our standard visitor - ID provides. This enables Fingerprint users to not have to run our - open-source product in conjunction with Fingerprint Pro Plus and - Enterprise to get those additional attributes. - - Warning: The raw signals data can change at any moment as we improve the - product. We cannot guarantee the internal shape of raw device attributes - to be stable, so typical semantic versioning rules do not apply here. - Use this data with caution without assuming a specific structure beyond - the generic type provided here. - additionalProperties: - $ref: '#/components/schemas/RawDeviceAttribute' - SDK: - type: object - description: Contains information about the SDK used to perform the request. - additionalProperties: false - required: - - platform - - version - properties: - platform: - type: string - description: Platform of the SDK. - version: - type: string - description: SDK version string. Identification: type: object - additionalProperties: false required: - - visitorId - - requestId - - browserDetails - - incognito - - ip - - timestamp - - time - - url - - tag - - visitorFound - - firstSeenAt - - lastSeenAt - - replayed + - visitor_id + - visitor_found properties: - visitorId: + visitor_id: type: string description: >- String of 20 characters that uniquely identifies the visitor's browser or mobile device. - requestId: - type: string - description: Unique identifier of the user's request. - browserDetails: - $ref: '#/components/schemas/BrowserDetails' - incognito: - description: Flag if user used incognito session. - type: boolean - ip: - type: string - description: IP address of the requesting browser or bot. - ipLocation: - $ref: '#/components/schemas/DeprecatedGeolocation' - linkedId: - type: string - description: A customer-provided id that was sent with the request. - suspect: - description: >- - Field is `true` if you have previously set the `suspect` flag for - this event using the [Server API Update event - endpoint](https://dev.fingerprint.com/reference/updateevent). - type: boolean - timestamp: - description: Timestamp of the event with millisecond precision in Unix time. - type: integer - format: int64 - time: - type: string - format: date-time - x-ogen-time-format: 2006-01-02T15:04:05Z07:00 - description: >- - Time expressed according to ISO 8601 in UTC format, when the request - from the JS agent was made. We recommend to treat requests that are - older than 2 minutes as malicious. Otherwise, request replay attacks - are possible. - url: - type: string - description: Page URL from which the request was sent. - tag: - $ref: '#/components/schemas/Tag' confidence: $ref: '#/components/schemas/IdentificationConfidence' - visitorFound: + visitor_found: type: boolean description: Attribute represents if a visitor had been identified before. - firstSeenAt: - $ref: '#/components/schemas/IdentificationSeenAt' - lastSeenAt: - $ref: '#/components/schemas/IdentificationSeenAt' - components: - $ref: '#/components/schemas/RawDeviceAttributes' - replayed: - type: boolean + first_seen_at: + type: integer + format: int64 description: > - `true` if we determined that this payload was replayed, `false` - otherwise. - sdk: - $ref: '#/components/schemas/SDK' - environmentId: - type: string - description: Environment ID associated with the event - ErrorCode: - type: string - enum: - - RequestCannotBeParsed - - TokenRequired - - TokenNotFound - - SubscriptionNotActive - - WrongRegion - - FeatureNotEnabled - - RequestNotFound - - VisitorNotFound - - TooManyRequests - - 429 Too Many Requests - - StateNotReady - - Failed - description: | - Error code: - * `RequestCannotBeParsed` - the query parameters or JSON payload contains some errors - that prevented us from parsing it (wrong type/surpassed limits). - * `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. - * `RequestNotFound` - the specified request ID was not found. It never existed, expired, or it has been deleted. - * `VisitorNotFound` - The specified visitor ID was not found. It never existed or it may have already been deleted. - * `TooManyRequests` - the limit on secret API key requests per second has been exceeded. - * `429 Too Many Requests` - the limit on secret API key requests per second has been exceeded. - * `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. - * `Failed` - internal server error. - Error: + Unix epoch time milliseconds timestamp indicating the time at which + this visitor ID was first seen. example: `1758069706642` - + Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + last_seen_at: + type: integer + format: int64 + description: > + Unix epoch time milliseconds timestamp indicating the time at which + this visitor ID was last seen. example: `1758069706642` - + Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + SupplementaryIDHighRecall: type: object - additionalProperties: false + description: >- + A supplementary browser identifier that prioritizes coverage over + precision. The High Recall ID algorithm matches more generously, i.e., + this identifier will remain the same even when there are subtle + differences between two requests. This algorithm does not create as many + new visitor IDs as the standard algorithms do, but there could be an + increase in false-positive identification. required: - - code - - message + - visitor_id + - visitor_found properties: - code: - $ref: '#/components/schemas/ErrorCode' - message: + visitor_id: type: string - ProductIdentification: + description: >- + String of 20 characters that uniquely identifies the visitor's + browser or mobile device. + visitor_found: + type: boolean + description: Attribute represents if a visitor had been identified before. + confidence: + $ref: '#/components/schemas/IdentificationConfidence' + first_seen_at: + type: integer + format: int64 + description: > + Unix epoch time milliseconds timestamp indicating the time at which + this ID was first seen. example: `1758069706642` - Corresponding to + Wed Sep 17 2025 00:41:46 GMT+0000 + last_seen_at: + type: integer + format: int64 + description: > + Unix epoch time milliseconds timestamp indicating the time at which + this ID was last seen. example: `1758069706642` - Corresponding to + Wed Sep 17 2025 00:41:46 GMT+0000 + Tags: type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Identification' - error: - $ref: '#/components/schemas/Error' - BotdBotResult: + description: >- + A customer-provided value or an object that was sent with the + identification request or updated later. + additionalProperties: true + Url: type: string - enum: - - notDetected - - good - - bad - description: | - Bot detection result: - * `notDetected` - the visitor is not a bot - * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on - * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on - BotdBot: - type: object - description: Stores bot detection result - additionalProperties: false - required: - - result - properties: - result: - $ref: '#/components/schemas/BotdBotResult' - type: - type: string - Botd: + description: > + Page URL from which the request was sent. For example + `https://example.com/` + BundleId: + type: string + description: > + Bundle Id of the iOS application integrated with the Fingerprint SDK for + the event. For example: `com.foo.app` + PackageName: + type: string + description: > + Package name of the Android application integrated with the Fingerprint + SDK for the event. For example: `com.foo.app` + IpAddress: + type: string + description: IP address of the requesting browser or bot. + UserAgent: + type: string + description: > + User Agent of the client, for example: `Mozilla/5.0 (Windows NT 6.1; + Win64; x64) ....` + ClientReferrer: + type: string + description: > + Client Referrer field corresponds to the `document.referrer` field + gathered during an identification request. The value is an empty string + if the user navigated to the page directly (not through a link, but, for + example, by using a bookmark) For example: + `https://example.com/blog/my-article` + BrowserDetails: type: object - description: Contains all the information from Bot Detection product - additionalProperties: false required: - - bot - - url - - ip - - time - - userAgent - - requestId + - browser_name + - browser_full_version + - browser_major_version + - os + - os_version + - device properties: - bot: - $ref: '#/components/schemas/BotdBot' - meta: - $ref: '#/components/schemas/Tag' - linkedId: + browser_name: type: string - description: A customer-provided id that was sent with the request. - url: + browser_major_version: type: string - description: Page URL from which the request was sent. - ip: + browser_full_version: type: string - description: IP address of the requesting browser or bot. - time: + os: type: string - format: date-time - x-ogen-time-format: 2006-01-02T15:04:05.999Z07:00 - description: >- - Time in UTC when the request from the JS agent was made. We - recommend to treat requests that are older than 2 minutes as - malicious. Otherwise, request replay attacks are possible. - userAgent: + os_version: type: string - requestId: + device: type: string - description: Unique identifier of the user's request. - ProductBotd: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Botd' - error: - $ref: '#/components/schemas/Error' - RootApps: + Proximity: type: object - additionalProperties: false + description: > + Proximity ID represents a fixed geographical zone in a discrete global + grid within which the device is observed. required: - - result - properties: - result: - type: boolean - description: > - Android specific root management apps detection. There are 2 - values: - * `true` - Root Management Apps detected (e.g. Magisk). - * `false` - No Root Management Apps detected or the client isn't Android. - ProductRootApps: - type: object - additionalProperties: false + - id + - precision_radius + - confidence properties: - data: - $ref: '#/components/schemas/RootApps' - error: - $ref: '#/components/schemas/Error' - Emulator: + id: + type: string + description: | + A stable privacy-preserving identifier for a given proximity zone. + precision_radius: + type: integer + format: int32 + enum: + - 10 + - 25 + - 65 + - 175 + - 450 + - 1200 + - 3300 + - 8500 + - 22500 + description: | + The radius of the proximity zone’s precision level, in meters. + confidence: + type: number + format: float + minimum: 0 + maximum: 1 + description: > + A value between `0` and `1` representing the likelihood that the + true device location lies within the mapped proximity zone. + * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. + * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. + BotResult: + type: string + enum: + - bad + - good + - not_detected + description: | + Bot detection result: + * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on + * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on + * `not_detected` - the visitor is not a bot + BotType: + type: string + description: | + Additional classification of the bot type if detected. + BotInfo: type: object - additionalProperties: false + description: Extended bot information. required: - - result + - category + - provider + - name + - identity + - confidence properties: - result: - type: boolean + category: + type: string + description: The type and purpose of the bot. + provider: + type: string + description: The organization or company operating the bot. + provider_url: + type: string + description: The URL of the bot provider's website. + name: + type: string + description: The specific name or identifier of the bot. + identity: + type: string + enum: + - verified + - signed + - spoofed + - unknown description: | - Android specific emulator detection. There are 2 values: - * `true` - Emulated environment detected (e.g. launch inside of AVD). - * `false` - No signs of emulated environment detected or the client is not Android. - ProductEmulator: + The verification status of the bot's identity: + * `verified` - well-known bot with publicly verifiable identity, directed by the bot provider. + * `signed` - bot that signs its platform via Web Bot Auth, directed by the bot provider’s customers. + * `spoofed` - bot that claims a public identity but fails verification. + * `unknown` - bot that does not publish a verifiable identity. + confidence: + type: string + enum: + - low + - medium + - high + description: Confidence level of the bot identification. + ClonedApp: + type: boolean + description: > + Android specific cloned application detection. There are 2 values: * + `true` - Presence of app cloners work detected (e.g. fully cloned + application found or launch of it inside of a not main working profile + detected). * `false` - No signs of cloned application detected or the + client is not Android. + DeveloperTools: + type: boolean + description: > + `true` if the browser is Chrome with DevTools open or Firefox with + Developer Tools open, `false` otherwise. + Emulator: + type: boolean + description: > + Android specific emulator detection. There are 2 values: + + * `true` - Emulated environment detected (e.g. launch inside of AVD). + + * `false` - No signs of emulated environment detected or the client is + not Android. + FactoryReset: + type: integer + format: int64 + description: > + The time of the most recent factory reset that happened on the **mobile + device** is expressed as Unix epoch time. When a factory reset cannot be + detected on the mobile device or when the request is initiated from a + browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 + UTC) as a value of 0. See [Factory Reset + Detection](https://docs.fingerprint.com/docs/smart-signals-reference#factory-reset-detection) + to learn more about this Smart Signal. + Frida: + type: boolean + description: > + [Frida](https://frida.re/docs/) detection for Android and iOS devices. + There are 2 values: + + * `true` - Frida detected + + * `false` - No signs of Frida or the client is not a mobile device. + IPBlockList: type: object - additionalProperties: false properties: - data: - $ref: '#/components/schemas/Emulator' - error: - $ref: '#/components/schemas/Error' + email_spam: + type: boolean + description: IP address was part of a known email spam attack (SMTP). + attack_source: + type: boolean + description: IP address was part of a known network attack (SSH/HTTPS). + tor_node: + type: boolean + description: IP address was part of known TOR network activity. Geolocation: type: object - additionalProperties: false properties: - accuracyRadius: + accuracy_radius: type: integer minimum: 0 description: >- @@ -1450,50 +1155,41 @@ components: format: double minimum: -180 maximum: 180 - postalCode: + postal_code: type: string timezone: type: string format: timezone - city: - $ref: '#/components/schemas/GeolocationCity' - country: - $ref: '#/components/schemas/GeolocationCountry' - continent: - $ref: '#/components/schemas/GeolocationContinent' - subdivisions: - $ref: '#/components/schemas/GeolocationSubdivisions' - IPInfoASN: - type: object - additionalProperties: false - required: - - asn - - name - - network - properties: - asn: + city_name: type: string - name: + country_code: type: string - network: + minLength: 2 + maxLength: 2 + country_name: type: string - IPInfoDataCenter: - type: object - additionalProperties: false - required: - - result - - name - properties: - result: - type: boolean - name: + continent_code: + type: string + minLength: 2 + maxLength: 2 + continent_name: type: string + subdivisions: + type: array + items: + type: object + required: + - iso_code + - name + properties: + iso_code: + type: string + name: + type: string IPInfoV4: type: object - additionalProperties: false required: - address - - geolocation properties: address: type: string @@ -1501,15 +1197,21 @@ components: geolocation: $ref: '#/components/schemas/Geolocation' asn: - $ref: '#/components/schemas/IPInfoASN' - datacenter: - $ref: '#/components/schemas/IPInfoDataCenter' + type: string + asn_name: + type: string + asn_network: + type: string + asn_type: + type: string + datacenter_result: + type: boolean + datacenter_name: + type: string IPInfoV6: type: object - additionalProperties: false required: - address - - geolocation properties: address: type: string @@ -1517,193 +1219,49 @@ components: geolocation: $ref: '#/components/schemas/Geolocation' asn: - $ref: '#/components/schemas/IPInfoASN' - datacenter: - $ref: '#/components/schemas/IPInfoDataCenter' + type: string + asn_name: + type: string + asn_network: + type: string + asn_type: + type: string + datacenter_result: + type: boolean + datacenter_name: + type: string IPInfo: type: object description: >- Details about the request IP address. Has separate fields for v4 and v6 IP address versions. - additionalProperties: false properties: v4: $ref: '#/components/schemas/IPInfoV4' v6: $ref: '#/components/schemas/IPInfoV6' - ProductIPInfo: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/IPInfo' - error: - $ref: '#/components/schemas/Error' - IPBlocklistDetails: - type: object - additionalProperties: false - required: - - emailSpam - - attackSource - properties: - emailSpam: - type: boolean - description: IP address was part of a known email spam attack (SMTP). - attackSource: - type: boolean - description: IP address was part of a known network attack (SSH/HTTPS). - IPBlocklist: - type: object - additionalProperties: false - required: - - result - - details - properties: - result: - type: boolean - description: > - `true` if request IP address is part of any database that we use to - search for known malicious actors, `false` otherwise. - details: - $ref: '#/components/schemas/IPBlocklistDetails' - ProductIPBlocklist: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/IPBlocklist' - error: - $ref: '#/components/schemas/Error' - Tor: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: > - `true` if the request IP address is a known tor exit node, `false` - otherwise. - ProductTor: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Tor' - error: - $ref: '#/components/schemas/Error' - VPNConfidence: - type: string - enum: - - low - - medium - - high - description: >- - A confidence rating for the VPN detection result — "low", "medium", or - "high". Depends on the combination of results returned from all VPN - detection methods. - VPNMethods: - type: object - additionalProperties: false - required: - - timezoneMismatch - - publicVPN - - auxiliaryMobile - - osMismatch - - relay - properties: - timezoneMismatch: - type: boolean - description: >- - The browser timezone doesn't match the timezone inferred from the - request IP address. - publicVPN: - type: boolean - description: >- - Request IP address is owned and used by a public VPN service - provider. - auxiliaryMobile: - type: boolean - description: >- - This method applies to mobile devices only. Indicates the result of - additional methods used to detect a VPN in mobile devices. - osMismatch: - type: boolean - description: >- - The browser runs on a different operating system than the operating - system inferred from the request network signature. - relay: - type: boolean - description: > - Request IP address belongs to a relay service provider, indicating - the use of relay services like [Apple Private - relay](https://support.apple.com/en-us/102602) or [Cloudflare - Warp](https://developers.cloudflare.com/warp-client/). - - - * Like VPNs, relay services anonymize the visitor's true IP address. - - * Unlike traditional VPNs, relay services don't let visitors spoof - their location by choosing an exit node in a different country. - - - This field allows you to differentiate VPN users and relay service - users in your fraud prevention logic. - VPN: - type: object - additionalProperties: false - required: - - result - - confidence - - originTimezone - - originCountry - - methods - properties: - result: - type: boolean - description: >- - VPN or other anonymizing service has been used when sending the - request. - confidence: - $ref: '#/components/schemas/VPNConfidence' - originTimezone: - type: string - description: Local timezone which is used in timezoneMismatch method. - originCountry: - type: string - description: >- - Country of the request (only for Android SDK version >= 2.4.0, ISO - 3166 format or unknown). - methods: - $ref: '#/components/schemas/VPNMethods' - ProductVPN: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/VPN' - error: - $ref: '#/components/schemas/Error' + Proxy: + type: boolean + description: > + IP address was used by a public proxy provider or belonged to a known + recent residential proxy ProxyConfidence: type: string enum: - low - medium - high - description: | - Confidence level of the proxy detection. - If a proxy is not detected, confidence is "high". - If it's detected, can be "low", "medium", or "high". + description: > + Confidence level of the proxy detection. If a proxy is not detected, + confidence is "high". If it's detected, can be "low", "medium", or + "high". ProxyDetails: type: object - nullable: true - additionalProperties: false - description: Proxy detection details (present if proxy is detected) + description: Proxy detection details (present if `proxy` is `true`) required: - - proxyType + - proxy_type properties: - proxyType: + proxy_type: type: string enum: - residential @@ -1713,1282 +1271,1122 @@ components: legitimate traffic, while data center proxies are public proxies hosted in data centers - lastSeenAt: + last_seen_at: + type: integer + format: int64 + description: > + Unix millisecond timestamp with hourly resolution of when this IP + was last seen as a proxy + provider: type: string - format: date-time - x-ogen-time-format: 2006-01-02T15:00:00.000Z - description: | - ISO 8601 formatted timestamp in UTC with hourly resolution - of when this IP was last seen as a proxy when available. - Proxy: - type: object - additionalProperties: false - required: - - result - - confidence - properties: - result: - type: boolean description: > - IP address was used by a public proxy provider or belonged to a - known recent residential proxy - confidence: - $ref: '#/components/schemas/ProxyConfidence' - details: - $ref: '#/components/schemas/ProxyDetails' - ProductProxy: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Proxy' - error: - $ref: '#/components/schemas/Error' + String representing the last proxy service provider detected when + this + + IP was synced. An IP can be shared by multiple service providers. Incognito: + type: boolean + description: > + `true` if we detected incognito mode used in the browser, `false` + otherwise. + Jailbroken: + type: boolean + description: | + iOS specific jailbreak detection. There are 2 values: + * `true` - Jailbreak detected. + * `false` - No signs of jailbreak or the client is not iOS. + LocationSpoofing: + type: boolean + description: >- + Flag indicating whether the request came from a mobile device with + location spoofing enabled. + MitMAttack: + type: boolean + description: > + * `true` - When requests made from your users' mobile devices to + Fingerprint servers have been intercepted and potentially modified. + + * `false` - Otherwise or when the request originated from a browser. + + See [MitM Attack + Detection](https://docs.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) + to learn more about this Smart Signal. + PrivacySettings: + type: boolean + description: > + `true` if the request is from a privacy aware browser (e.g. Tor) or from + a browser in which fingerprinting is blocked. Otherwise `false`. + RootApps: + type: boolean + description: > + Android specific root management apps detection. There are 2 values: + + * `true` - Root Management Apps detected (e.g. Magisk). + + * `false` - No Root Management Apps detected or the client isn't + Android. + RulesetId: + type: string + description: The ID of the evaluated ruleset. + RuleId: + type: string + description: The ID of the rule that matched the identification event. + RuleExpression: + type: string + description: The expression of the rule that matched the identification event. + RuleActionType: + type: string + description: Describes the action to take with the request. + enum: + - allow + - block + RuleActionHeaderField: type: object - additionalProperties: false required: - - result - properties: - result: - type: boolean - description: > - `true` if we detected incognito mode used in the browser, `false` - otherwise. - ProductIncognito: - type: object - additionalProperties: false + - name + - value properties: - data: - $ref: '#/components/schemas/Incognito' - error: - $ref: '#/components/schemas/Error' - Tampering: + name: + type: string + description: The header field name. + value: + type: string + description: The value of the header field. + RequestHeaderModifications: type: object - additionalProperties: false - required: - - result - - anomalyScore - - antiDetectBrowser + description: >- + The set of header modifications to apply, in the following order: + remove, set, append. properties: - result: - type: boolean - description: > - Indicates if an identification request from a browser or an Android - SDK has been tampered with. Not supported in the iOS SDK, is always - `false` for iOS requests. - * `true` - If the request meets either of the following conditions: - * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). - * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). - * `false` - If the request is considered genuine or was generated by the iOS SDK. - anomalyScore: - type: number - format: double - minimum: 0 - maximum: 1 - description: > - A score that indicates the extent of anomalous data in the request. - This field applies to requests originating from **both** browsers - and Android SDKs. - * Values above `0.5` indicate that the request has been tampered with. - * Values below `0.5` indicate that the request is genuine. - antiDetectBrowser: - type: boolean - description: > - Anti-detect browsers try to evade identification by masking or - manipulating their fingerprint to imitate legitimate browser - configurations. This field does not apply to requests originating - from mobile SDKs. - * `true` - The browser resembles a known anti-detect browser, for example, Incognition. - * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. - ProductTampering: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Tampering' - error: - $ref: '#/components/schemas/Error' - ClonedApp: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: | - Android specific cloned application detection. There are 2 values: - * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). - * `false` - No signs of cloned application detected or the client is not Android. - ProductClonedApp: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/ClonedApp' - error: - $ref: '#/components/schemas/Error' - FactoryReset: - type: object - additionalProperties: false - required: - - time - - timestamp - properties: - time: - type: string - format: date-time - description: > - Indicates the time (in UTC) of the most recent factory reset that - happened on the **mobile device**. - - When a factory reset cannot be detected on the mobile device or when - the request is initiated from a browser, this field will correspond - to the *epoch* time (i.e 1 Jan 1970 UTC). - - See [Factory Reset - Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) - to learn more about this Smart Signal. - timestamp: - type: integer - format: int64 - description: > - This field is just another representation of the value in the `time` - field. - - The time of the most recent factory reset that happened on the - **mobile device** is expressed as Unix epoch time. - ProductFactoryReset: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/FactoryReset' - error: - $ref: '#/components/schemas/Error' - Jailbroken: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: | - iOS specific jailbreak detection. There are 2 values: - * `true` - Jailbreak detected. - * `false` - No signs of jailbreak or the client is not iOS. - ProductJailbroken: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Jailbroken' - error: - $ref: '#/components/schemas/Error' - Frida: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: > - [Frida](https://frida.re/docs/) detection for Android and iOS - devices. There are 2 values: - * `true` - Frida detected - * `false` - No signs of Frida or the client is not a mobile device. - ProductFrida: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Frida' - error: - $ref: '#/components/schemas/Error' - PrivacySettings: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: > - `true` if the request is from a privacy aware browser (e.g. Tor) or - from a browser in which fingerprinting is blocked. Otherwise - `false`. - ProductPrivacySettings: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/PrivacySettings' - error: - $ref: '#/components/schemas/Error' - VirtualMachine: - type: object - additionalProperties: false - required: - - result - properties: - result: - type: boolean - description: > - `true` if the request came from a browser running inside a virtual - machine (e.g. VMWare), `false` otherwise. - ProductVirtualMachine: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/VirtualMachine' - error: - $ref: '#/components/schemas/Error' - ProductRawDeviceAttributes: + remove: + type: array + description: The list of headers to remove. + items: + type: string + set: + type: array + description: >- + The list of headers to set, overwriting any existing headers with + the same name. + items: + $ref: '#/components/schemas/RuleActionHeaderField' + append: + type: array + description: The list of headers to append. + items: + $ref: '#/components/schemas/RuleActionHeaderField' + EventRuleActionAllow: + description: >- + Informs the client that the request should be forwarded to the origin + with optional request header modifications. type: object - additionalProperties: false properties: - data: - $ref: '#/components/schemas/RawDeviceAttributes' - error: - $ref: '#/components/schemas/Error' - HighActivity: - type: object - additionalProperties: false + ruleset_id: + $ref: '#/components/schemas/RulesetId' + rule_id: + $ref: '#/components/schemas/RuleId' + rule_expression: + $ref: '#/components/schemas/RuleExpression' + type: + allOf: + - $ref: '#/components/schemas/RuleActionType' + - const: allow + request_header_modifications: + $ref: '#/components/schemas/RequestHeaderModifications' required: - - result - properties: - result: - type: boolean - description: Flag indicating if the request came from a high-activity visitor. - dailyRequests: - type: integer - format: int64 - minimum: 1 - description: Number of requests from the same visitor in the previous day. - ProductHighActivity: + - ruleset_id + - type + StatusCode: + type: integer + description: A valid HTTP status code. + RuleActionBody: + type: string + description: The response body to send to the client. + EventRuleActionBlock: + description: >- + Informs the client the request should be blocked using the response + described by this rule action. type: object - additionalProperties: false properties: - data: - $ref: '#/components/schemas/HighActivity' - error: - $ref: '#/components/schemas/Error' - LocationSpoofing: - type: object - additionalProperties: false + ruleset_id: + $ref: '#/components/schemas/RulesetId' + rule_id: + $ref: '#/components/schemas/RuleId' + rule_expression: + $ref: '#/components/schemas/RuleExpression' + type: + allOf: + - $ref: '#/components/schemas/RuleActionType' + - const: block + status_code: + $ref: '#/components/schemas/StatusCode' + headers: + type: array + description: A list of headers to send. + items: + $ref: '#/components/schemas/RuleActionHeaderField' + body: + $ref: '#/components/schemas/RuleActionBody' required: - - result - properties: - result: - type: boolean - description: >- - Flag indicating whether the request came from a mobile device with - location spoofing enabled. - ProductLocationSpoofing: + - ruleset_id + - type + EventRuleAction: type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/LocationSpoofing' - error: - $ref: '#/components/schemas/Error' + description: >- + Describes the action the client should take, according to the rule in + the ruleset that matched the event. When getting an event by event ID, + the rule_action will only be included when the ruleset_id query + parameter is specified. + oneOf: + - $ref: '#/components/schemas/EventRuleActionAllow' + - $ref: '#/components/schemas/EventRuleActionBlock' + discriminator: + propertyName: type + mapping: + allow: '#/components/schemas/EventRuleActionAllow' + block: '#/components/schemas/EventRuleActionBlock' SuspectScore: + type: integer + description: > + Suspect Score is an easy way to integrate Smart Signals into your fraud + protection work flow. It is a weighted representation of all Smart + Signals present in the payload that helps identify suspicious activity. + The value range is [0; S] where S is sum of all Smart Signals weights. + See more details here: https://docs.fingerprint.com/docs/suspect-score + Tampering: + type: boolean + description: > + Flag indicating browser tampering was detected. This happens when + either: + * There are inconsistencies in the browser configuration that cross internal tampering thresholds (see `tampering_details.anomaly_score`). + * The browser signature resembles an "anti-detect" browser specifically designed to evade fingerprinting (see `tampering_details.anti_detect_browser`). + TamperingDetails: type: object - additionalProperties: false - required: - - result - properties: - result: - type: integer - description: > - Suspect Score is an easy way to integrate Smart Signals into your - fraud protection work flow. It is a weighted representation of all - Smart Signals present in the payload that helps identify suspicious - activity. The value range is [0; S] where S is sum of all Smart - Signals weights. See more details here: - https://dev.fingerprint.com/docs/suspect-score - ProductSuspectScore: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/SuspectScore' - error: - $ref: '#/components/schemas/Error' - RemoteControl: - type: object - deprecated: true - description: | - This signal is deprecated. - additionalProperties: false - required: - - result properties: - result: + anomaly_score: + type: number + format: double + minimum: 0 + maximum: 1 + x-platforms: + - android + - ios + - browser + description: | + Confidence score (`0.0 - 1.0`) for tampering detection: + * Values above `0.5` indicate tampering. + * Values below `0.5` indicate genuine browsers. + anti_detect_browser: type: boolean + x-platforms: + - browser description: > - `true` if the request came from a machine being remotely controlled - (e.g. TeamViewer), `false` otherwise. - ProductRemoteControl: - type: object - deprecated: true - description: | - This product is deprecated. - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/RemoteControl' - error: - $ref: '#/components/schemas/Error' - VelocityIntervals: + True if the identified browser resembles an "anti-detect" browser, + such as Incognition, which attempts to evade identification by + manipulating its fingerprint. + VelocityData: type: object description: > Is absent if the velocity data could not be generated for the visitor - ID. - additionalProperties: false + Id. required: - - 5m - - 1h + - 5_minutes + - 1_hour properties: - 5m: + 5_minutes: type: integer - 1h: + description: > + Count for the last 5 minutes of velocity data, from the time of the + event. + 1_hour: type: integer - 24h: + description: > + Count for the last 1 hour of velocity data, from the time of the + event. + 24_hours: type: integer description: > - The `24h` interval of `distinctIp`, `distinctLinkedId`, - `distinctCountry`, `distinctIpByLinkedId` and - `distinctVisitorIdByLinkedId` will be omitted if the number of - `events`` for the visitor ID in the last 24 hours - (`events.intervals.['24h']`) is higher than 20.000. - VelocityData: - type: object - additionalProperties: false - properties: - intervals: - $ref: '#/components/schemas/VelocityIntervals' + The `24_hours` interval of `distinct_ip`, `distinct_linked_id`, + `distinct_country`, `distinct_ip_by_linked_id` and + `distinct_visitor_id_by_linked_id` will be omitted if the number of + `events` for the visitor Id in the last 24 hours + (`events.['24_hours']`) is higher than 20.000. Velocity: type: object description: > - Sums key data points for a specific `visitorId`, `ipAddress` and - `linkedId` at three distinct time + Sums key data points for a specific `visitor_id`, `ip_address` and + `linked_id` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: - - Number of distinct IP addresses associated to the visitor ID. + - Number of distinct IP addresses associated to the visitor Id. - - Number of distinct linked IDs associated with the visitor ID. + - Number of distinct linked Ids associated with the visitor Id. - - Number of distinct countries associated with the visitor ID. + - Number of distinct countries associated with the visitor Id. - - Number of identification events associated with the visitor ID. + - Number of identification events associated with the visitor Id. - Number of identification events associated with the detected IP address. - Number of distinct IP addresses associated with the provided linked - ID. + Id. - - Number of distinct visitor IDs associated with the provided linked ID. + - Number of distinct visitor Ids associated with the provided linked Id. - The `24h` interval of `distinctIp`, `distinctLinkedId`, - `distinctCountry`, + The `24h` interval of `distinct_ip`, `distinct_linked_id`, + `distinct_country`, - `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be - omitted + `distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will + be omitted - if the number of `events` for the visitor ID in the last 24 + if the number of `events` for the visitor Id in the last 24 - hours (`events.intervals.['24h']`) is higher than 20.000. - additionalProperties: false - required: - - distinctIp - - distinctLinkedId - - distinctCountry - - events - - ipEvents - - distinctIpByLinkedId - - distinctVisitorIdByLinkedId + hours (`events.['24h']`) is higher than 20.000. + + + All will not necessarily be returned in a response, some may be omitted + if the + + associated event does not have the required data, such as a linked_id. properties: - distinctIp: + distinct_ip: $ref: '#/components/schemas/VelocityData' - distinctLinkedId: + distinct_linked_id: $ref: '#/components/schemas/VelocityData' - distinctCountry: + distinct_country: $ref: '#/components/schemas/VelocityData' events: $ref: '#/components/schemas/VelocityData' - ipEvents: + ip_events: $ref: '#/components/schemas/VelocityData' - distinctIpByLinkedId: + distinct_ip_by_linked_id: $ref: '#/components/schemas/VelocityData' - distinctVisitorIdByLinkedId: + distinct_visitor_id_by_linked_id: $ref: '#/components/schemas/VelocityData' - ProductVelocity: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Velocity' - error: - $ref: '#/components/schemas/Error' - DeveloperTools: + VirtualMachine: + type: boolean + description: > + `true` if the request came from a browser running inside a virtual + machine (e.g. VMWare), `false` otherwise. + Vpn: + type: boolean + description: | + VPN or other anonymizing service has been used when sending the request. + VpnConfidence: + type: string + enum: + - low + - medium + - high + description: >- + A confidence rating for the VPN detection result — "low", "medium", or + "high". Depends on the combination of results returned from all VPN + detection methods. + VpnOriginTimezone: + type: string + description: | + Local timezone which is used in timezone_mismatch method. + VpnOriginCountry: + type: string + description: > + Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 + format or unknown). + VpnMethods: type: object - additionalProperties: false - required: - - result properties: - result: + timezone_mismatch: type: boolean - description: > - `true` if the browser is Chrome with DevTools open or Firefox with - Developer Tools open, `false` otherwise. - ProductDeveloperTools: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/DeveloperTools' - error: - $ref: '#/components/schemas/Error' - MitMAttack: - type: object - additionalProperties: false - required: - - result - properties: - result: + x-platforms: + - android + - ios + - browser + description: >- + The browser timezone doesn't match the timezone inferred from the + request IP address. + public_vpn: + type: boolean + x-platforms: + - android + - ios + - browser + description: >- + Request IP address is owned and used by a public VPN service + provider. + auxiliary_mobile: + type: boolean + x-platforms: + - android + - ios + - browser + description: >- + This method applies to mobile devices only. Indicates the result of + additional methods used to detect a VPN in mobile devices. + os_mismatch: + type: boolean + x-platforms: + - browser + description: >- + The browser runs on a different operating system than the operating + system inferred from the request network signature. + relay: type: boolean + x-platforms: + - android + - ios + - browser description: > - * `true` - When requests made from your users' mobile devices to - Fingerprint servers have been intercepted and potentially modified. + Request IP address belongs to a relay service provider, indicating + the use of relay services like [Apple Private + relay](https://support.apple.com/en-us/102602) or [Cloudflare + Warp](https://developers.cloudflare.com/warp-client/). + - * `false` - Otherwise or when the request originated from a browser. + * Like VPNs, relay services anonymize the visitor's true IP address. + + * Unlike traditional VPNs, relay services don't let visitors spoof + their location by choosing an exit node in a different country. - See [MitM Attack - Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) - to learn more about this Smart Signal. - ProductMitMAttack: + + This field allows you to differentiate VPN users and relay service + users in your fraud prevention logic. + HighActivity: + type: boolean + description: Flag indicating if the request came from a high-activity visitor. + FontPreferences: type: object - additionalProperties: false + description: > + Baseline measurement of canonical fonts rendered on the device. Numeric + width metrics, in CSS pixels, for the canonical fonts collected by the + agent. properties: - data: - $ref: '#/components/schemas/MitMAttack' - error: - $ref: '#/components/schemas/Error' - Proximity: + default: + type: number + format: double + serif: + type: number + format: double + sans: + type: number + format: double + mono: + type: number + format: double + apple: + type: number + format: double + min: + type: number + format: double + system: + type: number + format: double + Emoji: type: object - description: > - Proximity ID represents a fixed geographical zone in a discrete global - grid within which the device is observed. - additionalProperties: false - required: - - id - - precisionRadius - - confidence + description: Bounding box metrics describing how the emoji glyph renders. properties: - id: + font: type: string - description: | - A stable privacy-preserving identifier for a given proximity zone. - precisionRadius: - type: integer - format: int32 - enum: - - 10 - - 25 - - 65 - - 175 - - 450 - - 1200 - - 3300 - - 8500 - - 22500 - description: | - The radius of the proximity zone’s precision level, in meters. - confidence: + description: Font family reported by the browser when drawing the emoji. + width: type: number - format: float - minimum: 0 - maximum: 1 - description: > - A value between `0` and `1` representing the likelihood that the - true device location lies within the mapped proximity zone. - * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. - * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. - ProductProximity: - type: object - additionalProperties: false - properties: - data: - $ref: '#/components/schemas/Proximity' - error: - $ref: '#/components/schemas/Error' - Products: - type: object - description: >- - Contains all information about the request identified by `requestId`, - depending on the pricing plan (Pro, Pro Plus, Enterprise) - additionalProperties: false - properties: - identification: - $ref: '#/components/schemas/ProductIdentification' - botd: - $ref: '#/components/schemas/ProductBotd' - rootApps: - $ref: '#/components/schemas/ProductRootApps' - emulator: - $ref: '#/components/schemas/ProductEmulator' - ipInfo: - $ref: '#/components/schemas/ProductIPInfo' - ipBlocklist: - $ref: '#/components/schemas/ProductIPBlocklist' - tor: - $ref: '#/components/schemas/ProductTor' - vpn: - $ref: '#/components/schemas/ProductVPN' - proxy: - $ref: '#/components/schemas/ProductProxy' - incognito: - $ref: '#/components/schemas/ProductIncognito' - tampering: - $ref: '#/components/schemas/ProductTampering' - clonedApp: - $ref: '#/components/schemas/ProductClonedApp' - factoryReset: - $ref: '#/components/schemas/ProductFactoryReset' - jailbroken: - $ref: '#/components/schemas/ProductJailbroken' - frida: - $ref: '#/components/schemas/ProductFrida' - privacySettings: - $ref: '#/components/schemas/ProductPrivacySettings' - virtualMachine: - $ref: '#/components/schemas/ProductVirtualMachine' - rawDeviceAttributes: - $ref: '#/components/schemas/ProductRawDeviceAttributes' - highActivity: - $ref: '#/components/schemas/ProductHighActivity' - locationSpoofing: - $ref: '#/components/schemas/ProductLocationSpoofing' - suspectScore: - $ref: '#/components/schemas/ProductSuspectScore' - remoteControl: - $ref: '#/components/schemas/ProductRemoteControl' - velocity: - $ref: '#/components/schemas/ProductVelocity' - developerTools: - $ref: '#/components/schemas/ProductDeveloperTools' - mitmAttack: - $ref: '#/components/schemas/ProductMitMAttack' - proximity: - $ref: '#/components/schemas/ProductProximity' - EventsGetResponse: - type: object - description: >- - Contains results from all activated products - Fingerprint Pro, Bot - Detection, and others. - additionalProperties: false - required: - - products - properties: - products: - $ref: '#/components/schemas/Products' - ErrorResponse: - type: object - additionalProperties: false - required: - - error - properties: - error: - $ref: '#/components/schemas/Error' - EventsUpdateRequest: + format: double + height: + type: number + format: double + top: + type: number + format: double + bottom: + type: number + format: double + left: + type: number + format: double + right: + type: number + format: double + x: + type: number + format: double + 'y': + type: number + format: double + Fonts: + type: array + description: List of fonts detected on the device. + items: + type: string + example: + - Arial Unicode MS + - Gill Sans + - Helvetica Neue + - Menlo + DeviceMemory: + type: integer + format: int32 + minimum: 0 + example: 8 + description: Rounded amount of RAM (in gigabytes) reported by the browser. + Timezone: + type: string + description: Timezone identifier detected on the client. + Canvas: type: object + description: Canvas fingerprint containing winding flag plus geometry/text hashes. properties: - linkedId: - type: string - description: LinkedID value to assign to the existing event - tag: - $ref: '#/components/schemas/Tag' - suspect: + winding: type: boolean - description: Suspect flag indicating observed suspicious or fraudulent event - x-go-force-pointer: true - SearchEventsResponse: - type: object - description: >- - Contains a list of all identification events matching the specified - search criteria. - additionalProperties: false - properties: - events: - type: array - items: - type: object - description: Device intelligence results for the identification event. - required: - - products - properties: - products: - $ref: '#/components/schemas/Products' - paginationKey: + geometry: type: string - description: >- - Use this value in the `pagination_key` parameter to request the next - page of search results. - Visit: + description: Hash of geometry rendering output or `unsupported` markers. + text: + type: string + description: Hash of text rendering output or `unsupported` markers. + Languages: + type: array + description: > + Navigator languages reported by the agent including fallbacks. Each + inner array represents ordered language preferences reported by + different APIs. + items: + type: array + items: + type: string + WebGlExtensions: type: object - additionalProperties: false - required: - - requestId - - browserDetails - - incognito - - ip - - timestamp - - time - - url - - tag - - visitorFound - - firstSeenAt - - lastSeenAt + description: Hashes of WebGL context attributes and extension support. properties: - requestId: + context_attributes: type: string - description: Unique identifier of the user's request. - browserDetails: - $ref: '#/components/schemas/BrowserDetails' - incognito: - type: boolean - description: Flag if user used incognito session. - ip: + parameters: type: string - description: IP address of the requesting browser or bot. - ipLocation: - $ref: '#/components/schemas/DeprecatedGeolocation' - linkedId: + shader_precisions: type: string - description: A customer-provided id that was sent with the request. - timestamp: - type: integer - format: int64 - description: Timestamp of the event with millisecond precision in Unix time. - time: + extensions: type: string - format: date-time - x-ogen-time-format: 2006-01-02T15:04:05Z07:00 - description: >- - Time expressed according to ISO 8601 in UTC format, when the request - from the client agent was made. We recommend to treat requests that - are older than 2 minutes as malicious. Otherwise, request replay - attacks are possible. - url: + extension_parameters: type: string - description: Page URL from which the request was sent. - tag: - $ref: '#/components/schemas/Tag' - confidence: - $ref: '#/components/schemas/IdentificationConfidence' - visitorFound: - type: boolean - description: Attribute represents if a visitor had been identified before. - firstSeenAt: - $ref: '#/components/schemas/IdentificationSeenAt' - lastSeenAt: - $ref: '#/components/schemas/IdentificationSeenAt' - components: - $ref: '#/components/schemas/RawDeviceAttributes' - VisitorsGetResponse: - type: object - description: >- - Pagination-related fields `lastTimestamp` and `paginationKey` are - included if you use a pagination parameter like `limit` or `before` and - there is more data available on the next page. - additionalProperties: false - required: - - visitorId - - visits - properties: - visitorId: - type: string - visits: + unsupported_extensions: type: array items: - $ref: '#/components/schemas/Visit' - lastTimestamp: - deprecated: true - type: integer - format: int64 - description: > - ⚠️ Deprecated paging attribute, please use `paginationKey` instead. - Timestamp of the last visit in the current page of results. - paginationKey: - type: string - description: >- - Request ID of the last visit in the current page of results. Use - this value in the following request as the `paginationKey` parameter - to get the next page of results. - ErrorPlainResponse: + type: string + WebGlBasics: type: object - additionalProperties: false - required: - - error + description: Render and vendor strings reported by the WebGL context. properties: - error: + version: type: string - RelatedVisitor: - type: object - additionalProperties: false - required: - - visitorId - properties: - visitorId: + vendor: type: string - description: >- - Visitor ID of a browser that originates from the same mobile device - as the input visitor ID. - RelatedVisitorsResponse: - type: object - additionalProperties: false - required: - - relatedVisitors - properties: - relatedVisitors: - type: array - items: - $ref: '#/components/schemas/RelatedVisitor' - WebhookRootApps: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - Android specific root management apps detection. There are 2 - values: - * `true` - Root Management Apps detected (e.g. Magisk). - * `false` - No Root Management Apps detected or the client isn't Android. - WebhookEmulator: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: | - Android specific emulator detection. There are 2 values: - * `true` - Emulated environment detected (e.g. launch inside of AVD). - * `false` - No signs of emulated environment detected or the client is not Android. - WebhookIPInfo: - type: object - description: >- - Details about the request IP address. Has separate fields for v4 and v6 - IP address versions. - additionalProperties: false - properties: - v4: - $ref: '#/components/schemas/IPInfoV4' - v6: - $ref: '#/components/schemas/IPInfoV6' - WebhookIPBlocklist: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - `true` if request IP address is part of any database that we use to - search for known malicious actors, `false` otherwise. - details: - $ref: '#/components/schemas/IPBlocklistDetails' - WebhookTor: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - `true` if the request IP address is a known tor exit node, `false` - otherwise. - WebhookVPN: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: >- - VPN or other anonymizing service has been used when sending the - request. - confidence: - $ref: '#/components/schemas/VPNConfidence' - originTimezone: + vendor_unmasked: type: string - description: Local timezone which is used in timezoneMismatch method. - originCountry: + renderer: type: string - description: >- - Country of the request (only for Android SDK version >= 2.4.0, ISO - 3166 format or unknown). - methods: - $ref: '#/components/schemas/VPNMethods' - WebhookProxy: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - IP address was used by a public proxy provider or belonged to a - known recent residential proxy - confidence: - $ref: '#/components/schemas/ProxyConfidence' - details: - $ref: '#/components/schemas/ProxyDetails' - WebhookTampering: + renderer_unmasked: + type: string + shading_language_version: + type: string + ScreenResolution: + type: array + description: Current screen resolution. + minItems: 2 + maxItems: 2 + items: + type: integer + format: int32 + TouchSupport: type: object - additionalProperties: false + description: Browser-reported touch capabilities. properties: - result: + touch_event: type: boolean - description: > - Indicates if an identification request from a browser or an Android - SDK has been tampered with. Not supported in the iOS SDK, is always - `false` for iOS requests. - * `true` - If the request meets either of the following conditions: - * Contains anomalous browser or device attributes that could not have been legitimately produced by the JavaScript agent or the Android SDK (see `anomalyScore`). - * Originated from an anti-detect browser like Incognition (see `antiDetectBrowser`). - * `false` - If the request is considered genuine or was generated by the iOS SDK. - anomalyScore: - type: number - format: double - minimum: 0 - maximum: 1 - description: > - A score that indicates the extent of anomalous data in the request. - This field applies to requests originating from **both** browsers - and Android SDKs. - * Values above `0.5` indicate that the request has been tampered with. - * Values below `0.5` indicate that the request is genuine. - antiDetectBrowser: + touch_start: type: boolean - description: > - Anti-detect browsers try to evade identification by masking or - manipulating their fingerprint to imitate legitimate browser - configurations. This field does not apply to requests originating - from mobile SDKs. - * `true` - The browser resembles a known anti-detect browser, for example, Incognition. - * `false` - The browser does not resemble an anti-detect browser or the request originates from a mobile SDK. - WebhookClonedApp: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: | - Android specific cloned application detection. There are 2 values: - * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). - * `false` - No signs of cloned application detected or the client is not Android. - WebhookFactoryReset: - type: object - additionalProperties: false - properties: - time: - type: string - format: date-time - description: > - Indicates the time (in UTC) of the most recent factory reset that - happened on the **mobile device**. - - When a factory reset cannot be detected on the mobile device or when - the request is initiated from a browser, this field will correspond - to the *epoch* time (i.e 1 Jan 1970 UTC). - - See [Factory Reset - Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) - to learn more about this Smart Signal. - timestamp: + max_touch_points: type: integer format: int64 - description: > - This field is just another representation of the value in the `time` - field. - - The time of the most recent factory reset that happened on the - **mobile device** is expressed as Unix epoch time. - WebhookJailbroken: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: | - iOS specific jailbreak detection. There are 2 values: - * `true` - Jailbreak detected. - * `false` - No signs of jailbreak or the client is not iOS. - WebhookFrida: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - [Frida](https://frida.re/docs/) detection for Android and iOS - devices. There are 2 values: - * `true` - Frida detected - * `false` - No signs of Frida or the client is not a mobile device. - WebhookPrivacySettings: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - `true` if the request is from a privacy aware browser (e.g. Tor) or - from a browser in which fingerprinting is blocked. Otherwise - `false`. - WebhookVirtualMachine: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - `true` if the request came from a browser running inside a virtual - machine (e.g. VMWare), `false` otherwise. - WebhookRawDeviceAttributes: + Oscpu: + type: string + description: Navigator `oscpu` string. + Architecture: + type: integer + format: int32 + description: Integer representing the CPU architecture exposed by the browser. + CookiesEnabled: + type: boolean + description: Whether the cookies are enabled in the browser. + HardwareConcurrency: + type: integer + format: int32 + minimum: 1 + description: Number of logical CPU cores reported by the browser. + DateTimeLocale: + type: string + description: > + Locale derived from the Intl.DateTimeFormat API. Negative values + indicate known error states. The negative statuses can be: - "-1": A + permanent status for browsers that don't support Intl API. - "-2": A + permanent status for browsers that don't supportDateTimeFormat + constructor. - "-3": A permanent status for browsers in which + DateTimeFormat locale is undefined or null. + Vendor: + type: string + description: Navigator vendor string. + ColorDepth: + type: integer + format: int32 + description: Screen color depth in bits. + Platform: + type: string + description: Navigator platform string. + SessionStorage: + type: boolean + description: Whether sessionStorage is available. + LocalStorage: + type: boolean + description: Whether localStorage is available. + Audio: + type: number + format: double + description: > + AudioContext fingerprint or negative status when unavailable. The + negative statuses can be: - -1: A permanent status for those browsers + which are known to always suspend audio context - -2: A permanent status + for browsers that don't support the signal - -3: A temporary status that + means that an unexpected timeout has happened + Plugins: + type: array + description: Browser plugins reported by `navigator.plugins`. + items: + type: object + properties: + name: + type: string + description: + type: string + mimeTypes: + type: array + items: + type: object + properties: + type: + type: string + suffixes: + type: string + description: + type: string + required: + - name + IndexedDb: + type: boolean + description: Whether IndexedDB is available. + Math: + type: string + description: Hash of Math APIs used for entropy collection. + RawDeviceAttributes: type: object description: > - It includes 35+ raw browser identification attributes to provide - Fingerprint users with even more information than our standard visitor - ID provides. This enables Fingerprint users to not have to run our - open-source product in conjunction with Fingerprint Pro Plus and - Enterprise to get those additional attributes. - - Warning: The raw signals data can change at any moment as we improve the - product. We cannot guarantee the internal shape of raw device attributes - to be stable, so typical semantic versioning rules do not apply here. - Use this data with caution without assuming a specific structure beyond - the generic type provided here. - additionalProperties: - $ref: '#/components/schemas/RawDeviceAttribute' - WebhookHighActivity: + A curated subset of raw browser/device attributes that the API surface + exposes. Each property contains a value or object with the data for the + collected signal. + properties: + font_preferences: + $ref: '#/components/schemas/FontPreferences' + emoji: + $ref: '#/components/schemas/Emoji' + fonts: + $ref: '#/components/schemas/Fonts' + device_memory: + $ref: '#/components/schemas/DeviceMemory' + timezone: + $ref: '#/components/schemas/Timezone' + canvas: + $ref: '#/components/schemas/Canvas' + languages: + $ref: '#/components/schemas/Languages' + webgl_extensions: + $ref: '#/components/schemas/WebGlExtensions' + webgl_basics: + $ref: '#/components/schemas/WebGlBasics' + screen_resolution: + $ref: '#/components/schemas/ScreenResolution' + touch_support: + $ref: '#/components/schemas/TouchSupport' + oscpu: + $ref: '#/components/schemas/Oscpu' + architecture: + $ref: '#/components/schemas/Architecture' + cookies_enabled: + $ref: '#/components/schemas/CookiesEnabled' + hardware_concurrency: + $ref: '#/components/schemas/HardwareConcurrency' + date_time_locale: + $ref: '#/components/schemas/DateTimeLocale' + vendor: + $ref: '#/components/schemas/Vendor' + color_depth: + $ref: '#/components/schemas/ColorDepth' + platform: + $ref: '#/components/schemas/Platform' + session_storage: + $ref: '#/components/schemas/SessionStorage' + local_storage: + $ref: '#/components/schemas/LocalStorage' + audio: + $ref: '#/components/schemas/Audio' + plugins: + $ref: '#/components/schemas/Plugins' + indexed_db: + $ref: '#/components/schemas/IndexedDb' + math: + $ref: '#/components/schemas/Math' + Event: type: object - additionalProperties: false + description: >- + Contains results from Fingerprint Identification and all active Smart + Signals. required: - - result - properties: - result: - type: boolean - description: Flag indicating if the request came from a high-activity visitor. - dailyRequests: - type: integer - format: int64 - minimum: 1 - description: Number of requests from the same visitor in the previous day. - WebhookLocationSpoofing: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: >- - Flag indicating whether the request came from a mobile device with - location spoofing enabled. - WebhookSuspectScore: - type: object - additionalProperties: false - properties: - result: - type: integer - description: > - Suspect Score is an easy way to integrate Smart Signals into your - fraud protection work flow. It is a weighted representation of all - Smart Signals present in the payload that helps identify suspicious - activity. The value range is [0; S] where S is sum of all Smart - Signals weights. See more details here: - https://dev.fingerprint.com/docs/suspect-score - WebhookRemoteControl: - type: object - deprecated: true - description: | - This signal is deprecated. - additionalProperties: false + - event_id + - timestamp properties: - result: - type: boolean - description: > - `true` if the request came from a machine being remotely controlled - (e.g. TeamViewer), `false` otherwise. - WebhookVelocity: - type: object + event_id: + $ref: '#/components/schemas/EventId' + x-platforms: + - android + - ios + - browser + timestamp: + $ref: '#/components/schemas/Timestamp' + x-platforms: + - android + - ios + - browser + linked_id: + $ref: '#/components/schemas/LinkedId' + x-platforms: + - android + - ios + - browser + environment_id: + $ref: '#/components/schemas/EnvironmentId' + x-platforms: + - android + - ios + - browser + suspect: + $ref: '#/components/schemas/Suspect' + x-platforms: + - android + - ios + - browser + sdk: + $ref: '#/components/schemas/SDK' + x-platforms: + - android + - ios + - browser + replayed: + $ref: '#/components/schemas/Replayed' + x-platforms: + - android + - ios + - browser + identification: + $ref: '#/components/schemas/Identification' + x-platforms: + - android + - ios + - browser + supplementary_id_high_recall: + $ref: '#/components/schemas/SupplementaryIDHighRecall' + x-platforms: + - android + - ios + - browser + tags: + $ref: '#/components/schemas/Tags' + x-platforms: + - android + - ios + - browser + url: + $ref: '#/components/schemas/Url' + x-platforms: + - browser + bundle_id: + $ref: '#/components/schemas/BundleId' + x-platforms: + - ios + package_name: + $ref: '#/components/schemas/PackageName' + x-platforms: + - android + ip_address: + $ref: '#/components/schemas/IpAddress' + x-platforms: + - android + - ios + - browser + user_agent: + $ref: '#/components/schemas/UserAgent' + x-platforms: + - android + - ios + - browser + client_referrer: + $ref: '#/components/schemas/ClientReferrer' + x-platforms: + - browser + browser_details: + $ref: '#/components/schemas/BrowserDetails' + x-platforms: + - browser + proximity: + $ref: '#/components/schemas/Proximity' + x-platforms: + - android + - ios + bot: + $ref: '#/components/schemas/BotResult' + x-platforms: + - browser + bot_type: + $ref: '#/components/schemas/BotType' + x-platforms: + - browser + bot_info: + $ref: '#/components/schemas/BotInfo' + x-platforms: + - browser + cloned_app: + $ref: '#/components/schemas/ClonedApp' + x-platforms: + - android + developer_tools: + $ref: '#/components/schemas/DeveloperTools' + x-platforms: + - browser + emulator: + $ref: '#/components/schemas/Emulator' + x-platforms: + - android + factory_reset_timestamp: + $ref: '#/components/schemas/FactoryReset' + x-platforms: + - android + - ios + frida: + $ref: '#/components/schemas/Frida' + x-platforms: + - android + - ios + ip_blocklist: + $ref: '#/components/schemas/IPBlockList' + x-platforms: + - android + - ios + - browser + ip_info: + $ref: '#/components/schemas/IPInfo' + x-platforms: + - android + - ios + - browser + proxy: + $ref: '#/components/schemas/Proxy' + x-platforms: + - android + - ios + - browser + proxy_confidence: + $ref: '#/components/schemas/ProxyConfidence' + x-platforms: + - android + - ios + - browser + proxy_details: + $ref: '#/components/schemas/ProxyDetails' + x-platforms: + - android + - ios + - browser + incognito: + $ref: '#/components/schemas/Incognito' + x-platforms: + - browser + jailbroken: + $ref: '#/components/schemas/Jailbroken' + x-platforms: + - ios + location_spoofing: + $ref: '#/components/schemas/LocationSpoofing' + x-platforms: + - android + - ios + mitm_attack: + $ref: '#/components/schemas/MitMAttack' + x-platforms: + - android + - ios + privacy_settings: + $ref: '#/components/schemas/PrivacySettings' + x-platforms: + - browser + root_apps: + $ref: '#/components/schemas/RootApps' + x-platforms: + - android + rule_action: + $ref: '#/components/schemas/EventRuleAction' + suspect_score: + $ref: '#/components/schemas/SuspectScore' + x-platforms: + - android + - ios + - browser + tampering: + $ref: '#/components/schemas/Tampering' + x-platforms: + - android + - ios + - browser + tampering_details: + $ref: '#/components/schemas/TamperingDetails' + x-platforms: + - android + - ios + - browser + velocity: + $ref: '#/components/schemas/Velocity' + x-platforms: + - android + - ios + - browser + virtual_machine: + $ref: '#/components/schemas/VirtualMachine' + x-platforms: + - browser + vpn: + $ref: '#/components/schemas/Vpn' + x-platforms: + - android + - ios + - browser + vpn_confidence: + $ref: '#/components/schemas/VpnConfidence' + x-platforms: + - android + - ios + - browser + vpn_origin_timezone: + $ref: '#/components/schemas/VpnOriginTimezone' + x-platforms: + - android + - ios + - browser + vpn_origin_country: + $ref: '#/components/schemas/VpnOriginCountry' + x-platforms: + - android + - ios + vpn_methods: + $ref: '#/components/schemas/VpnMethods' + x-platforms: + - android + - ios + - browser + high_activity_device: + $ref: '#/components/schemas/HighActivity' + x-platforms: + - android + - ios + - browser + raw_device_attributes: + $ref: '#/components/schemas/RawDeviceAttributes' + x-platforms: + - browser + ErrorCode: + type: string + enum: + - request_cannot_be_parsed + - secret_api_key_required + - secret_api_key_not_found + - public_api_key_required + - public_api_key_not_found + - subscription_not_active + - wrong_region + - feature_not_enabled + - request_not_found + - visitor_not_found + - too_many_requests + - state_not_ready + - failed + - event_not_found + - missing_module + - payload_too_large + - service_unavailable + - ruleset_not_found description: > - Sums key data points for a specific `visitorId`, `ipAddress` and - `linkedId` at three distinct time + Error code: - intervals: 5 minutes, 1 hour, and 24 hours as follows: + * `request_cannot_be_parsed` - The query parameters or JSON payload + contains some errors + that prevented us from parsing it (wrong type/surpassed limits). + * `secret_api_key_required` - secret API key in header is missing or + empty. + * `secret_api_key_not_found` - No Fingerprint workspace found for + specified secret API key. - - Number of distinct IP addresses associated to the visitor ID. + * `public_api_key_required` - public API key in header is missing or + empty. - - Number of distinct linked IDs associated with the visitor ID. + * `public_api_key_not_found` - No Fingerprint workspace found for + specified public API key. - - Number of distinct countries associated with the visitor ID. + * `subscription_not_active` - Fingerprint workspace is not active. - - Number of identification events associated with the visitor ID. + * `wrong_region` - Server and workspace region differ. - - Number of identification events associated with the detected IP - address. + * `feature_not_enabled` - This feature (for example, Delete API) is not + enabled for your workspace. - - Number of distinct IP addresses associated with the provided linked - ID. + * `request_not_found` - The specified event ID was not found. It never + existed, expired, or it has been deleted. - - Number of distinct visitor IDs associated with the provided linked ID. + * `visitor_not_found` - The specified visitor ID was not found. It never + existed or it may have already been deleted. + * `too_many_requests` - The limit on secret API key requests per second + has been exceeded. - The `24h` interval of `distinctIp`, `distinctLinkedId`, - `distinctCountry`, + * `state_not_ready` - The event specified with event ID is + not ready for updates yet. Try again. + This error happens in rare cases when update API is called immediately + after receiving the event ID on the client. In case you need to send + information right away, we recommend using the JS agent API instead. + * `failed` - Internal server error. - `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be - omitted + * `event_not_found` - The specified event ID was not found. It never + existed, expired, or it has been deleted. - if the number of `events` for the visitor ID in the last 24 + * `missing_module` - The request is invalid because it is missing a + required module. - hours (`events.intervals.['24h']`) is higher than 20.000. - additionalProperties: false - properties: - distinctIp: - $ref: '#/components/schemas/VelocityData' - distinctLinkedId: - $ref: '#/components/schemas/VelocityData' - distinctCountry: - $ref: '#/components/schemas/VelocityData' - events: - $ref: '#/components/schemas/VelocityData' - ipEvents: - $ref: '#/components/schemas/VelocityData' - distinctIpByLinkedId: - $ref: '#/components/schemas/VelocityData' - distinctVisitorIdByLinkedId: - $ref: '#/components/schemas/VelocityData' - WebhookDeveloperTools: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - `true` if the browser is Chrome with DevTools open or Firefox with - Developer Tools open, `false` otherwise. - WebhookMitMAttack: - type: object - additionalProperties: false - properties: - result: - type: boolean - description: > - * `true` - When requests made from your users' mobile devices to - Fingerprint servers have been intercepted and potentially modified. + * `payload_too_large` - The request payload is too large and cannot be + processed. - * `false` - Otherwise or when the request originated from a browser. + * `service_unavailable` - The service was unable to process the request. - See [MitM Attack - Detection](https://dev.fingerprint.com/docs/smart-signals-overview#mitm-attack-detection) - to learn more about this Smart Signal. - SupplementaryID: + * `ruleset_not_found` - The specified ruleset was not found. It never + existed or it has been deleted. + Error: type: object - additionalProperties: false + required: + - code + - message properties: - visitorId: + code: + $ref: '#/components/schemas/ErrorCode' + message: type: string - description: >- - String of 20 characters that uniquely identifies the visitor's - browser or mobile device. - visitorFound: - type: boolean - description: Attribute represents if a visitor had been identified before. - confidence: - $ref: '#/components/schemas/IdentificationConfidence' - firstSeenAt: - $ref: '#/components/schemas/IdentificationSeenAt' - lastSeenAt: - $ref: '#/components/schemas/IdentificationSeenAt' - WebhookSupplementaryIDs: + ErrorResponse: type: object - description: Other identities that have been established for a given Visitor. required: - - standard - - highRecall + - error properties: - standard: - $ref: '#/components/schemas/SupplementaryID' - highRecall: - $ref: '#/components/schemas/SupplementaryID' - WebhookProximity: + error: + $ref: '#/components/schemas/Error' + EventUpdate: type: object - description: > - Proximity ID represents a fixed geographical zone in a discrete global - grid within which the device is observed. - additionalProperties: false - required: - - id - - precisionRadius - - confidence properties: - id: + linked_id: type: string - description: | - A stable privacy-preserving identifier for a given proximity zone. - precisionRadius: - type: integer - format: int32 - enum: - - 10 - - 25 - - 65 - - 175 - - 450 - - 1200 - - 3300 - - 8500 - - 22500 - description: | - The radius of the proximity zone’s precision level, in meters. - confidence: - type: number - format: float - minimum: 0 - maximum: 1 - description: > - A value between `0` and `1` representing the likelihood that the - true device location lies within the mapped proximity zone. - * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. - * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. - Webhook: + description: Linked Id value to assign to the existing event + tags: + type: object + description: >- + A customer-provided value or an object that was sent with the + identification request or updated later. + additionalProperties: true + suspect: + type: boolean + description: Suspect flag indicating observed suspicious or fraudulent event + x-go-force-pointer: true + EventSearch: type: object + description: >- + Contains a list of all identification events matching the specified + search criteria. required: - - requestId - - url - - ip - - time - - timestamp - - sdk + - events properties: - requestId: - type: string - description: Unique identifier of the user's request. - url: - type: string - description: Page URL from which the request was sent. - ip: - type: string - description: IP address of the requesting browser or bot. - environmentId: - type: string - description: Environment ID of the event. - tag: - $ref: '#/components/schemas/Tag' - time: + events: + type: array + items: + $ref: '#/components/schemas/Event' + pagination_key: type: string - format: date-time - x-ogen-time-format: 2006-01-02T15:04:05.999Z07:00 description: >- - Time expressed according to ISO 8601 in UTC format, when the request - from the JS agent was made. We recommend to treat requests that are - older than 2 minutes as malicious. Otherwise, request replay attacks - are possible. - timestamp: + Use this value in the `pagination_key` parameter to request the next + page of search results. + total_hits: type: integer format: int64 - description: Timestamp of the event with millisecond precision in Unix time. - ipLocation: - $ref: '#/components/schemas/DeprecatedGeolocation' - linkedId: - type: string - description: A customer-provided id that was sent with the request. - visitorId: - type: string description: >- - String of 20 characters that uniquely identifies the visitor's - browser or mobile device. - visitorFound: - type: boolean - description: Attribute represents if a visitor had been identified before. - confidence: - $ref: '#/components/schemas/IdentificationConfidence' - firstSeenAt: - $ref: '#/components/schemas/IdentificationSeenAt' - lastSeenAt: - $ref: '#/components/schemas/IdentificationSeenAt' - browserDetails: - $ref: '#/components/schemas/BrowserDetails' - incognito: - type: boolean - description: Flag if user used incognito session. - clientReferrer: - type: string - components: - $ref: '#/components/schemas/RawDeviceAttributes' - bot: - $ref: '#/components/schemas/BotdBot' - userAgent: - type: string - rootApps: - $ref: '#/components/schemas/WebhookRootApps' - emulator: - $ref: '#/components/schemas/WebhookEmulator' - ipInfo: - $ref: '#/components/schemas/WebhookIPInfo' - ipBlocklist: - $ref: '#/components/schemas/WebhookIPBlocklist' - tor: - $ref: '#/components/schemas/WebhookTor' - vpn: - $ref: '#/components/schemas/WebhookVPN' - proxy: - $ref: '#/components/schemas/WebhookProxy' - tampering: - $ref: '#/components/schemas/WebhookTampering' - clonedApp: - $ref: '#/components/schemas/WebhookClonedApp' - factoryReset: - $ref: '#/components/schemas/WebhookFactoryReset' - jailbroken: - $ref: '#/components/schemas/WebhookJailbroken' - frida: - $ref: '#/components/schemas/WebhookFrida' - privacySettings: - $ref: '#/components/schemas/WebhookPrivacySettings' - virtualMachine: - $ref: '#/components/schemas/WebhookVirtualMachine' - rawDeviceAttributes: - $ref: '#/components/schemas/WebhookRawDeviceAttributes' - highActivity: - $ref: '#/components/schemas/WebhookHighActivity' - locationSpoofing: - $ref: '#/components/schemas/WebhookLocationSpoofing' - suspectScore: - $ref: '#/components/schemas/WebhookSuspectScore' - remoteControl: - $ref: '#/components/schemas/WebhookRemoteControl' - velocity: - $ref: '#/components/schemas/WebhookVelocity' - developerTools: - $ref: '#/components/schemas/WebhookDeveloperTools' - mitmAttack: - $ref: '#/components/schemas/WebhookMitMAttack' - replayed: - type: boolean - description: > - `true` if we determined that this payload was replayed, `false` - otherwise. - sdk: - $ref: '#/components/schemas/SDK' - supplementaryIds: - $ref: '#/components/schemas/WebhookSupplementaryIDs' - proximity: - $ref: '#/components/schemas/WebhookProximity' + This value represents the total number of events matching the search + query, up to the limit provided in the `total_hits` query parameter. + Only present if the `total_hits` query parameter was provided. + SearchEventsBot: + type: string + enum: + - all + - good + - bad + - none + description: > + 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 `bot` property + set to a valid value are returned. Events without a `bot` Smart Signal + result are left out of the response. + SearchEventsVpnConfidence: + type: string + enum: + - high + - medium + - low + description: > + 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 `vpn.confidence` + property set to a valid value are returned. Events without a `vpn` Smart + Signal result are left out of the response. + SearchEventsSdkPlatform: + type: string + enum: + - js + - android + - ios + description: > + Filter events by the SDK Platform associated with the identification + event (`sdk.platform` property) . + + `js` - Javascript agent (Web). + + `ios` - Apple iOS based devices. + + `android` - Android based devices. diff --git a/run_checks.py b/run_checks.py index fda51ad2..6796efa9 100644 --- a/run_checks.py +++ b/run_checks.py @@ -6,12 +6,13 @@ from typing import Tuple from fingerprint_server_sdk import FingerprintApi, Configuration +from fingerprint_server_sdk.configuration import Region from fingerprint_server_sdk.rest import ApiException @dataclass(frozen=True) class AppConfig: api_key: str - region: str + region: Region def load_config() -> AppConfig: load_dotenv() @@ -19,7 +20,8 @@ def load_config() -> AppConfig: if not api_key: print("Error: PRIVATE_KEY environment variable not set", file=sys.stderr) sys.exit(1) - region = (os.getenv("REGION") or "us").lower() + region_str = (os.getenv("REGION") or "us").upper() + region = Region[region_str] return AppConfig(api_key=api_key, region=region) def make_client(cfg: AppConfig) -> FingerprintApi: @@ -44,9 +46,8 @@ def main() -> int: print("FingerprintApi.search_events: is empty", file=sys.stderr) return 1 first_event = search_events_response.events[0] - first_event_identification_data = first_event.products.identification.data - visitor_id = first_event_identification_data.visitor_id - request_id = first_event_identification_data.request_id + visitor_id = first_event.identification.visitor_id + event_id = first_event.event_id print("\n\n\nSearch events response: \n", search_events_response) search_events_response_second_page = api.search_events(2, start=start, end=end, pagination_key=search_events_response.pagination_key) @@ -59,52 +60,29 @@ def main() -> int: print("Exception when calling FingerprintApi.search_events: %s\n" % e, file=sys.stderr) return 1 - # Use existing visitor_id from FingerprintApi->search_events response to check FingerprintApi->get_visits method + # Use existing event_id from FingerprintApi->search_events response to check get_event method try: - visits_response = api.get_visits(visitor_id, limit=2) - print("\n\n\nVisits response: \n", visits_response) - - except ApiException as e: - print("Exception when calling FingerprintApi.get_visits: %s\n" % e, file=sys.stderr) - return 1 - - # Use existing request_id from FingerprintApi->search_events response to check FingerprintApi->get_event method - try: - events_response = api.get_event(request_id) - print("\n\n\nEvent response: \n", events_response.products) + event_response = api.get_event(event_id) + print("\n\n\nEvent response: \n", event_response) except ApiException as e: print("Exception when calling FingerprintApi.get_event: %s\n" % e, file=sys.stderr) return 1 - # Async methods examples - try: - visits_response_request = api.get_visits(visitor_id, limit=2, async_req=True) - events_response_request = api.get_event(request_id, async_req=True) - visits_response = visits_response_request.get() - print("\n\n\nVisits async response: \n", visits_response) - events_response = events_response_request.get() - print("\n\n\nEvent async response: \n", events_response.products) - except ApiException as e: - print("Exception when calling Async example: %s\n" % e, file=sys.stderr) - return 1 - # Check that old events are still match expected format try: search_events_response_old = api.search_events(1, start=start, end=end, reverse=True) if len(search_events_response_old.events) == 0: print("FingerprintApi.search_events: is empty for old events\n", file=sys.stderr) return 1 - old_event_identification_data = search_events_response_old.events[0].products.identification.data - visitor_id_old = old_event_identification_data.visitor_id - request_id_old = old_event_identification_data.request_id + old_event = search_events_response_old.events[0] + event_id_old = old_event.event_id - if request_id_old == request_id: + if event_id_old == event_id: print("Old events are identical to new\n", file=sys.stderr) return 1 - api.get_visits(visitor_id_old, limit=2) - api.get_event(request_id_old) + api.get_event(event_id_old) print("\n\n\nOld events are good\n") except ApiException as e: print("Exception when trying to read old data: %s\n" % e, file=sys.stderr) diff --git a/sealed_results_example.py b/sealed_results_example.py index e7f4b487..39bb627e 100644 --- a/sealed_results_example.py +++ b/sealed_results_example.py @@ -12,7 +12,7 @@ try: event_response = unseal_event_response(sealed_result, [DecryptionKey(key, DecryptionAlgorithm['Aes256Gcm'])]) - print("\n\n\nEvent response: \n", event_response.products) + print("\n\n\nEvent response: \n", event_response) except Exception as e: print("Exception when calling unsealing events response: %s\n" % e) exit(1) diff --git a/setup.cfg b/setup.cfg index 89225d2a..11433ee8 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,2 +1,2 @@ -[metadata] -version = 8.11.0 +[flake8] +max-line-length=99 diff --git a/setup.py b/setup.py index 4e29371d..b11b5629 100644 --- a/setup.py +++ b/setup.py @@ -1,14 +1,17 @@ # coding: utf-8 """ - Fingerprint Server API + Server API - 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 + Fingerprint Server API allows you to get, search, and update 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. - OpenAPI spec version: 3 + The version of the OpenAPI document: 4 Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" + Generated by OpenAPI Generator (https://openapi-generator.tech) + + Do not edit the class manually. +""" # noqa: E501 + import pathlib import re @@ -16,22 +19,22 @@ from setuptools import setup, find_packages # noqa: H301 NAME = "fingerprint-server-sdk" +VERSION = "8.11.0" +PYTHON_REQUIRES = ">= 3.9" # To install the library, run the following # # python setup.py install # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools - REQUIRES = [ - "certifi>=2023.7.22", - "python-dateutil>=2.5.3", - "urllib3>=1.23", + "urllib3 >= 2.1.0, < 3.0.0", + "python-dateutil >= 2.8.2", + "pydantic >= 2", + "typing-extensions >= 4.7.1", "cryptography", - "typing_extensions>=4.5" ] - here = pathlib.Path(__file__).parent.resolve() long_description = (here / 'README.md').read_text(encoding='utf-8') long_description = re.sub("]*>\n", '', long_description.replace("\n", "").replace("\n", "")) @@ -39,23 +42,24 @@ setup( name=NAME, - description="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. ", + version=VERSION, + description="Fingerprint (https://fingerprint.com) is a device intelligence platform offering industry-leading accuracy. 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.", long_description=long_description, long_description_content_type='text/markdown', license="MIT", license_files=["LICENSE"], - author="Fingerprint", + author="Fingerprint Support", author_email="support@fingerprint.com", project_urls={ "Changelog": "https://github.com/fingerprintjs/python-sdk/blob/main/CHANGELOG.md", "Code": "https://github.com/fingerprintjs/python-sdk", "Issue Tracker": "https://github.com/fingerprintjs/python-sdk/issues", }, - keywords=["Swagger", "Fingerprint Server API", "browser", "detection", "fingerprint", "identification", + keywords=["Fingerprint Server API", "browser", "detection", "fingerprint", "identification", "fingerprinting", "browser-fingerprinting", "browser-fingerprint", "fraud-detection", "fraud", "audio-fingerprinting", "fingerprintjs", "fingerprintjs-pro", "visitor-identifier"], install_requires=REQUIRES, - packages=find_packages(), + packages=find_packages(exclude=["test"]), include_package_data=True, classifiers=[ 'Development Status :: 5 - Production/Stable', @@ -70,4 +74,5 @@ 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Security', ], -) + package_data={"fingerprint_server_sdk": ["py.typed"]}, +) \ No newline at end of file diff --git a/sync.sh b/sync.sh index f2ef8ba4..32ce5705 100755 --- a/sync.sh +++ b/sync.sh @@ -2,60 +2,42 @@ set -euo pipefail defaultBaseUrl="https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi" -schemaUrl="${1:-$defaultBaseUrl/schemas/fingerprint-server-api-compact.yaml}" +schemaUrl="${1:-$defaultBaseUrl/schemas/fingerprint-server-api-v4.yaml}" examplesBaseUrl="${2:-$defaultBaseUrl/examples}" mkdir -p ./res curl -fSL --retry 3 -o ./res/fingerprint-server-api.yaml "$schemaUrl" -examplesList=( - 'get_visits_200_limit_1.json' - 'get_visits_200_limit_500.json' - 'get_visits_403_error.json' - 'get_visits_429_too_many_requests_error.json' - 'webhook.json' - 'get_event_200.json' - 'get_event_200_all_errors.json' - 'get_event_200_extra_fields.json' - 'get_event_403_error.json' - 'get_event_404_error.json' - 'get_event_200_botd_failed_error.json' - 'get_event_200_botd_too_many_requests_error.json' - 'get_event_200_identification_failed_error.json' - 'get_event_200_identification_too_many_requests_error.json' - 'update_event_400_error.json' - 'update_event_403_error.json' - 'update_event_404_error.json' - 'update_event_409_error.json' -) - -sharedExamplesList=( - '400_error_empty_visitor_id.json' - '400_error_incorrect_visitor_id.json' - '403_error_feature_not_enabled.json' - '403_error_token_not_found.json' - '403_error_token_required.json' - '403_error_wrong_region.json' - '404_error_visitor_not_found.json' - '429_error_too_many_requests.json' +examples=( + 'events/search/get_event_search_200.json' + 'events/get_event_200.json' + 'events/get_event_ruleset_200.json' + 'events/update_event_multiple_fields_request.json' + 'events/update_event_one_field_request.json' + 'errors/400_event_id_invalid.json' + 'errors/400_request_body_invalid.json' + 'errors/400_visitor_id_required.json' + 'errors/400_visitor_id_invalid.json' + 'errors/403_feature_not_enabled.json' + 'errors/403_secret_api_key_required.json' + 'errors/404_event_not_found.json' + 'errors/404_visitor_not_found.json' + 'errors/409_state_not_ready.json' + 'errors/429_too_many_requests.json' ) baseDestination="./test/mocks" mkdir -p "$baseDestination" -download_example() { - local subpath="$1" - shift - local examples=("$@") - - for example in "${examples[@]}"; do - echo "Downloading $example" - curl -fSL --retry 3 -o "$baseDestination/$example" "$examplesBaseUrl/$subpath$example" - done -} +for example in "${examples[@]}"; do + destinationPath="$baseDestination/$example" + destinationDir="$(dirname "$destinationPath")" + mkdir -p "$destinationDir" -download_example "" "${examplesList[@]}" -download_example "shared/" "${sharedExamplesList[@]}" + exampleUrl="$examplesBaseUrl/$example" + echo "Downloading $exampleUrl to $destinationPath" + curl -fSL --retry 3 -o "$destinationPath" "$exampleUrl" +done ./generate.sh diff --git a/template/DecryptionKey.md b/template/DecryptionKey.md new file mode 100644 index 00000000..7a109ebc --- /dev/null +++ b/template/DecryptionKey.md @@ -0,0 +1,12 @@ +# DecryptionKey + +## Properties + +| Name | Type | Description | Notes | +|---------------|-------------------------|-----------------------------------------------------------------------------------|-------| +| **Key** | **bytes** | Key generated in dashboard that will be used to decrypt sealed result | | +| **Algorithm** | **DecryptionAlgorithm** | Algorithm to use for decryption. Currently only "aes-256-gcm" value is supported. | | + + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) + diff --git a/template/README.mustache b/template/README.mustache index 5b411f6d..d733e767 100644 --- a/template/README.mustache +++ b/template/README.mustache @@ -8,11 +8,11 @@

- PyPI - coverage - CI badge - CI badge - CI badge + PyPI + coverage + CI badge + CI badge + CI badge Discord server

@@ -23,13 +23,14 @@ The Fingerprint Server Python SDK is an easy way to interact with the Fingerprint [Server API](https://dev.fingerprint.com/reference/pro-server-api) from your Python application. You can retrieve visitor history or individual identification events. -This Python package is automatically generated by the [Swagger Codegen](https://github.com/swagger-api/swagger-codegen) project: +This Python package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: - API version: {{appVersion}} - Package version: {{packageVersion}} {{^hideGenerationTimestamp}} - Build date: {{generatedDate}} {{/hideGenerationTimestamp}} +- Generator version: {{generatorVersion}} - Build package: {{generatorClass}} {{#infoUrl}} For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) @@ -39,7 +40,7 @@ For more information, please visit [{{{infoUrl}}}]({{{infoUrl}}}) The following Python versions are supported: -- Python >= 3.9 +- Python {{{generatorLanguageVersion}}} ## Installation & Usage ### pip install @@ -47,7 +48,7 @@ The following Python versions are supported: You can install the package directly from the Github ```sh -pip install git+https://github.com/{{{gitUserId}}}/{{{gitRepoId}}}.git +pip install git+https://{{gitHost}}/{{{gitUserId}}}/{{{gitRepoId}}}.git ``` Or from the PyPI @@ -79,256 +80,13 @@ import {{{packageName}}} Please follow the [installation procedure](#installation--usage) and then run the following: -```python -import {{packageName}} - -# Configure API key authorization and region -configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY") -# configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY", region="eu") - -# create an instance of the API class -api_instance = {{packageName}}.FingerprintApi(configuration) -``` - -## Examples - -Fetching visits using visitorId: -```python -import {{packageName}} -from {{packageName}}.rest import ApiException, KnownApiException - -configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY") -api_instance = {{packageName}}.FingerprintApi(configuration) - -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 = api_instance.get_visits(visitor_id, limit=2) - print(api_response) -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->visitors_visitor_id_get: %s\n" % e) -``` - -Delete visits using visitorId: -```python -import {{packageName}} -from {{packageName}}.rest import ApiException, KnownApiException - -configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY") -api_instance = {{packageName}}.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: -```python -import {{packageName}} -from {{packageName}}.rest import ApiException, KnownApiException - -configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY") -api_instance = {{packageName}}.FingerprintApi(configuration) - -request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). - -try: - events_response = api_instance.get_event(request_id) - -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->get_event: %s\n" % e) -``` - -Search events with custom filters: -```python -import fingerprint_server_sdk -from fingerprint_server_sdk.rest import ApiException, KnownApiException - -configuration = fingerprint_server_sdk.Configuration(api_key="SECRET_API_KEY") -api_instance = fingerprint_server_sdk.FingerprintApi(configuration) - -limit = 20 # int | Limit the number of events returned. -pagination_key = 'key_example' # str | 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` (optional) -visitor_id = '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) -bot = 'good' # str | Filter events by the bot detection result, specifically: events where <'any'|'good'|'bad'|'none'> kind of bot was detected. (optional) -ip_address = '192.168.0.1/32' # 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) -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) -start = 1738687200000 # int | Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) -end = 1738773600000 # int | Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) -reverse = True # bool | Sort events in reverse timestamp order. (optional) -suspect = False # bool | Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). (optional) - -try: - # Get events via search - api_response = api_instance.search_events(limit, pagination_key=pagination_key, visitor_id=visitor_id, bot=bot, ip_address=ip_address, linked_id=linked_id, start=start, end=end, reverse=reverse, suspect=suspect) - print(api_response) - -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->get_event: %s\n" % e) -``` - -Update event for requestId: -```python -import {{packageName}} -from {{packageName}} import EventsUpdateRequest -from {{packageName}}.rest import ApiException, KnownApiException - -configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY") -api_instance = {{packageName}}.FingerprintApi(configuration) - -request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). -body = EventsUpdateRequest(linked_id='foo') # EventsUpdateRequest | -# body = EventsUpdateRequest(tag={'bar': 123}) -# body = EventsUpdateRequest(suspect=True) -# body = EventsUpdateRequest(linked_id='foo', tag={'bar': 123}, suspect=False) - -try: - api_instance.update_event(body, request_id) -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 - -This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results). -```python -import base64 -import os - -from dotenv import load_dotenv - -from fingerprint_server_sdk import unseal_event_response, DecryptionKey, DecryptionAlgorithm - -load_dotenv() - -sealed_result = base64.b64decode(os.environ["BASE64_SEALED_RESULT"]) -key = base64.b64decode(os.environ["BASE64_KEY"]) - -try: - event_response = unseal_event_response(sealed_result, [DecryptionKey(key, DecryptionAlgorithm['Aes256Gcm'])]) - print("\n\n\nEvent response: \n", event_response.products) -except Exception as e: - print("Exception when calling unsealing events response: %s\n" % e) - exit(1) - -print("Unseal successful!") - -exit(0) -``` -To learn more, refer to example located in [sealed_results_example.py](sealed_results_example.py). - -## Webhook signature validation - -This SDK provides utility method for verifying the HMAC signature of the incoming webhook request. -```python -import os -from flask import Flask, request, jsonify -from fingerprint_server_sdk import WebhookValidation - -app = Flask(__name__) - -@app.route('/api/webhook', methods=['POST']) -def webhook_handler(): - try: - # Retrieve the secret key from environment variables - secret = os.getenv("WEBHOOK_SIGNATURE_SECRET") - if not secret: - return jsonify({"message": "Secret key is not configured."}), 400 - - # Get the "fpjs-event-signature" header from the incoming request - header = request.headers.get('fpjs-event-signature') - if not header: - return jsonify({"message": "Missing fpjs-event-signature header."}), 400 - - # Read the raw body of the incoming request - data = request.get_data() - - # Validate the webhook signature - is_valid = WebhookValidation.is_valid_webhook_signature(header, data, secret) - if not is_valid: - return jsonify({"message": "Webhook signature is invalid."}), 403 - - # Process the webhook data here - return jsonify({"message": "Webhook received."}), 200 - - except Exception as e: - # Handle any unexpected errors - return jsonify({"error": str(e)}), 500 - -if __name__ == '__main__': - # Start the Flask application on the specified host and port - app.run(host='0.0.0.0', port=5000) -``` -To learn more, refer to example located in [webhook_signature_example.py](webhook_signature_example.py). - -## Documentation for API Endpoints - -All URIs are relative to *{{basePath}}* - -Class | Method | HTTP request | Description ------------- | ------------- | ------------- | ------------- -{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} -{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} - -## Documentation For Models - -{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) -{{/model}}{{/models}} - -## Documentation For Authorization - -{{^authMethods}} All endpoints do not require authorization. -{{/authMethods}}{{#authMethods}}{{#last}} Authentication schemes defined for the API:{{/last}}{{/authMethods}} -{{#authMethods}}## {{{name}}} - -{{#isApiKey}}- **Type**: API key -- **API key parameter name**: {{{keyParamName}}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasic}}- **Type**: HTTP basic authentication -{{/isBasic}} -{{#isOAuth}}- **Type**: OAuth -- **Flow**: {{{flow}}} -- **Authorization URL**: {{{authorizationUrl}}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - **{{{scope}}}**: {{{description}}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} - -## Documentation for sealed results - -- [SealedResults](docs/SealedResults.md) -- [DecryptionKey](docs/DecryptionKey.md) +{{> common_README }} ## Support -To report problems, ask questions or provide feedback, please use [Issues](https://github.com/fingerprintjs/python-sdk/issues). +To report problems, ask questions or provide feedback, please use [Issues](https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}/issues). If you need private support, you can email us at [oss-support@fingerprint.com](mailto:oss-support@fingerprint.com). ## License -This project is licensed under the [MIT License](https://github.com/fingerprintjs/python-sdk/blob/main/LICENSE). +This project is licensed under the [MIT License](https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}/blob/main/LICENSE). diff --git a/template/SealedResults.md b/template/SealedResults.md new file mode 100644 index 00000000..132de92a --- /dev/null +++ b/template/SealedResults.md @@ -0,0 +1,14 @@ +# Sealed results + +## **UnsealEventResponse** +> unseal_event_response(sealed: bytes, keys: DecryptionKey[]) -> Event + +Decrypts the sealed response with provided keys. +### Required Parameters + +| Name | Type | Description | Notes | +|------------|---------------------|------------------------------------------------------------------------------------------|-------| +| **sealed** | **bytes** | Base64 encoded sealed data | | +| **keys** | **DecryptionKey[]** | Decryption keys. The SDK will try to decrypt the result with each key until it succeeds. | | + +[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/template/__init__api.mustache b/template/__init__api.mustache index d8e6042c..f3863e94 100644 --- a/template/__init__api.mustache +++ b/template/__init__api.mustache @@ -1,5 +1,19 @@ # flake8: noqa -# import apis into api package -{{#apiInfo}}{{#apis}}from {{packageName}}.{{apiPackage}}.{{classVarName}} import {{classname}} -{{/apis}}{{/apiInfo}} +{{^lazyImports}} +{{>exports_api}} +{{/lazyImports}} +{{#lazyImports}}if __import__("typing").TYPE_CHECKING: + {{>exports_api}} +else: + from lazy_imports import LazyModule, as_package, load + + load( + LazyModule( + *as_package(__file__), + """{{>exports_api}}""", + name=__name__, + doc=__doc__, + ) + ) +{{/lazyImports}} \ No newline at end of file diff --git a/template/__init__model.mustache b/template/__init__model.mustache deleted file mode 100644 index 8984a548..00000000 --- a/template/__init__model.mustache +++ /dev/null @@ -1,8 +0,0 @@ -# coding: utf-8 - -# flake8: noqa -{{>partial_header}} - -# import models into model package -{{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}}{{/model}} -{{/models}} diff --git a/template/__init__package.mustache b/template/__init__package.mustache index 4c318079..afd24e00 100644 --- a/template/__init__package.mustache +++ b/template/__init__package.mustache @@ -4,18 +4,65 @@ {{>partial_header}} -# import apis into sdk package -{{#apiInfo}}{{#apis}}from {{packageName}}.{{apiPackage}}.{{classVarName}} import {{classname}} -{{/apis}}{{/apiInfo}} -# import ApiClient -from {{packageName}}.api_client import ApiClient -from {{packageName}}.configuration import Configuration -# import BaseModel -from {{packageName}}.base_model import BaseModel -# import models into sdk package -{{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}} -{{/model}}{{/models}} + +__version__ = "{{packageVersion}}" + +# Define package exports +__all__ = [ + "__version__", + {{#apiInfo}}{{#apis}}"{{classname}}", + {{/apis}}{{/apiInfo}}"ApiResponse", + "ApiClient", + "Configuration", + "OpenApiException", + "ApiTypeError", + "ApiValueError", + "ApiKeyError", + "ApiAttributeError", + "ApiException", + "BadRequestException", + "UnauthorizedException", + "ForbiddenException", + "NotFoundException", + "ConflictException", + "UnprocessableEntityException", + "TooManyRequestsException", + "ServiceException", + "WebhookValidation", + "DecryptionKey", + "DecryptionAlgorithm", + "UnsealError", + "UnsealAggregateError", + "unseal_event_response", + {{#hasHttpSignatureMethods}}"HttpSigningConfiguration", + {{/hasHttpSignatureMethods}}{{#models}}{{#model}}"{{classname}}"{{^-last}}, + {{/-last}}{{#-last}},{{/-last}}{{/model}}{{/models}} +] + +{{^lazyImports}} +{{>exports_package}} +{{/lazyImports}} +{{#lazyImports}}if __import__("typing").TYPE_CHECKING: + {{>exports_package}} +else: + from lazy_imports import LazyModule, as_package, load + + load( + LazyModule( + *as_package(__file__), + ("__version__", __version__), + ("__all__", __all__), + """{{>exports_package}}""", + name=__name__, + doc=__doc__, + ) + ) +{{/lazyImports}} +{{#recursionLimit}} + +__import__('sys').setrecursionlimit({{{.}}}) +{{/recursionLimit}} # import custom methods into sdk package from {{packageName}}.webhook_validation import WebhookValidation -from {{packageName}}.sealed import ApiClientDeserializer, DecryptionAlgorithm, DecryptionKey, \ +from {{packageName}}.sealed import DecryptionAlgorithm, DecryptionKey, \ UnsealError, UnsealAggregateError, unseal_event_response diff --git a/template/api.mustache b/template/api.mustache index 2ccd65ca..671c8b3e 100644 --- a/template/api.mustache +++ b/template/api.mustache @@ -2,222 +2,247 @@ {{>partial_header}} -import re # noqa: F401 -from multiprocessing import Pool -from multiprocessing.pool import ApplyResult as AsyncResult -from typing import Optional, Union +import warnings +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated -from {{packageName}}.configuration import Configuration -from {{packageName}}.api_client import ApiClient -from {{packageName}}.extend_exception import extend_exception -from {{packageName}}.rest import ApiException {{#imports}} -{{import}} # noqa: F401 +{{import}} {{/imports}} +from {{packageName}}.configuration import Configuration +from {{packageName}}.api_client import ApiClient, RequestSerialized +from {{packageName}}.api_response import ApiResponse +from {{packageName}}.rest import RESTResponseType + {{#operations}} class {{classname}}: - """NOTE: This class is auto generated by the swagger code generator program. + """Fingerprint Python Server SDK - Do not edit the class manually. - Ref: https://github.com/swagger-api/swagger-codegen + {{{packageDescription}}} + + :param configuration: API client configuration. """ - def __init__(self, configuration: Optional[Configuration] = None, pool: Optional[Pool] = None): - if configuration is None: - raise ValueError("Missing the required parameter `configuration` when calling `{{classname}}`") # noqa: E501 - self.api_client = ApiClient(configuration, pool=pool) + def __init__(self, configuration: Configuration) -> None: + self.api_client = ApiClient(configuration) {{#operation}} - def {{operationId}}(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}: {{dataType}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) -> Union[{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}}, AsyncResult[{{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}}]]: # noqa: E501 - """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 - -{{#notes}} - {{{notes}}} # noqa: E501 -{{/notes}} - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True -{{#sortParamsByRequiredFlag}} - >>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}async_req=True) -{{/sortParamsByRequiredFlag}} -{{^sortParamsByRequiredFlag}} - >>> thread = api.{{operationId}}({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}async_req=True) -{{/sortParamsByRequiredFlag}} - >>> result = thread.get() - - :param async_req bool -{{#allParams}} - :param {{paramName}}:{{#description}} {{{description}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional){{/optional}} -{{/allParams}} - :return: {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}} - If the method is called asynchronously, - returns the request thread. - """ - kwargs['_return_http_data_only'] = True - if kwargs.get('async_req'): - return self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) # noqa: E501 - else: - (data) = self.{{operationId}}_with_http_info({{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs) # noqa: E501 - return data - - def {{operationId}}_with_http_info(self, {{#sortParamsByRequiredFlag}}{{#allParams}}{{#required}}{{paramName}}: {{dataType}}, {{/required}}{{/allParams}}{{/sortParamsByRequiredFlag}}**kwargs): # noqa: E501 - """{{#summary}}{{{.}}}{{/summary}}{{^summary}}{{operationId}}{{/summary}} # noqa: E501 - -{{#notes}} - {{{notes}}} # noqa: E501 -{{/notes}} - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True -{{#sortParamsByRequiredFlag}} - >>> thread = api.{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}, {{/required}}{{/allParams}}async_req=True) -{{/sortParamsByRequiredFlag}} -{{^sortParamsByRequiredFlag}} - >>> thread = api.{{operationId}}_with_http_info({{#allParams}}{{#required}}{{paramName}}={{paramName}}_value, {{/required}}{{/allParams}}async_req=True) -{{/sortParamsByRequiredFlag}} - >>> result = thread.get() - - :param async_req bool -{{#allParams}} - :param {{dataType}} {{paramName}}:{{#description}} {{{description}}}{{/description}}{{#required}} (required){{/required}}{{#optional}}(optional{{#defaultValue}}, default to {{{.}}}{{/defaultValue}}){{/optional}} -{{/allParams}} - :return: {{#returnType}}{{returnType}}{{/returnType}}{{^returnType}}None{{/returnType}} - If the method is called asynchronously, - returns the request thread. - """ - - all_params = [ - {{#allParams}}'{{paramName}}'{{#hasMore}}, - {{/hasMore}}{{/allParams}}, - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout'] - - params = locals() - for key, val in params['kwargs'].items(): - if key not in all_params: - raise TypeError( - "Got an unexpected keyword argument '%s'" - " to method {{operationId}}" % key - ) - params[key] = val - del params['kwargs'] -{{#allParams}} -{{#required}} - # verify the required parameter '{{paramName}}' is set - if '{{paramName}}' not in params or params['{{paramName}}'] is None: - raise ValueError("Missing the required parameter `{{paramName}}` when calling `{{operationId}}`") # noqa: E501 -{{/required}} -{{/allParams}} - -{{#allParams}} -{{#hasValidation}} - {{#maxLength}} - if self.api_client.client_side_validation and ('{{paramName}}' in params and - len(params['{{paramName}}']) > {{maxLength}}): - raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501 - {{/maxLength}} - {{#minLength}} - if self.api_client.client_side_validation and ('{{paramName}}' in params and - len(params['{{paramName}}']) < {{minLength}}): - raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501 - {{/minLength}} - {{#maximum}} - if self.api_client.client_side_validation and ('{{paramName}}' in params and params['{{paramName}}'] >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}): # noqa: E501 - raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501 - {{/maximum}} - {{#minimum}} - if self.api_client.client_side_validation and ('{{paramName}}' in params and params['{{paramName}}'] <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}): # noqa: E501 - raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 - {{/minimum}} - {{#maxItems}} - if self.api_client.client_side_validation and ('{{paramName}}' in params and - len(params['{{paramName}}']) > {{maxItems}}): - raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501 - {{/maxItems}} - {{#minItems}} - if self.api_client.client_side_validation and ('{{paramName}}' in params and - len(params['{{paramName}}']) < {{minItems}}): - raise ValueError("Invalid value for parameter `{{paramName}}` when calling `{{operationId}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501 - {{/minItems}} -{{/hasValidation}} -{{/allParams}} - collection_formats = {} - - path_params = {} + + @validate_call + {{#async}}async {{/async}}def {{operationId}}{{>partial_api_args}} -> {{{returnType}}}{{^returnType}}None{{/returnType}}: +{{>partial_api}} + + response_data = {{#async}}await {{/async}}self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + {{#async}}await {{/async}}response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + {{#async}}async {{/async}}def {{operationId}}_with_http_info{{>partial_api_args}} -> ApiResponse[{{{returnType}}}{{^returnType}}None{{/returnType}}]: +{{>partial_api}} + + response_data = {{#async}}await {{/async}}self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + {{#async}}await {{/async}}response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + {{#async}}async {{/async}}def {{operationId}}_without_preload_content{{>partial_api_args}} -> RESTResponseType: +{{>partial_api}} + + response_data = {{#async}}await {{/async}}self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _{{operationId}}_serialize( + self, + {{#allParams}} + {{paramName}}, + {{/allParams}} + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + {{#servers.0}} + _hosts = [{{#servers}} + '{{{url}}}'{{^-last}},{{/-last}}{{/servers}} + ] + _host = _hosts[_host_index] + {{/servers.0}} + {{^servers.0}} + _host = None + {{/servers.0}} + + _collection_formats: Dict[str, str] = { + {{#allParams}} + {{#isArray}} + '{{baseName}}': '{{collectionFormat}}', + {{/isArray}} + {{/allParams}} + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + {{#pathParams}} - if '{{paramName}}' in params: - path_params['{{baseName}}'] = params['{{paramName}}']{{#isListContainer}} # noqa: E501 - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 + # process the path parameters + if {{paramName}} is not None: + _path_params['{{baseName}}'] = {{paramName}}{{#isEnumRef}}.value{{/isEnumRef}} {{/pathParams}} - query_params = [('ii', 'fingerprint-pro-server-python-sdk/{{packageVersion}}')] {{#queryParams}} - if '{{paramName}}' in params: - query_params.append(('{{baseName}}', params['{{paramName}}'])){{#isListContainer}} # noqa: E501 - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 + # process the query parameters + if {{paramName}} is not None: + {{#isDateTime}} + if isinstance({{paramName}}, datetime): + _query_params.append( + ( + '{{baseName}}', + {{paramName}}.strftime( + self.api_client.configuration.datetime_format + ) + ) + ) + else: + _query_params.append(('{{baseName}}', {{paramName}})) + {{/isDateTime}} + {{#isDate}} + if isinstance({{paramName}}, date): + _query_params.append( + ( + '{{baseName}}', + {{paramName}}.strftime( + self.api_client.configuration.date_format + ) + ) + ) + else: + _query_params.append(('{{baseName}}', {{paramName}})) + {{/isDate}} + {{^isDateTime}}{{^isDate}} + _query_params.append(('{{baseName}}', {{paramName}}{{#isEnumRef}}.value{{/isEnumRef}})) + {{/isDate}}{{/isDateTime}} {{/queryParams}} - header_params = {} {{#headerParams}} - if '{{paramName}}' in params: - header_params['{{baseName}}'] = params['{{paramName}}']{{#isListContainer}} # noqa: E501 - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 + # process the header parameters + if {{paramName}} is not None: + _header_params['{{baseName}}'] = {{paramName}} {{/headerParams}} - form_params = [] - local_var_files = {} {{#formParams}} - if '{{paramName}}' in params: - {{#notFile}}form_params.append(('{{baseName}}', params['{{paramName}}'])){{/notFile}}{{#isFile}}local_var_files['{{baseName}}'] = params['{{paramName}}']{{/isFile}}{{#isListContainer}} # noqa: E501 - collection_formats['{{baseName}}'] = '{{collectionFormat}}'{{/isListContainer}} # noqa: E501 + # process the form parameters + if {{paramName}} is not None: + {{#isFile}} + _files['{{{baseName}}}'] = {{paramName}} + {{/isFile}} + {{^isFile}} + _form_params.append(('{{{baseName}}}', {{paramName}})) + {{/isFile}} {{/formParams}} - body_params = None {{#bodyParam}} - if '{{paramName}}' in params: - body_params = params['{{paramName}}'] + # process the body parameter + if {{paramName}} is not None: + {{#isBinary}} + # convert to byte array if the input is a file name (str) + if isinstance({{paramName}}, str): + with open({{paramName}}, "rb") as _fp: + _body_params = _fp.read() + elif isinstance({{paramName}}, tuple): + # drop the filename from the tuple + _body_params = {{paramName}}[1] + else: + _body_params = {{paramName}} + {{/isBinary}} + {{^isBinary}} + _body_params = {{paramName}} + {{/isBinary}} {{/bodyParam}} - {{#hasProduces}} - # HTTP header `Accept` - header_params['Accept'] = self.api_client.select_header_accept( - [{{#produces}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/produces}}]) # noqa: E501 + {{#constantParams}} + {{#isQueryParam}} + # Set client side default value of Query Param "{{baseName}}". + _query_params.append(('{{baseName}}', {{#_enum}}'{{{.}}}'{{/_enum}})) + {{/isQueryParam}} + {{#isHeaderParam}} + # Set client side default value of Header Param "{{baseName}}". + _header_params['{{baseName}}'] = {{#_enum}}'{{{.}}}'{{/_enum}} + {{/isHeaderParam}} + {{/constantParams}} + + {{#hasProduces}} + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [{{#produces}} + '{{{mediaType}}}'{{^-last}}, {{/-last}}{{/produces}} + ] + ) {{/hasProduces}} - {{#hasConsumes}} - # HTTP header `Content-Type` - header_params['Content-Type'] = self.api_client.select_header_content_type( # noqa: E501 - [{{#consumes}}'{{{mediaType}}}'{{#hasMore}}, {{/hasMore}}{{/consumes}}]) # noqa: E501 + {{#hasConsumes}} + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [{{#consumes}} + '{{{mediaType}}}'{{^-last}}, {{/-last}}{{/consumes}} + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type {{/hasConsumes}} - # Authentication setting - auth_settings = [{{#authMethods}}'{{name}}'{{#hasMore}}, {{/hasMore}}{{/authMethods}}] # noqa: E501 - - try: - return self.api_client.call_api( - '{{{path}}}', '{{httpMethod}}', - path_params, - query_params, - header_params, - body=body_params, - post_params=form_params, - files=local_var_files, - response_type={{#returnType}}'{{returnType}}'{{/returnType}}{{^returnType}}None{{/returnType}}, # noqa: E501 - auth_settings=auth_settings, - async_req=params.get('async_req'), - _return_http_data_only=params.get('_return_http_data_only'), - _preload_content=params.get('_preload_content', True), - _request_timeout=params.get('_request_timeout'), - collection_formats=collection_formats) - except ApiException as e: - {{#responses}} - {{^isDefault}} - if e.status == {{code}}: - error = self.api_client.deserialize(e, '{{dataType}}', True) - raise extend_exception(e, error) - {{/isDefault}} - {{/responses}} - raise e + + # authentication setting + _auth_settings: List[str] = [{{#authMethods}} + '{{name}}'{{^-last}}, {{/-last}}{{/authMethods}} + ] + + return self.api_client.param_serialize( + method='{{httpMethod}}', + resource_path='{{{path}}}', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + {{/operation}} -{{/operations}} +{{/operations}} \ No newline at end of file diff --git a/template/api_client.mustache b/template/api_client.mustache index 54f3abbe..faa1a805 100644 --- a/template/api_client.mustache +++ b/template/api_client.mustache @@ -1,47 +1,50 @@ # coding: utf-8 + {{>partial_header}} + + +import datetime +from dateutil.parser import parse +from enum import Enum +import decimal import json import mimetypes import os import re import tempfile +import uuid from urllib.parse import quote -from multiprocessing import Pool -from typing import Optional, Any, Union, Dict, List, Tuple -from datetime import date, datetime +from typing import Tuple, Optional, List, Dict, Union, Any +from pydantic import SecretStr +{{#tornado}} +import tornado.gen +{{/tornado}} from {{packageName}}.configuration import Configuration +from {{packageName}}.api_response import ApiResponse, T as ApiResponseT import {{modelPackage}} -from {{packageName}} import rest -from {{packageName}}.rest import ApiException, RESTResponse -from {{packageName}}.base_model import BaseModel - -PRIMITIVE_TYPES = (float, bool, bytes, str, int) -NATIVE_TYPES_MAPPING = { - 'int': int, - 'long': int, - 'float': float, - 'str': str, - 'bool': bool, - 'date': date, - 'datetime': datetime, - 'object': object, -} - +from {{packageName}} import rest, __version__ +from {{packageName}}.exceptions import ( + ApiValueError, + ApiException, + BadRequestException, + UnauthorizedException, + ForbiddenException, + NotFoundException, + ServiceException +) + +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] class ApiClient: - """Generic API client for Swagger client library builds. + """Generic API client for OpenAPI client library builds. - Swagger generic API client. This client handles the client- + OpenAPI generic API client. This client handles the client- server communication, and is invariant across implementations. Specifics of - the methods and models for each application are generated from the Swagger + the methods and models for each application are generated from the OpenAPI templates. - NOTE: This class is auto generated by the swagger code generator program. - Ref: https://github.com/swagger-api/swagger-codegen - Do not edit the class manually. - :param configuration: .Configuration object for this client :param header_name: a header to pass when making calls to the API. :param header_value: a header value to pass when making calls to @@ -50,32 +53,54 @@ class ApiClient: to the API """ - def __init__(self, configuration: Optional[Configuration] = None, header_name: Optional[str] = None, - header_value: Optional[str] = None, cookie: Optional[str] = None, pool: Optional[Pool] = None): - if configuration is None: - configuration = Configuration() + PRIMITIVE_TYPES = (float, bool, bytes, str, int) + NATIVE_TYPES_MAPPING = { + 'int': int, + 'long': int, # TODO remove as only py3 is supported? + 'float': float, + 'str': str, + 'bool': bool, + 'date': datetime.date, + 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, + 'object': object, + } + + def __init__( + self, + configuration, + header_name=None, + header_value=None, + cookie=None + ) -> None: self.configuration = configuration - if pool is None: - try: - from multiprocessing.pool import ThreadPool - self.pool = ThreadPool() - except (ImportError, OSError): - from {{packageName}}.dummy_pool import DummyPool - self.pool = DummyPool() - else: - self.pool = pool self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} if header_name is not None: self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = '{{#httpUserAgent}}{{{.}}}{{/httpUserAgent}}{{^httpUserAgent}}Swagger-Codegen/{{{packageVersion}}}/python{{/httpUserAgent}}' + self.user_agent = '{{{httpUserAgent}}}{{^httpUserAgent}}fingerprint-server-python-sdk/{__version__}{{/httpUserAgent}}' + self.client_side_validation = configuration.client_side_validation + +{{#async}} + async def __aenter__(self): + return self + + async def __aexit__(self, exc_type, exc_value, traceback): + await self.close() - def __del__(self): - self.pool.close() - self.pool.join() + async def close(self): + await self.rest_client.close() +{{/async}} +{{^async}} + def __enter__(self): + return self + + def __exit__(self, exc_type, exc_value, traceback): + pass +{{/async}} @property def user_agent(self) -> Optional[str]: @@ -89,14 +114,44 @@ class ApiClient: def set_default_header(self, header_name: str, header_value: str): self.default_headers[header_name] = header_value - def __call_api( - self, resource_path: str, method: str, path_params: Optional[Dict[str, Any]] = None, - query_params: Optional[List[Tuple[str, Any]]] = None, header_params: Optional[Dict[str, Any]] = None, - body: Any = None, post_params: Optional[List[Tuple[str, Any]]] = None, - files: Optional[Dict[str, Any]] = None, response_type: Optional[str] = None, - auth_settings: Optional[List[str]] = None, _return_http_data_only: Optional[bool] = None, - collection_formats: Optional[Dict[str, Any]] = None, _preload_content: bool = True, - _request_timeout: Optional[int] = None): + + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, + auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ config = self.configuration @@ -107,14 +162,17 @@ class ApiClient: header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = dict( + self.parameters_to_tuples(header_params, collection_formats) + ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( @@ -122,207 +180,292 @@ class ApiClient: quote(str(v), safe=config.safe_chars_for_path_param) ) - # query parameters - if query_params: - query_params = self.sanitize_for_serialization(query_params) - query_params = self.parameters_to_tuples(query_params, - collection_formats) - # post parameters if post_params or files: - post_params = self.prepare_post_parameters(post_params, files) + post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) # auth setting - self.update_params_for_auth(header_params, query_params, auth_settings) + self.update_params_for_auth( + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) # body if body: body = self.sanitize_for_serialization(body) # request url - url = self.configuration.host + resource_path + if _host is None: + url = self.configuration.host + resource_path + else: + # use server/host defined in path or operation instead + url = _host + resource_path - # perform request and return response - response_data = self.request( - method, url, query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + query_params = list(query_params or []) + if getattr(self.configuration, "default_query_params", None): + existing_keys = {k for k, _ in query_params} + for k, v in self.configuration.default_query_params: + if k not in existing_keys: + query_params.append((k, v)) - self.last_response = response_data + # query parameters + if query_params: + query_params = self.sanitize_for_serialization(query_params) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) + url += "?" + url_query + + return method, url, header_params, body, post_params + + + {{#tornado}} + @tornado.gen.coroutine + {{/tornado}} + {{#async}}async {{/async}}def call_api( + self, + method: str, + url: str, + header_params: Optional[Dict[str, Any]] = None, + body: Any = None, + post_params: Optional[List[Tuple[str, Any]]] = None, + _request_timeout: Optional[int] = None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ - return_data = response_data try: - if _preload_content: - # deserialize response data - if response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - except ValueError as e: - error = ApiException(http_resp=response_data) - error.reason = e - raise error - - if _return_http_data_only: - return (return_data) - else: - return (return_data, response_data.status, - response_data.getheaders()) + # perform request and return response + response_data = {{#async}}await {{/async}}{{#tornado}}yield {{/tornado}}self.rest_client.request( + method, + url, + headers=header_params, + body=body, + post_params=post_params, + _request_timeout=_request_timeout + ) + + except ApiException as e: + raise e - def sanitize_for_serialization(self, obj: Union[Dict[str, Any], List[Tuple[str, Any]], BaseModel]): + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if ( + not response_type + and isinstance(response_data.status, int) + and 100 <= response_data.status <= 599 + ): + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get( + str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) + + def sanitize_for_serialization(self, obj): """Builds a JSON POST object. If obj is None, return None. + If obj is SecretStr, return obj.get_secret_value() If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. - If obj is swagger model, return the properties dict. + If obj is OpenAPI model, return the properties dict. :param obj: The data to serialize. :return: The serialized form of data. """ if obj is None: return None - elif isinstance(obj, PRIMITIVE_TYPES): + elif isinstance(obj, Enum): + return obj.value + elif isinstance(obj, SecretStr): + return obj.get_secret_value() + elif isinstance(obj, self.PRIMITIVE_TYPES): return obj + elif isinstance(obj, uuid.UUID): + return str(obj) elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) - elif isinstance(obj, (datetime, date)): + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) + elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) - if isinstance(obj, dict): + elif isinstance(obj, dict): obj_dict = obj else: # Convert model obj to dict except - # attributes `swagger_types`, `attribute_map` + # attributes `openapi_types`, `attribute_map` # and attributes which value is not None. # Convert attribute name to json key in # model definition for request. - obj_dict = {obj.attribute_map[attr]: getattr(obj, attr) - for attr, _ in obj.swagger_types.items() - if getattr(obj, attr) is not None} + if hasattr(obj, 'to_dict') and callable(getattr(obj, 'to_dict')): + obj_dict = obj.to_dict() + else: + obj_dict = obj.__dict__ + + if isinstance(obj_dict, list): + # here we handle instances that can either be a list or something else, and only became a real list by calling to_dict() + return self.sanitize_for_serialization(obj_dict) - return {key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items()} + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } - def deserialize(self, response: Union[RESTResponse, ApiException], response_type: Any, is_error=False): + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. - :param is_error: boolean means deserialization should - be made for `response.body` field + :param content_type: content type of response. :return: deserialized object. """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) - if is_error: - try: - data = json.loads(response.body) - except ValueError: - data = response.body # fetch data from response object - else: + if content_type is None: try: - data = json.loads(response.data) + data = json.loads(response_text) except ValueError: - data = response.data + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+\-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) - return ApiClientDeserializer.deserialize(data, response_type) + return self.__deserialize(data, response_type) - def call_api(self, resource_path: str, method: str, path_params: Optional[Dict[str, Any]] = None, - query_params: Optional[List[Tuple[str, Any]]] = None, header_params: Optional[Dict[str, Any]] = None, - body: Any = None, post_params: Optional[List[Tuple[str, Any]]] = None, - files: Optional[Dict[str, Any]] = None, response_type: Optional[str] = None, - auth_settings: Optional[List[str]] = None, async_req: Optional[bool] = None, - _return_http_data_only: Optional[bool] = None, collection_formats: Optional[Dict[str, Any]] = None, - _preload_content: bool = True, _request_timeout: Optional[int] = None): - """Makes the HTTP request (synchronous) and returns deserialized data. + def __deserialize(self, data, klass): + """Deserializes dict, list, str into an object. - To make an async request, set the async_req parameter. + :param data: dict, list or str. + :param klass: class literal, or string of class name. - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings: Auth Settings names for the request. - :param response_type: Response data type. - :param files: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req: execute request asynchronously - :param _return_http_data_only: response data without head status code - and headers - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. + :return: object. """ - if not async_req: - return self.__call_api(resource_path, method, - path_params, query_params, header_params, - body, post_params, files, - response_type, auth_settings, - _return_http_data_only, collection_formats, - _preload_content, _request_timeout) - else: - thread = self.pool.apply_async(self.__call_api, (resource_path, - method, path_params, query_params, - header_params, body, - post_params, files, - response_type, auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, _request_timeout)) - return thread - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method in ["GET", "HEAD", "OPTIONS", "POST", "PUT", "PATCH", "DELETE"]: - return self.rest_client.request(method, url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + if data is None: + return None + + if isinstance(klass, str): + if klass.startswith('List['): + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) + return [self.__deserialize(sub_data, sub_kls) + for sub_data in data] + + if klass.startswith('Dict['): + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) + return {k: self.__deserialize(v, sub_kls) + for k, v in data.items()} + + # convert str to class + if klass in self.NATIVE_TYPES_MAPPING: + klass = self.NATIVE_TYPES_MAPPING[klass] + else: + klass = getattr({{modelPackage}}, klass) + + if klass in self.PRIMITIVE_TYPES: + return self.__deserialize_primitive(data, klass) + elif klass is object: + return self.__deserialize_object(data) + elif klass is datetime.date: + return self.__deserialize_date(data) + elif klass is datetime.datetime: + return self.__deserialize_datetime(data) + elif klass is decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: - raise ValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) + return self.__deserialize_model(data, klass) def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -331,10 +474,10 @@ class ApiClient: :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -354,33 +497,78 @@ class ApiClient: new_params.append((k, v)) return new_params - def prepare_post_parameters(self, post_params: Optional[List[Tuple[str, Any]]] = None, - files: Optional[Dict[str, Any]] = None): + def parameters_to_url_query(self, params, collection_formats): + """Get parameters as list of tuples, formatting collections. + + :param params: Parameters as dict or list of two-tuples + :param dict collection_formats: Parameter collection formats + :return: URL query string (e.g. a=Hello%20World&b=123) + """ + new_params: List[Tuple[str, str]] = [] + if collection_formats is None: + collection_formats = {} + for k, v in params.items() if isinstance(params, dict) else params: + if isinstance(v, bool): + v = str(v).lower() + if isinstance(v, (int, float)): + v = str(v) + if isinstance(v, dict): + v = json.dumps(v) + + if k in collection_formats: + collection_format = collection_formats[k] + if collection_format == 'multi': + new_params.extend((k, quote(str(value))) for value in v) + else: + if collection_format == 'ssv': + delimiter = ' ' + elif collection_format == 'tsv': + delimiter = '\t' + elif collection_format == 'pipes': + delimiter = '|' + else: # csv is the default + delimiter = ',' + new_params.append( + (k, delimiter.join(quote(str(value)) for value in v)) + ) + else: + new_params.append((k, quote(str(v)))) + + return "&".join(["=".join(map(str, item)) for item in new_params]) + + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. - :param post_params: Normal form parameters. :param files: File parameters. :return: Form parameters with files. """ params = [] - - if post_params: - params = post_params - - if files: - for k, v in files.items(): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params def select_header_accept(self, accepts: List[str]) -> Optional[str]: @@ -390,62 +578,125 @@ class ApiClient: :return: Accept (e.g. application/json). """ if not accepts: - return + return None - accepts = [x.lower() for x in accepts] + for accept in accepts: + if re.search('json', accept, re.IGNORECASE): + return accept - if 'application/json' in accepts: - return 'application/json' - else: - return ', '.join(accepts) + return accepts[0] - def select_header_content_type(self, content_types: List[str]) -> str: + def select_header_content_type(self, content_types): """Returns `Content-Type` based on an array of content_types provided. :param content_types: List of content-types. :return: Content-Type (e.g. application/json). """ if not content_types: - return 'application/json' - - content_types = [x.lower() for x in content_types] - - if 'application/json' in content_types or '*/*' in content_types: - return 'application/json' - else: - return content_types[0] + return None - def update_params_for_auth(self, headers: Optional[Dict[str, Any]], queries: Optional[List[Tuple[str, Any]]], - auth_settings: Optional[List[str]]): + for content_type in content_types: + if re.search('json', content_type, re.IGNORECASE): + return content_type + + return content_types[0] + + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. :param queries: Query parameters tuple list to be updated. :param auth_settings: Authentication setting identifiers list. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param request_auth: if set, the provided settings will + override the token in the configuration. """ if not auth_settings: return - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - if not auth_setting['value']: - continue - elif auth_setting['in'] == 'header': - headers[auth_setting['key']] = auth_setting['value'] - elif auth_setting['in'] == 'query': - queries.append((auth_setting['key'], auth_setting['value'])) - else: - raise ValueError( - 'Authentication token must be in `query` or `header`' + if request_auth: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting ) + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: + """Updates the request parameters based on a single auth_setting + + :param headers: Header parameters dict to be updated. + :param queries: Query parameters tuple list to be updated. + :resource_path: A string representation of the HTTP request resource path. + :method: A string representation of the HTTP request method. + :body: A object representing the body of the HTTP request. + The object type is the return value of sanitize_for_serialization(). + :param auth_setting: auth settings for the endpoint + """ + if auth_setting['in'] == 'cookie': + headers['Cookie'] = auth_setting['value'] + elif auth_setting['in'] == 'header': + if auth_setting['type'] != 'http-signature': + headers[auth_setting['key']] = auth_setting['value'] + {{#hasHttpSignatureMethods}} + else: + # The HTTP signature scheme requires multiple HTTP headers + # that are calculated dynamically. + signing_info = self.configuration.signing_info + auth_headers = signing_info.get_http_signature_headers( + resource_path, method, headers, body, queries) + headers.update(auth_headers) + {{/hasHttpSignatureMethods}} + elif auth_setting['in'] == 'query': + queries.append((auth_setting['key'], auth_setting['value'])) + else: + raise ApiValueError( + 'Authentication token must be in `query` or `header`' + ) + def __deserialize_file(self, response): """Deserializes body to file Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. + handle file downloading + save response body into a tmp file and return the instance + :param response: RESTResponse. :return: file path. """ @@ -455,64 +706,20 @@ class ApiClient: content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) path = os.path.join(os.path.dirname(path), filename) - response_data = response.data - with open(path, {{^writeBinary}}"w"{{/writeBinary}}{{#writeBinary}}"wb"{{/writeBinary}}) as f: - if isinstance(response_data, str): - # change str to bytes so we can write it - response_data = response_data.encode('utf-8') - f.write(response_data) - else: - f.write(response_data) - return path - - -class ApiClientDeserializer: - """Deserializes server response into appropriate type.""" - @staticmethod - def deserialize(data: Union[Dict, List, str], klass: Any): - """Deserializes dict, list, str into an object. - :param data: dict, list or str. - :param klass: class literal, or string of class name. + with open(path, "wb") as f: + f.write(response.data) - :return: object. - """ - if data is None: - return None - - if type(klass) == str: - if klass.startswith('list['): - sub_kls = re.match(r'list\[(.*)\]', klass).group(1) - return [ApiClientDeserializer.deserialize(sub_data, sub_kls) - for sub_data in data] - - if klass.startswith('dict('): - sub_kls = re.match(r'dict\(([^,]*), (.*)\)', klass).group(2) - return {k: ApiClientDeserializer.deserialize(v, sub_kls) - for k, v in data.items()} - - # convert str to class - if klass in NATIVE_TYPES_MAPPING: - klass = NATIVE_TYPES_MAPPING[klass] - else: - klass = getattr({{modelPackage}}, klass) - - if klass in PRIMITIVE_TYPES: - return ApiClientDeserializer.__deserialize_primitive(data, klass) - elif klass == object: - return data - elif klass == date: - return ApiClientDeserializer.__deserialize_date(data) - elif klass == datetime: - return ApiClientDeserializer.__deserialize_datatime(data) - else: - return ApiClientDeserializer.__deserialize_model(data, klass) + return path - @staticmethod - def __deserialize_primitive(data, klass): + def __deserialize_primitive(self, data, klass): """Deserializes string to primitive type. :param data: str. @@ -527,14 +734,20 @@ class ApiClientDeserializer: except TypeError: return data - @staticmethod - def __deserialize_date(string: str) -> date: + def __deserialize_object(self, value): + """Return an original value. + + :return: object. + """ + return value + + def __deserialize_date(self, string): """Deserializes string to date. :param string: str. + :return: date. """ try: - from dateutil.parser import parse return parse(string).date() except ImportError: return string @@ -544,16 +757,15 @@ class ApiClientDeserializer: reason="Failed to parse `{0}` as date object".format(string) ) - @staticmethod - def __deserialize_datatime(string: str) -> datetime: + def __deserialize_datetime(self, string): """Deserializes string to datetime. The string should be in iso8601 datetime format. :param string: str. + :return: datetime. """ try: - from dateutil.parser import parse return parse(string) except ImportError: return string @@ -566,12 +778,25 @@ class ApiClientDeserializer: ) ) - @staticmethod - def __hasattr(object, name): - return name in object.__class__.__dict__ + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) - @staticmethod - def __deserialize_model(data, klass): + def __deserialize_model(self, data, klass): """Deserializes list or dict to model. :param data: dict, list. @@ -579,30 +804,4 @@ class ApiClientDeserializer: :return: model object. """ - if not klass.swagger_types and not ApiClientDeserializer.__hasattr(klass, 'get_real_child_model'): - if hasattr(klass, '__parent_class__') and klass.__parent_class__ == 'dict': - return klass(**data) - return data - - kwargs = {} - if klass.swagger_types is not None: - for attr, attr_type in klass.swagger_types.items(): - if (data is not None and - klass.attribute_map[attr] in data and - isinstance(data, (list, dict))): - value = data[klass.attribute_map[attr]] - kwargs[attr] = ApiClientDeserializer.deserialize(value, attr_type) - - instance = klass(**kwargs) - - if (isinstance(instance, dict) and - klass.swagger_types is not None and - isinstance(data, dict)): - for key, value in data.items(): - if key not in klass.swagger_types: - instance[key] = value - if ApiClientDeserializer.__hasattr(instance, 'get_real_child_model'): - klass_name = instance.get_real_child_model(data) - if klass_name: - instance = ApiClientDeserializer.deserialize(data, klass_name) - return instance + return klass.from_dict(data) \ No newline at end of file diff --git a/template/api_doc.mustache b/template/api_doc.mustache index d26382e5..f7d91384 100644 --- a/template/api_doc.mustache +++ b/template/api_doc.mustache @@ -1,66 +1,57 @@ # {{packageName}}.{{classname}}{{#description}} -{{description}}{{/description}} +{{.}}{{/description}} All URIs are relative to *{{basePath}}* Method | HTTP request | Description ------------- | ------------- | ------------- -{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} +{{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{summary}} {{/operation}}{{/operations}} {{#operations}} {{#operation}} # **{{{operationId}}}** -> {{#returnType}}{{{returnType}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{/required}}{{^required}}{{{paramName}}}={{{paramName}}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}) +> {{#returnType}}{{{.}}} {{/returnType}}{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{/required}}{{^required}}{{{paramName}}}={{{paramName}}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) -{{{summary}}}{{#notes}} +{{#summary}} +{{{summary}}} -{{{notes}}}{{/notes}} +{{/summary}} +{{#unescapedNotes}} +{{{.}}} +{{/unescapedNotes}} ### Example -```python -import {{{packageName}}} -from {{{packageName}}}.rest import ApiException +{{> api_doc_example }} -# Configure API key authorization and region -configuration = {{{packageName}}}.Configuration(api_key="SECRET_API_KEY") -# configuration = {{{packageName}}}.Configuration(api_key="SECRET_API_KEY", region="eu") - -# create an instance of the API class -api_instance = {{{packageName}}}.FingerprintApi(configuration) - -{{#allParams}}{{paramName}} = {{#isBoolean}}{{#example}}True{{/example}}{{^example}}False{{/example}}{{/isBoolean}}{{^isBoolean}}{{{example}}}{{/isBoolean}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} -{{/allParams}} - -try: -{{#summary}} # {{{.}}} -{{/summary}} {{#returnType}}api_response = {{/returnType}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/allParams}}){{#returnType}} - print(api_response){{/returnType}} -except ApiException as e: - print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) -``` ### Parameters -{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#@last}} +{{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} Name | Type | Description | Notes -------------- | ------------- | ------------- | -------------{{/@last}}{{/allParams}} -{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}}| {{{description}}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} +------------- | ------------- | ------------- | -------------{{/-last}}{{/allParams}} +{{#allParams}} **{{paramName}}** | {{#isFile}}**{{dataType}}**{{/isFile}}{{^isFile}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{baseType}}.md){{/isPrimitiveType}}{{/isFile}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{.}}]{{/defaultValue}} {{/allParams}} ### Return type {{#returnType}}{{#returnTypeIsPrimitive}}**{{{returnType}}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{{returnType}}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}void (empty response body){{/returnType}} -### Authorization +### HTTP request headers -{{^authMethods}}No authorization required{{/authMethods}}{{#authMethods}}[{{{name}}}](../README.md#{{{name}}}){{^@last}}, {{/@last}}{{/authMethods}} + - **Content-Type**: {{#consumes}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} + - **Accept**: {{#produces}}{{{mediaType}}}{{^-last}}, {{/-last}}{{/produces}}{{^produces}}Not defined{{/produces}} -### HTTP request headers +{{#responses.0}} +### HTTP response details - - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} - - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}} +| Status code | Description | Response headers | +|-------------|-------------|------------------| +{{#responses}} +**{{code}}** | {{message}} | {{#headers}} * {{baseName}} - {{description}}
{{/headers}}{{^headers.0}} - {{/headers.0}} | +{{/responses}} +{{/responses.0}} [[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) {{/operation}} -{{/operations}} +{{/operations}} \ No newline at end of file diff --git a/template/api_doc_example.mustache b/template/api_doc_example.mustache new file mode 100644 index 00000000..a41b2828 --- /dev/null +++ b/template/api_doc_example.mustache @@ -0,0 +1,34 @@ + +```python +import os + +import {{{packageName}}} +{{#vendorExtensions.x-py-example-import}} +{{{.}}} +{{/vendorExtensions.x-py-example-import}} +from {{{packageName}}}.rest import ApiException +from {{packageName}}.configuration import Region +from pprint import pprint + +{{> python_doc_auth_partial}} + + +# Create an instance of the API class +api_instance = {{packageName}}.FingerprintApi(configuration) + +{{#allParams}} +{{paramName}}: {{{dataType}}} = {{{example}}} # {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} +{{/allParams}} + +try: + {{#summary}} + # {{{.}}} + {{/summary}} + {{#returnType}}api_response = {{/returnType}}{{#async}}await {{/async}}api_instance.{{{operationId}}}({{#allParams}}{{#required}}{{paramName}}{{/required}}{{^required}}{{paramName}}={{paramName}}{{/required}}{{^-last}}, {{/-last}}{{/allParams}}) + {{#returnType}} + print("The response of {{classname}}->{{operationId}}:\n") + pprint(api_response) + {{/returnType}} +except Exception as e: + print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) +``` \ No newline at end of file diff --git a/template/common_README.mustache b/template/common_README.mustache new file mode 100644 index 00000000..f9e79ced --- /dev/null +++ b/template/common_README.mustache @@ -0,0 +1,201 @@ +```python +import os + +import {{packageName}} +from {{packageName}}.configuration import Region + +{{> python_doc_auth_partial}} + +# create an instance of the API class +api_instance = {{packageName}}.FingerprintApi(configuration) +``` + +## Examples + +Delete visitor data using `visitorId`: +```python +import os + +import {{packageName}} +from {{packageName}}.rest import ApiException +from {{packageName}}.configuration import Region + +{{> python_doc_auth_partial}} + +api_instance = {{packageName}}.FingerprintApi(configuration) + +visitor_id = 'visitor_id_example' + +try: + api_instance.delete_visitor_data(visitor_id) +except ApiException as e: + print("Exception when calling FingerprintApi->delete_visitor_data: %s\n" % e) +``` + +Fetching event details for `eventId`: +```python +import os + +import {{packageName}} +from {{packageName}}.rest import ApiException +from {{packageName}}.configuration import Region + +{{> python_doc_auth_partial}} + +api_instance = {{packageName}}.FingerprintApi(configuration) + +event_id = 'event_id_example' + +try: + events_response = api_instance.get_event(event_id) +except ApiException as e: + print("Exception when calling FingerprintApi->get_event: %s\n" % e) +``` + +Search events with custom filters: +```python +import os + +import {{packageName}} +from {{packageName}}.rest import ApiException +from {{packageName}}.configuration import Region + +{{> python_doc_auth_partial}} + +api_instance = {{packageName}}.FingerprintApi(configuration) + +limit = 20 +pagination_key = 'key_example' +visitor_id = 'VISITOR_ID' +bot = 'good' +ip_address = '192.168.0.1/32' +linked_id = 'linked_id_example' +start = 1738687200000 +end = 1738773600000 +reverse = True +suspect = False + +try: + # Get events via search + api_response = api_instance.search_events(limit, pagination_key=pagination_key, visitor_id=visitor_id, bot=bot, ip_address=ip_address, linked_id=linked_id, start=start, end=end, reverse=reverse, suspect=suspect) + print(api_response) +except ApiException as e: + print("Exception when calling FingerprintApi->get_event: %s\n" % e) +``` + +Update event for `eventId`: +```python +import os + +import {{packageName}} +from {{packageName}} import EventUpdate +from {{packageName}}.rest import ApiException +from {{packageName}}.configuration import Region + +{{> python_doc_auth_partial}} + +api_instance = {{packageName}}.FingerprintApi(configuration) + +event_id = 'event_id_example' +body = EventUpdate(linked_id='foo') +# body = EventUpdate(tags={'bar': 123}) +# body = EventUpdate(suspect=True) +# body = EventUpdate(linked_id='foo', tags={'bar': 123}, suspect=False) + +try: + api_instance.update_event(event_id, body) +except ApiException as e: + print("Exception when calling FingerprintApi->update_event: %s\n" % e) +``` + +## Sealed results + +This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results). +```python +import base64 +import os + +from dotenv import load_dotenv + +from {{packageName}} import unseal_event_response, DecryptionKey, DecryptionAlgorithm + +load_dotenv() + +sealed_result = base64.b64decode(os.environ["BASE64_SEALED_RESULT"]) +key = base64.b64decode(os.environ["BASE64_KEY"]) + +try: + event_response = unseal_event_response(sealed_result, [DecryptionKey(key, DecryptionAlgorithm['Aes256Gcm'])]) + print("\n\n\nEvent response: \n", event_response.products) +except Exception as e: + print("Exception when calling unsealing events response: %s\n" % e) + exit(1) + +print("Unseal successful!") + +exit(0) +``` +To learn more, refer to example located in [sealed_results_example.py](sealed_results_example.py). + +## Webhook signature validation + +This SDK provides utility method for verifying the HMAC signature of the incoming webhook request. +```python +import os +from flask import Flask, request, jsonify +from {{packageName}} import WebhookValidation + +app = Flask(__name__) + +@app.route('/api/webhook', methods=['POST']) +def webhook_handler(): + try: + # Retrieve the secret key from environment variables + secret = os.getenv("WEBHOOK_SIGNATURE_SECRET") + if not secret: + return jsonify({"message": "Secret key is not configured."}), 400 + + # Get the "fpjs-event-signature" header from the incoming request + header = request.headers.get('fpjs-event-signature') + if not header: + return jsonify({"message": "Missing fpjs-event-signature header."}), 400 + + # Read the raw body of the incoming request + data = request.get_data() + + # Validate the webhook signature + is_valid = WebhookValidation.is_valid_webhook_signature(header, data, secret) + if not is_valid: + return jsonify({"message": "Webhook signature is invalid."}), 403 + + # Process the webhook data here + return jsonify({"message": "Webhook received."}), 200 + + except Exception as e: + # Handle any unexpected errors + return jsonify({"error": str(e)}), 500 + +if __name__ == '__main__': + # Start the Flask application on the specified host and port + app.run(host='0.0.0.0', port=5000) +``` +To learn more, refer to example located in [webhook_signature_example.py](webhook_signature_example.py). + +## Documentation for API Endpoints + +All URIs are relative to *{{{basePath}}}* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +{{#apiInfo}}{{#apis}}{{#operations}}{{#operation}}*{{classname}}* | [**{{operationId}}**]({{apiDocPath}}{{classname}}.md#{{operationIdLowerCase}}) | **{{httpMethod}}** {{path}} | {{summary}} +{{/operation}}{{/operations}}{{/apis}}{{/apiInfo}} + +## Documentation For Models + +{{#models}}{{#model}} - [{{{classname}}}]({{modelDocPath}}{{{classname}}}.md) +{{/model}}{{/models}} + +## Documentation for sealed results + +- [SealedResults](docs/SealedResults.md) +- [DecryptionKey](docs/DecryptionKey.md) diff --git a/template/configuration.mustache b/template/configuration.mustache index cba5e82a..c1885113 100644 --- a/template/configuration.mustache +++ b/template/configuration.mustache @@ -2,108 +2,287 @@ {{>partial_header}} + +{{#async}} +import base64 +{{/async}} import copy +import http.client as httplib import logging +from logging import FileHandler +{{^async}} import multiprocessing +{{/async}} import sys -import http.client as httplib - -from typing import Dict +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union, Tuple +from typing_extensions import NotRequired, Self +from {{packageName}} import __version__ +from enum import Enum + +{{#hasHttpSignatureMethods}} +from {{packageName}}.signing import HttpSigningConfiguration +{{/hasHttpSignatureMethods}} + +JSON_SCHEMA_VALIDATION_KEYWORDS = { + 'multipleOf', 'maximum', 'exclusiveMaximum', + 'minimum', 'exclusiveMinimum', 'maxLength', + 'minLength', 'pattern', 'maxItems', 'minItems' +} + +ServerVariablesT = Dict[str, str] + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + +AuthSettings = TypedDict( + "AuthSettings", + { +{{#authMethods}} +{{#isOAuth}} + "{{name}}": OAuth2AuthSetting, +{{/isOAuth}} +{{#isApiKey}} + "{{name}}": APIKeyAuthSetting, +{{/isApiKey}} +{{#isBasic}} + {{#isBasicBasic}} + "{{name}}": BasicAuthSetting, + {{/isBasicBasic}} + {{#isBasicBearer}} + {{#bearerFormat}} + "{{name}}": BearerFormatAuthSetting, + {{/bearerFormat}} + {{^bearerFormat}} + "{{name}}": BearerAuthSetting, + {{/bearerFormat}} + {{/isBasicBearer}} + {{#isHttpSignature}} + "{{name}}": HTTPSignatureAuthSetting, + {{/isHttpSignature}} +{{/isBasic}} +{{/authMethods}} + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + +class Region(Enum): + US = "us" + EU = "eu" + AP = "ap" class Configuration: - """NOTE: This class is auto generated by the swagger code generator program. - - Ref: https://github.com/swagger-api/swagger-codegen - Do not edit the class manually. + """This class contains various settings of the API client. + + :param api_key: Required API key. + :param region: Region. + :param host: Optional base url. If this provided, region will not be used. + :param ssl_ca_cert: str - the path to a file of concatenated CA certificates + in PEM format. + :param retries: Number of retries for API requests. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. + :param default_query_params: default additional query parameters. """ - _default = None - - def __init__(self, api_key: str, region: str = "us"): - """Constructor""" - if self._default: - for key in self._default.__dict__.keys(): - self.__dict__[key] = copy.copy(self._default.__dict__[key]) - return - - # Default Base url - self.host = self.get_host(region) - # Temp file folder for downloading files - self.temp_folder_path = None + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + api_key: str, + region: Region = Region.US, + host: Optional[str]=None, + ssl_ca_cert: Optional[str]=None, + retries: Optional[int] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + default_query_params: Optional[List[Tuple[str, str]]] = None, + *, + debug: Optional[bool] = None, + ) -> None: + """Constructor + """ + if host: + self._base_path = host + else: + self._base_path = self.get_host(region) - # Authentication Settings - # dict to store API key(s) self.api_key = api_key -{{#authMethods}}{{#isOAuth}} - # access token for OAuth - self.access_token = "" -{{/isOAuth}}{{/authMethods}} - # Logging Settings - self.logger = {"package_logger": logging.getLogger("{{packageName}}"), - "urllib3_logger": logging.getLogger("urllib3")} - # Log format + + self.logger = {} + """Logging Settings + """ + self.logger["package_logger"] = logging.getLogger("{{packageName}}") + {{^async}} + self.logger["urllib3_logger"] = logging.getLogger("urllib3") + {{/async}} self.logger_format = '%(asctime)s %(levelname)s %(message)s' - # Log stream handler + """Log format + """ self.logger_stream_handler = None - # Log file handler - self.logger_file_handler = None - # Debug file location + """Log stream handler + """ + self.logger_file_handler: Optional[FileHandler] = None + """Log file handler + """ self.logger_file = None - # Debug switch - self.debug = False + """Debug file location + """ + if debug is not None: + self.debug = debug + else: + self.__debug = False + """Debug switch + """ - # SSL/TLS verification - # Set this to false to skip verifying SSL certificate when calling API - # from https server. self.verify_ssl = True - # Set this to customize the certificate file to verify the peer. - self.ssl_ca_cert = None - # client certificate file + """SSL/TLS verification + Set this to false to skip verifying SSL certificate when calling API + from https server. + """ + self.ssl_ca_cert = ssl_ca_cert + """Set this to customize the certificate file to verify the peer. + """ + self.ca_cert_data = ca_cert_data + """Set this to verify the peer using PEM (str) or DER (bytes) + certificate data. + """ self.cert_file = None - # client key file + """client certificate file + """ self.key_file = None - # Set this to True/False to enable/disable SSL hostname verification. + """client key file + """ self.assert_hostname = None + """Set this to True/False to enable/disable SSL hostname verification. + """ + self.tls_server_name = None + """SSL/TLS Server Name Indication (SNI) + Set this to the SNI value expected by the server. + """ - # urllib3 connection pool's maximum number of connections saved - # per pool. urllib3 uses 1 connection as default value, but this is - # not the best value when you are making a lot of possibly parallel - # requests to the same host, which is often the case here. - # cpu_count * 5 is used as default value to increase performance. + {{#async}} + self.connection_pool_maxsize = 100 + """This value is passed to the aiohttp to limit simultaneous connections. + Default values is 100, None means no-limit. + """ + {{/async}} + {{^async}} self.connection_pool_maxsize = multiprocessing.cpu_count() * 5 + """urllib3 connection pool's maximum number of connections saved + per pool. urllib3 uses 1 connection as default value, but this is + not the best value when you are making a lot of possibly parallel + requests to the same host, which is often the case here. + cpu_count * 5 is used as default value to increase performance. + """ + {{/async}} - # Proxy URL - self.proxy = None - # Safe chars for path_param + self.proxy: Optional[str] = None + """Proxy URL + """ + self.proxy_headers = None + """Proxy headers + """ self.safe_chars_for_path_param = '' - - # Disable client side validation + """Safe chars for path_param + """ + self.retries = retries + """Adding retries to override urllib3 default value 3 + """ + # Enable client side validation self.client_side_validation = True + self.socket_options = None + """Options to pass down to the underlying urllib3 socket + """ + + self.datetime_format = "{{{datetimeFormat}}}" + """datetime format + """ + + self.date_format = "{{{dateFormat}}}" + """date format + """ + + if default_query_params: + self.default_query_params = default_query_params + else: + self.default_query_params: List[Tuple[str, str]] = [("ii", f"fingerprint-server-python-sdk/{__version__}")] + + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: + cls = self.__class__ + result = cls.__new__(cls) + memo[id(self)] = result + for k, v in self.__dict__.items(): + if k not in ('logger', 'logger_file_handler'): + setattr(result, k, copy.deepcopy(v, memo)) + # shallow copy of loggers + result.logger = copy.copy(self.logger) + # use setters to configure loggers + result.logger_file = self.logger_file + result.debug = self.debug + return result + + def __setattr__(self, name: str, value: Any) -> None: + object.__setattr__(self, name, value) +{{#hasHttpSignatureMethods}} + if name == "signing_info" and value is not None: + # Ensure the host parameter from signing info is the same as + # Configuration.host. + value.host = self.host +{{/hasHttpSignatureMethods}} + @classmethod - def set_default(cls, default): + def set_default(cls, default: Optional[Self]) -> None: + """Set default instance of configuration. + + It stores default configuration, which can be + returned by get_default_copy method. + + :param default: object of Configuration + """ cls._default = default @property - def logger_file(self) -> str: + def logger_file(self) -> Optional[str]: """The logger file. If the logger_file is None, then add stream handler and remove file handler. Otherwise, add file handler and remove stream handler. - :return: The logger_file path. + :type: str """ return self.__logger_file @logger_file.setter - def logger_file(self, value: str): + def logger_file(self, value: Optional[str]) -> None: """The logger file. If the logger_file is None, then add stream handler and remove file handler. Otherwise, add file handler and remove stream handler. :param value: The logger_file path. + :type: str """ self.__logger_file = value if self.__logger_file: @@ -113,31 +292,21 @@ class Configuration: self.logger_file_handler.setFormatter(self.logger_formatter) for _, logger in self.logger.items(): logger.addHandler(self.logger_file_handler) - if self.logger_stream_handler: - logger.removeHandler(self.logger_stream_handler) - else: - # If not set logging file, - # then add stream handler and remove file handler. - self.logger_stream_handler = logging.StreamHandler() - self.logger_stream_handler.setFormatter(self.logger_formatter) - for _, logger in self.logger.items(): - logger.addHandler(self.logger_stream_handler) - if self.logger_file_handler: - logger.removeHandler(self.logger_file_handler) @property def debug(self) -> bool: """Debug status - :param value: The debug status, True or False. + :type: bool """ return self.__debug @debug.setter - def debug(self, value: bool): + def debug(self, value: bool) -> None: """Debug status :param value: The debug status, True or False. + :type: bool """ self.__debug = value if self.__debug: @@ -160,49 +329,40 @@ class Configuration: The logger_formatter will be updated when sets logger_format. - :return: The format string. + :type: str """ return self.__logger_format @logger_format.setter - def logger_format(self, value: str): + def logger_format(self, value: str) -> None: """The logger format. The logger_formatter will be updated when sets logger_format. :param value: The format string. + :type: str """ self.__logger_format = value self.logger_formatter = logging.Formatter(self.__logger_format) - def auth_settings(self) -> Dict[str, Dict[str, str]]: + def auth_settings(self) -> AuthSettings: """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ - return { -{{#authMethods}} -{{#isApiKey}} -{{#isKeyInHeader}} - '{{name}}': - { - 'type': 'api_key', - 'in': 'header', - 'key': '{{keyParamName}}', - 'value': self.api_key - }, -{{/isKeyInHeader}} -{{/isApiKey}}{{/authMethods}} + auth: AuthSettings = {} + bearerAuth: BearerFormatAuthSetting = { + 'type': 'bearer', + 'in': 'header', + 'format': 'JWT', + 'key': 'Authorization', + 'value': 'Bearer ' + self.api_key } - def get_host(self, region: str) -> str: - return { - "us": "https://api.fpjs.io", - "eu": "https://eu.api.fpjs.io", - "ap": "https://ap.api.fpjs.io", - }.get(region, "https://api.fpjs.io") + auth['bearerAuth'] = bearerAuth + return auth - def to_debug_report(self): + def to_debug_report(self) -> str: """Gets the essential information for debugging. :return: The report for debugging. @@ -213,3 +373,21 @@ class Configuration: "Version of the API: {{version}}\n"\ "SDK Package Version: {{packageVersion}}".\ format(env=sys.platform, pyversion=sys.version) + + @staticmethod + def get_host(region: Region) -> str: + return { + Region.US: "https://api.fpjs.io/v4", + Region.EU: "https://eu.api.fpjs.io/v4", + Region.AP: "https://ap.api.fpjs.io/v4", + }.get(region, "https://api.fpjs.io/v4") + + @property + def host(self) -> str: + """Return generated host.""" + return self._base_path + + @host.setter + def host(self, value: str) -> None: + """Fix base path.""" + self._base_path = value diff --git a/template/exceptions.mustache b/template/exceptions.mustache new file mode 100644 index 00000000..2a1d60ab --- /dev/null +++ b/template/exceptions.mustache @@ -0,0 +1,218 @@ +# coding: utf-8 + +{{>partial_header}} + +from typing import Any, Optional +from typing_extensions import Self + +class OpenApiException(Exception): + """The base exception class for all OpenAPIExceptions""" + + +class ApiTypeError(OpenApiException, TypeError): + def __init__(self, msg, path_to_item=None, valid_classes=None, + key_type=None) -> None: + """ Raises an exception for TypeErrors + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list): a list of keys an indices to get to the + current_item + None if unset + valid_classes (tuple): the primitive classes that current item + should be an instance of + None if unset + key_type (bool): False if our value is a value in a dict + True if it is a key in a dict + False if our item is an item in a list + None if unset + """ + self.path_to_item = path_to_item + self.valid_classes = valid_classes + self.key_type = key_type + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiTypeError, self).__init__(full_msg) + + +class ApiValueError(OpenApiException, ValueError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (list) the path to the exception in the + received_data dict. None if unset + """ + + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiValueError, self).__init__(full_msg) + + +class ApiAttributeError(OpenApiException, AttributeError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Raised when an attribute reference or assignment fails. + + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiAttributeError, self).__init__(full_msg) + + +class ApiKeyError(OpenApiException, KeyError): + def __init__(self, msg, path_to_item=None) -> None: + """ + Args: + msg (str): the exception message + + Keyword Args: + path_to_item (None/list) the path to the exception in the + received_data dict + """ + self.path_to_item = path_to_item + full_msg = msg + if path_to_item: + full_msg = "{0} at {1}".format(msg, render_path(path_to_item)) + super(ApiKeyError, self).__init__(full_msg) + + +class ApiException(OpenApiException): + + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + + if http_resp: + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass + self.headers = http_resp.headers + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 429: + raise TooManyRequestsException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) + + def __str__(self): + """Custom error messages for exception""" + error_message = "({0})\n"\ + "Reason: {1}\n".format(self.status, self.reason) + if self.headers: + error_message += "HTTP response headers: {0}\n".format( + self.headers) + + if self.body: + error_message += "HTTP response body: {0}\n".format(self.body) + + if self.data: + error_message += "HTTP response data: {0}\n".format(self.data) + + return error_message + + +class BadRequestException(ApiException): + pass + + +class NotFoundException(ApiException): + pass + + +class UnauthorizedException(ApiException): + pass + + +class ForbiddenException(ApiException): + pass + + +class ServiceException(ApiException): + pass + + +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + + +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass + + +class TooManyRequestsException(ApiException): + """Exception for HTTP 429 Too Many Requests.""" + pass + + +def render_path(path_to_item): + """Returns a string representation of a path""" + result = "" + for pth in path_to_item: + if isinstance(pth, int): + result += "[{0}]".format(pth) + else: + result += "['{0}']".format(pth) + return result \ No newline at end of file diff --git a/template/exports_api.mustache b/template/exports_api.mustache new file mode 100644 index 00000000..018082c8 --- /dev/null +++ b/template/exports_api.mustache @@ -0,0 +1,3 @@ +# import apis into api package +{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}} +{{/apis}}{{/apiInfo}} \ No newline at end of file diff --git a/template/exports_package.mustache b/template/exports_package.mustache new file mode 100644 index 00000000..e36f0807 --- /dev/null +++ b/template/exports_package.mustache @@ -0,0 +1,28 @@ +# import apis into sdk package +{{#apiInfo}}{{#apis}}from {{apiPackage}}.{{classFilename}} import {{classname}} +{{/apis}}{{/apiInfo}} +# import ApiClient +from {{packageName}}.api_response import ApiResponse +from {{packageName}}.api_client import ApiClient +from {{packageName}}.configuration import Configuration +from {{packageName}}.exceptions import OpenApiException +from {{packageName}}.exceptions import ApiTypeError +from {{packageName}}.exceptions import ApiValueError +from {{packageName}}.exceptions import ApiKeyError +from {{packageName}}.exceptions import ApiAttributeError +from {{packageName}}.exceptions import ApiException +from {{packageName}}.exceptions import BadRequestException +from {{packageName}}.exceptions import NotFoundException +from {{packageName}}.exceptions import UnauthorizedException +from {{packageName}}.exceptions import ForbiddenException +from {{packageName}}.exceptions import ServiceException +from {{packageName}}.exceptions import ConflictException +from {{packageName}}.exceptions import UnprocessableEntityException +from {{packageName}}.exceptions import TooManyRequestsException +{{#hasHttpSignatureMethods}} +from {{packageName}}.signing import HttpSigningConfiguration +{{/hasHttpSignatureMethods}} + +# import models into sdk package +{{#models}}{{#model}}from {{modelPackage}}.{{classFilename}} import {{classname}} +{{/model}}{{/models}} \ No newline at end of file diff --git a/template/model.mustache b/template/model.mustache deleted file mode 100644 index 6ad97ffd..00000000 --- a/template/model.mustache +++ /dev/null @@ -1,201 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -import re # noqa: F401 -from typing import Dict, List, Optional # noqa: F401 -from {{packageName}}.base_model import BaseModel -{{#models}} -{{#model}} -{{#vars}} -{{#complexType}} -from {{packageName}}.models.__to__snake__case({{complexType}}) import {{complexType}} -{{/complexType}} -{{#isDateTime}} -from datetime import datetime -{{/isDateTime}} -{{/vars}} -{{#schema.deprecated}} -from typing_extensions import deprecated -{{/schema.deprecated}} - - -{{#schema.deprecated}} -@deprecated("This class is deprecated. Please avoid using it in new code.") -{{/schema.deprecated}} -class {{classname}}({{#parent}}{{parent}}{{/parent}}{{^parent}}BaseModel{{/parent}}): - """{{#description}} - {{{.}}} - - {{/description}}NOTE: This class is auto generated by the swagger code generator program. - - Do not edit the class manually. - """{{#allowableValues}} - - """ - allowed enum values - """ -{{#enumVars}} - {{name}} = {{{value}}}{{^@last}} -{{/@last}} -{{/enumVars}}{{/allowableValues}} - - """ - Attributes: - swagger_types (dict): The key is attribute name - and the value is attribute type. - attribute_map (dict): The key is attribute name - and the value is json key in definition. - """ - swagger_types = { -{{#vars}} - '{{name}}': '{{{datatype}}}'{{#hasMore}},{{/hasMore}} -{{/vars}} - } - - nullable_map = { -{{#vars}} - '{{name}}': {{#nullable}}True{{/nullable}}{{^nullable}}False{{/nullable}}{{#hasMore}},{{/hasMore}} -{{/vars}} - } - - attribute_map = { -{{#vars}} - '{{name}}': '{{baseName}}'{{#hasMore}},{{/hasMore}} -{{/vars}} - } -{{#discriminator}} - - discriminator_value_class_map = { - {{#children}}'{{^vendorExtensions.x-discriminator-value}}{{name}}{{/vendorExtensions.x-discriminator-value}}{{#vendorExtensions.x-discriminator-value}}{{{vendorExtensions.x-discriminator-value}}}{{/vendorExtensions.x-discriminator-value}}': '{{{classname}}}'{{^@last}}, - {{/@last}}{{/children}} - } -{{/discriminator}} - -{{#parent}} - __parent_class__ = '{{parent}}' -{{/parent}} -{{^parent}} - def __init__(self{{#vars}}, {{name}}={{#defaultValue}}{{{defaultValue}}}{{/defaultValue}}{{^defaultValue}}None{{/defaultValue}}{{/vars}}): # noqa: E501 - """{{classname}} - a model defined in Swagger""" # noqa: E501{{#parent}} - super().__init__(){{/parent}} -{{#vars}}{{#@first}} -{{/@first}} - self._{{name}} = None -{{/vars}} - self.discriminator = {{#discriminator}}'{{discriminator}}'{{/discriminator}}{{^discriminator}}None{{/discriminator}} -{{/parent}} -{{#vars}}{{#@first}} -{{/@first}} -{{#required}} - self.{{name}} = {{name}} -{{/required}} -{{^required}} - if {{name}} is not None: - self.{{name}} = {{name}} -{{/required}} -{{/vars}} - -{{#vars}} - @property - def {{name}}(self) -> {{#required}}{{datatype}}{{/required}}{{^required}}Optional[{{datatype}}]{{/required}}: - """Gets the {{name}} of this {{classname}}. # noqa: E501 - -{{#description}} - {{{description}}} # noqa: E501 -{{/description}} - - :return: The {{name}} of this {{classname}}. # noqa: E501 - """ - return self._{{name}} - - @{{name}}.setter - def {{name}}(self, {{name}}: {{#required}}{{datatype}}{{/required}}{{^required}}Optional[{{datatype}}]{{/required}}): - """Sets the {{name}} of this {{classname}}. - -{{#description}} - {{{description}}} # noqa: E501 -{{/description}} - - :param {{name}}: The {{name}} of this {{classname}}. # noqa: E501 - """ -{{#required}} -{{^nullable}} - if {{name}} is None: - raise ValueError("Invalid value for `{{name}}`, must not be `None`") # noqa: E501 -{{/nullable}} -{{/required}} -{{#isEnum}} -{{#isContainer}} - allowed_values = [{{#allowableValues}}{{#values}}{{#items.isString}}"{{/items.isString}}{{{this}}}{{#items.isString}}"{{/items.isString}}{{^@last}}, {{/@last}}{{/values}}{{/allowableValues}}] # noqa: E501 -{{#isListContainer}} - if (not set({{{name}}}).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid values for `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set({{{name}}}) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) -{{/isListContainer}} -{{#isMapContainer}} - if (not set({{{name}}}.keys()).issubset(set(allowed_values))): # noqa: E501 - raise ValueError( - "Invalid keys in `{{{name}}}` [{0}], must be a subset of [{1}]" # noqa: E501 - .format(", ".join(map(str, set({{{name}}}.keys()) - set(allowed_values))), # noqa: E501 - ", ".join(map(str, allowed_values))) - ) -{{/isMapContainer}} -{{/isContainer}} -{{^isContainer}} - allowed_values = [{{#allowableValues}}{{#values}}{{#isString}}"{{/isString}}{{{this}}}{{#isString}}"{{/isString}}{{^@last}}, {{/@last}}{{/values}}{{/allowableValues}}] # noqa: E501 - if ({{{name}}} not in allowed_values): - raise ValueError( - "Invalid value for `{{{name}}}` ({0}), must be one of {1}" # noqa: E501 - .format({{{name}}}, allowed_values) - ) -{{/isContainer}} -{{/isEnum}} -{{^isEnum}} -{{#hasValidation}} -{{#maxLength}} - if ({{name}} is not None and len({{name}}) > {{maxLength}}): - raise ValueError("Invalid value for `{{name}}`, length must be less than or equal to `{{maxLength}}`") # noqa: E501 -{{/maxLength}} -{{#minLength}} - if ({{name}} is not None and len({{name}}) < {{minLength}}): - raise ValueError("Invalid value for `{{name}}`, length must be greater than or equal to `{{minLength}}`") # noqa: E501 -{{/minLength}} -{{#maximum}} - if ({{name}} is not None and {{name}} >{{#exclusiveMaximum}}={{/exclusiveMaximum}} {{maximum}}): # noqa: E501 - raise ValueError("Invalid value for `{{name}}`, must be a value less than {{^exclusiveMaximum}}or equal to {{/exclusiveMaximum}}`{{maximum}}`") # noqa: E501 -{{/maximum}} -{{#minimum}} - if ({{name}} is not None and {{name}} <{{#exclusiveMinimum}}={{/exclusiveMinimum}} {{minimum}}): # noqa: E501 - raise ValueError("Invalid value for `{{name}}`, must be a value greater than {{^exclusiveMinimum}}or equal to {{/exclusiveMinimum}}`{{minimum}}`") # noqa: E501 -{{/minimum}} -{{#pattern}} - if ({{name}} is not None and not re.search(r'{{{vendorExtensions.x-regex}}}', {{name}}{{#vendorExtensions.x-modifiers}}{{#@first}}, flags={{/@first}}re.{{.}}{{^@last}} | {{/@last}}{{/vendorExtensions.x-modifiers}})): # noqa: E501 - raise ValueError(r"Invalid value for `{{name}}`, must be a follow pattern or equal to `{{{pattern}}}`") # noqa: E501 -{{/pattern}} -{{#maxItems}} - if ({{name}} is not None and len({{name}}) > {{maxItems}}): - raise ValueError("Invalid value for `{{name}}`, number of items must be less than or equal to `{{maxItems}}`") # noqa: E501 -{{/maxItems}} -{{#minItems}} - if ({{name}} is not None and len({{name}}) < {{minItems}}): - raise ValueError("Invalid value for `{{name}}`, number of items must be greater than or equal to `{{minItems}}`") # noqa: E501 -{{/minItems}} -{{/hasValidation}} -{{/isEnum}} - - self._{{name}} = {{name}} - -{{/vars}} -{{#discriminator}} - def get_real_child_model(self, data): - """Returns the real base class specified by the discriminator""" - discriminator_value = data[self.discriminator].lower() - return self.discriminator_value_class_map.get(discriminator_value) - -{{/discriminator}} -{{/model}} -{{/models}} diff --git a/template/model_doc.mustache b/template/model_doc.mustache index c966975a..2bdee459 100644 --- a/template/model_doc.mustache +++ b/template/model_doc.mustache @@ -3,14 +3,21 @@ {{{.}}} {{/unescapedDescription}} +{{^isEnum}} {{^emptyVars}} - ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{datatype}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{datatype}}**]({{complexType}}.md){{/isPrimitiveType}} | {{{description}}} | {{^required}}[optional] {{/required}}{{#readOnly}}[readonly] {{/readOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} +{{#vars}}**{{name}}** | {{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}[**{{dataType}}**]({{complexType}}.md){{/isPrimitiveType}} | {{description}} | {{^required}}[optional] {{/required}}{{#isReadOnly}}[readonly] {{/isReadOnly}}{{#defaultValue}}[default to {{{.}}}]{{/defaultValue}} {{/vars}} +{{/emptyVars}} +{{/isEnum}} +{{#isEnum}} +## Enum +{{#allowableValues}}{{#enumVars}} +* `{{name}}` (value: `{{{value}}}`){{/enumVars}}{{/allowableValues}} +{{/isEnum}} [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) -{{/emptyVars}}{{/model}}{{/models}} +{{/model}}{{/models}} \ No newline at end of file diff --git a/template/pyproject.mustache b/template/pyproject.mustache new file mode 100644 index 00000000..9c1be36a --- /dev/null +++ b/template/pyproject.mustache @@ -0,0 +1,157 @@ +{{#poetry1}} +[tool.poetry] +{{/poetry1}} +{{^poetry1}} +[project] +{{/poetry1}} +name = "{{{packageName}}}" +version = "{{{packageVersion}}}" +description = "{{{appDescription}}}" +{{#poetry1}} +authors = ["{{infoName}}{{^infoName}}OpenAPI Generator Community{{/infoName}} <{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}>"] +{{/poetry1}} +{{^poetry1}} +authors = [ + {name = "{{infoName}}{{^infoName}}OpenAPI Generator Community{{/infoName}}",email = "{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}"}, +] +{{/poetry1}} +{{#licenseInfo}} +{{#poetry1}} +license = "{{{licenseInfo}}}" +{{/poetry1}} +{{^poetry1}} +license = { text = "{{{licenseInfo}}}" } +{{/poetry1}} +{{/licenseInfo}} +readme = "README.md" +{{#poetry1}} +repository = "https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}" +{{/poetry1}} +keywords = ["OpenAPI", "OpenAPI-Generator", "{{{appName}}}"] +{{#poetry1}} +include = ["{{packageName}}/py.typed"] + +[tool.poetry.dependencies] +python = "^3.9" +{{^async}} +urllib3 = ">= 2.1.0, < 3.0.0" +{{/async}} +python-dateutil = ">= 2.8.2" +{{#asyncio}} +aiohttp = ">= 3.8.4" +aiohttp-retry = ">= 2.8.3" +{{/asyncio}} +{{#httpx}} +httpx = ">= 0.28.1" +{{/httpx}} +{{#tornado}} +tornado = ">=4.2, <5" +{{/tornado}} +{{#hasHttpSignatureMethods}} +pem = ">= 19.3.0" +pycryptodome = ">= 3.9.0" +{{/hasHttpSignatureMethods}} +pydantic = ">= 2" +typing-extensions = ">= 4.7.1" +{{#lazyImports}} +lazy-imports = ">= 1, < 2" +{{/lazyImports}} +cryptography = ">= 41.0.0" +python-dotenv = ">= 1.0.0" +{{/poetry1}} +{{^poetry1}} +requires-python = ">=3.9" + +dependencies = [ +{{^async}} + "urllib3 (>=2.1.0,<3.0.0)", +{{/async}} + "python-dateutil (>=2.8.2)", +{{#httpx}} + "httpx (>=0.28.1)", +{{/httpx}} +{{#asyncio}} + "aiohttp (>=3.8.4)", + "aiohttp-retry (>=2.8.3)", +{{/asyncio}} +{{#tornado}} + "tornado (>=4.2,<5)", +{{/tornado}} +{{#hasHttpSignatureMethods}} + "pem (>=19.3.0)", + "pycryptodome (>=3.9.0)", +{{/hasHttpSignatureMethods}} + "pydantic (>=2)", + "typing-extensions (>=4.7.1)", +{{#lazyImports}} + "lazy-imports (>=1,<2)" +{{/lazyImports}} + "cryptography" +] + +[project.urls] +Repository = "https://{{{gitHost}}}/{{{gitUserId}}}/{{{gitRepoId}}}" + +{{/poetry1}} +{{^poetry1}} +[tool.poetry] +requires-poetry = ">=2.0" +{{/poetry1}} + +{{#poetry1}} +[tool.poetry.dev-dependencies] +{{/poetry1}} +{{^poetry1}} +[tool.poetry.group.dev.dependencies] +{{/poetry1}} +pytest = ">= 7.2.1" +pytest-cov = ">= 2.8.1" +tox = ">= 3.9.0" +flake8 = ">= 4.0.0" +types-python-dateutil = ">= 2.8.19.14" +mypy = ">= 1.5" +python-dotenv = ">= 1.0.0" + + +[build-system] +requires = ["setuptools"] +build-backend = "setuptools.build_meta" + +[tool.pylint.'MESSAGES CONTROL'] +extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "{{{packageName}}}", + "test", +] + +strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true +strict_equality = true +extra_checks = true +check_untyped_defs = true +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +[[tool.mypy.overrides]] +module = [ + "{{{packageName}}}.configuration", +] +warn_unused_ignores = true +strict_equality = true +extra_checks = true +check_untyped_defs = true +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true +disallow_untyped_calls = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +no_implicit_reexport = true +warn_return_any = true \ No newline at end of file diff --git a/template/python_doc_auth_partial.mustache b/template/python_doc_auth_partial.mustache new file mode 100644 index 00000000..74dee247 --- /dev/null +++ b/template/python_doc_auth_partial.mustache @@ -0,0 +1,5 @@ +# Configure API key authorization and region +configuration = {{{packageName}}}.Configuration( + api_key = os.environ["SECRET_API_KEY"], + region = Region.US +) \ No newline at end of file diff --git a/template/requirements.mustache b/template/requirements.mustache new file mode 100644 index 00000000..68803f2f --- /dev/null +++ b/template/requirements.mustache @@ -0,0 +1,24 @@ +{{^async}} +urllib3 >= 2.1.0, < 3.0.0 +{{/async}} +python_dateutil >= 2.8.2 +{{#asyncio}} +aiohttp >= 3.8.4 +aiohttp-retry >= 2.8.3 +{{/asyncio}} +{{#httpx}} +httpx = ">= 0.28.1" +{{/httpx}} +{{#tornado}} +tornado = ">= 4.2, < 5" +{{/tornado}} +{{#hasHttpSignatureMethods}} +pem >= 19.3.0 +pycryptodome >= 3.9.0 +{{/hasHttpSignatureMethods}} +pydantic >= 2 +typing-extensions >= 4.7.1 +{{#lazyImports}} +lazy-imports >= 1, < 2 +{{/lazyImports}} +cryptography >= 41.0.0 \ No newline at end of file diff --git a/template/rest.mustache b/template/rest.mustache deleted file mode 100644 index 4da8733c..00000000 --- a/template/rest.mustache +++ /dev/null @@ -1,254 +0,0 @@ -# coding: utf-8 - -{{>partial_header}} - -import io -import json -import logging -import re -import ssl -import certifi - -from typing import Optional, Dict, List, Tuple, Any -from urllib.parse import urlencode - -from fingerprint_server_sdk.configuration import Configuration - -try: - import urllib3 -except ImportError: - raise ImportError('Swagger python client requires urllib3.') - - -logger = logging.getLogger(__name__) - - -class RESTResponse(io.IOBase): - - def __init__(self, resp: urllib3.HTTPResponse): - self.urllib3_response = resp - self.status = resp.status - self.reason = resp.reason - self.data = resp.data - - def getheaders(self): - """Returns a dictionary of the response headers.""" - return self.urllib3_response.headers - - def getheader(self, name, default=None): - """Returns a given response header.""" - return self.urllib3_response.headers.get(name, default) - - -class RESTClientObject: - - def __init__(self, configuration: Configuration, pools_size: int = 4, maxsize: int = None): - # urllib3.PoolManager will pass all kw parameters to connectionpool - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 - # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 - # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 - - # cert_reqs - if configuration.verify_ssl: - cert_reqs = ssl.CERT_REQUIRED - else: - cert_reqs = ssl.CERT_NONE - - # ca_certs - if configuration.ssl_ca_cert: - ca_certs = configuration.ssl_ca_cert - else: - # if not set certificate file, use Mozilla's root certificates. - ca_certs = certifi.where() - - addition_pool_args = {} - if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 - - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 - - # https pool manager - if configuration.proxy: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - **addition_pool_args - ) - else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=ca_certs, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method: str, url: str, query_params: Optional[List[Tuple[str, Any]]] = None, - headers: Optional[Dict[str, Any]] = None, body: Any = None, - post_params: Optional[List[Tuple[str, Any]]] = None, - _preload_content: bool = True, _request_timeout: Optional[int] = None): - """Perform requests. - - :param method: http request method - :param url: http request url - :param query_params: query parameters in the url - :param headers: http request headers - :param body: request json body, for `application/json` - :param post_params: request post parameters, - `application/x-www-form-urlencoded` - and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - """ - method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] - - if post_params and body: - raise ValueError( - "body parameter cannot be used with post_params parameter." - ) - - post_params = post_params or {} - headers = headers or {} - - timeout = None - if _request_timeout: - if isinstance(_request_timeout, int): - timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): - timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) - - if 'Content-Type' not in headers: - headers['Content-Type'] = 'application/json' - - try: - # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` - if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: - if query_params: - url += '?' + urlencode(query_params) - if re.search('json', headers['Content-Type'], re.IGNORECASE): - request_body = '{}' - if body is not None: - request_body = json.dumps(body) - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=False, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': - # must del headers['Content-Type'], or the correct - # Content-Type which generated by urllib3 will be - # overwritten. - del headers['Content-Type'] - r = self.pool_manager.request( - method, url, - fields=post_params, - encode_multipart=True, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form - elif isinstance(body, str): - request_body = body - r = self.pool_manager.request( - method, url, - body=request_body, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - else: - # Cannot generate the request from given parameters - msg = """Cannot prepare a request message for provided - arguments. Please check that your arguments match - declared content type.""" - raise ApiException(status=0, reason=msg) - # For `GET`, `HEAD` - else: - r = self.pool_manager.request(method, url, - fields=query_params, - preload_content=_preload_content, - timeout=timeout, - headers=headers) - except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) - raise ApiException(status=0, reason=msg) - - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - raise ApiException(http_resp=r) - - return r - - -class ApiException(Exception): - - def __init__(self, status: Optional[int] = None, reason: Optional[str] = None, - http_resp: Optional[RESTResponse] = None): - if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data - self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None - - def __str__(self) -> str: - """Custom error messages for exception""" - error_message = "({0})\n"\ - "Reason: {1}\n".format(self.status, self.reason) - if self.headers: - error_message += "HTTP response headers: {0}\n".format( - self.headers) - - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) - - return error_message - - -class KnownApiException(ApiException): - - def __init__(self, original_exception: ApiException, structured_error: Any): - super(KnownApiException, self).__init__(status=original_exception.status, reason=original_exception.reason) - self.headers = original_exception.headers - self.body = original_exception.body - self.structured_error = structured_error diff --git a/template/sealed.py.mustache b/template/sealed.py.mustache new file mode 100644 index 00000000..dd25bd56 --- /dev/null +++ b/template/sealed.py.mustache @@ -0,0 +1,101 @@ +import json +from typing import List + +from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes +from cryptography.hazmat.backends import default_backend +import zlib + +from {{packageName}}.models.event import Event + +SEALED_HEADER = bytes([0x9e, 0x85, 0xdc, 0xed]) +DecryptionAlgorithm = { + 'Aes256Gcm': 'aes-256-gcm', +} + + +class DecryptionKey: + """Key for decryption of sealed data.""" + exception: Exception + algorithm: str + + def __init__(self, key: bytes, algorithm: str): + self.key = key + self.algorithm = algorithm + + +class UnsealError(Exception): + """Error during unsealing.""" + exception: Exception + key: DecryptionKey + + def __init__(self, exception: Exception, key: DecryptionKey): + self.exception = exception + self.key = key + + +class UnsealAggregateError(Exception): + """Aggregated error during unsealing.""" + errors: List[UnsealError] + + def __init__(self, errors: List[UnsealError]): + self.errors = errors + super().__init__("Unable to decrypt sealed data") + + +def unseal_event_response(sealed_data: bytes, decryption_keys: List[DecryptionKey]) -> Event: + """Unseal event response with one of the provided keys.""" + unsealed = __unseal(sealed_data, decryption_keys) + return __parse_event_response(unsealed) + + +def __parse_event_response(unsealed: str) -> Event: + """Parse event response from unsealed data.""" + json_data = json.loads(unsealed) + + if 'event_id' not in json_data: + raise ValueError('Sealed data is not valid event response') + + result: Event = Event.from_dict(json_data) + return result + + +def __unseal(sealed_data: bytes, decryption_keys: List[DecryptionKey]) -> str: + """Unseal data with one of the provided keys.""" + if sealed_data[:len(SEALED_HEADER)].hex() != SEALED_HEADER.hex(): + raise ValueError('Invalid sealed data header') + + errors = [] + for decryption_key in decryption_keys: + if decryption_key.algorithm == DecryptionAlgorithm['Aes256Gcm']: + try: + return __unseal_aes256gcm(sealed_data, decryption_key.key) + except Exception as e: + errors.append(UnsealError(e, decryption_key)) + continue + else: + raise ValueError(f"Unsupported decryption algorithm: {decryption_key.algorithm}") + + raise UnsealAggregateError(errors) + + +def __unseal_aes256gcm(sealed_data: bytes, decryption_key: bytes) -> str: + """Unseal data with AES-256-GCM.""" + nonce_length = 12 + nonce = sealed_data[len(SEALED_HEADER):len(SEALED_HEADER) + nonce_length] + + auth_tag_length = 16 + auth_tag = sealed_data[-auth_tag_length:] + + ciphertext = sealed_data[len(SEALED_HEADER) + nonce_length:-auth_tag_length] + + decipher = Cipher( + algorithms.AES(decryption_key), + modes.GCM(nonce, auth_tag), + backend=default_backend() + ).decryptor() + + compressed = decipher.update(ciphertext) + decipher.finalize() + + payload = zlib.decompress(compressed, -zlib.MAX_WBITS) + + return payload.decode('utf-8') diff --git a/template/setup.mustache b/template/setup.mustache index 8cfeb156..8e8b3407 100644 --- a/template/setup.mustache +++ b/template/setup.mustache @@ -2,61 +2,73 @@ {{>partial_header}} + import pathlib import re from setuptools import setup, find_packages # noqa: H301 NAME = "{{{projectName}}}" -{{#apiInfo}} -{{#apis}} -{{^hasMore}} +VERSION = "{{packageVersion}}" +PYTHON_REQUIRES = ">= 3.9" # To install the library, run the following # # python setup.py install # # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools - REQUIRES = [ - "certifi>=2023.7.22", - "python-dateutil>=2.5.3", - "urllib3>=1.23", - "cryptography", - "typing_extensions>=4.5" -] - +{{^async}} + "urllib3 >= 2.1.0, < 3.0.0", +{{/async}} + "python-dateutil >= 2.8.2", {{#asyncio}} -REQUIRES.append("aiohttp") + "aiohttp >= 3.8.4", + "aiohttp-retry >= 2.8.3", {{/asyncio}} +{{#httpx}} + "httpx >= 0.28.1", +{{/httpx}} {{#tornado}} -REQUIRES.append("tornado") + "tornado>=4.2, < 5", {{/tornado}} +{{#hasHttpSignatureMethods}} + "pem >= 19.3.0", + "pycryptodome >= 3.9.0", +{{/hasHttpSignatureMethods}} + "pydantic >= 2", + "typing-extensions >= 4.7.1", +{{#lazyImports}} + "lazy-imports >= 1, < 2", +{{/lazyImports}} + "cryptography", +] here = pathlib.Path(__file__).parent.resolve() long_description = (here / 'README.md').read_text(encoding='utf-8') long_description = re.sub("]*>\n", '', long_description.replace("\n", "").replace("\n", "")) -long_description = re.sub(r"(?P\[[^]]*]\()(?Pdocs/[^)]*\))", '\ghttps://github.com/{{{gitUserId}}}/{{{gitRepoId}}}/blob/main/\g', long_description) +long_description = re.sub(r"(?P\[[^]]*]\()(?Pdocs/[^)]*\))", '\g{{packageUrl}}/blob/main/\g', long_description) setup( name=NAME, - description="{{{appDescription}}}", + version=VERSION, + description="{{packageDescription}}", long_description=long_description, long_description_content_type='text/markdown', - license="MIT", + {{#licenseInfo}}license="{{.}}", license_files=["LICENSE"], - author="Fingerprint", - author_email="{{infoEmail}}", + {{/licenseInfo}}author="{{infoName}}{{^infoName}}OpenAPI Generator community{{/infoName}}", + author_email="{{infoEmail}}{{^infoEmail}}team@openapitools.org{{/infoEmail}}", project_urls={ - "Changelog": "https://github.com/fingerprintjs/python-sdk/blob/main/CHANGELOG.md", - "Code": "https://github.com/fingerprintjs/python-sdk", - "Issue Tracker": "https://github.com/fingerprintjs/python-sdk/issues", + "Changelog": "{{packageUrl}}/blob/main/CHANGELOG.md", + "Code": "{{packageUrl}}", + "Issue Tracker": "{{packageUrl}}/issues", }, - keywords=["Swagger", "{{appName}}", "browser", "detection", "fingerprint", "identification", + keywords=["Fingerprint Server API", "browser", "detection", "fingerprint", "identification", "fingerprinting", "browser-fingerprinting", "browser-fingerprint", "fraud-detection", "fraud", "audio-fingerprinting", "fingerprintjs", "fingerprintjs-pro", "visitor-identifier"], install_requires=REQUIRES, - packages=find_packages(), + packages=find_packages(exclude=["test"]), include_package_data=True, classifiers=[ 'Development Status :: 5 - Production/Stable', @@ -71,7 +83,5 @@ setup( 'Topic :: Software Development :: Libraries :: Python Modules', 'Topic :: Security', ], -) -{{/hasMore}} -{{/apis}} -{{/apiInfo}} + package_data={"{{{packageName}}}": ["py.typed"]}, +) \ No newline at end of file diff --git a/template/test-requirements.mustache b/template/test-requirements.mustache new file mode 100644 index 00000000..1163d4c8 --- /dev/null +++ b/template/test-requirements.mustache @@ -0,0 +1,7 @@ +pytest >= 7.2.1 +pytest-cov >= 2.8.1 +tox >= 3.9.0 +flake8 >= 4.0.0 +types-python-dateutil >= 2.8.19.14 +mypy >= 1.5 +python-dotenv >= 1.0.0 \ No newline at end of file diff --git a/template/webhook_validation.py b/template/webhook_validation.py new file mode 100644 index 00000000..cf684f09 --- /dev/null +++ b/template/webhook_validation.py @@ -0,0 +1,30 @@ +import hmac +import hashlib + + +class WebhookValidation: + """Manages work with webhooks.""" + @staticmethod + def is_valid_hmac_signature(signature: str, data: bytes, secret: str) -> bool: + """Validates an HMAC signature.""" + hmac_instance = hmac.new(secret.encode('utf-8'), data, hashlib.sha256) + computed_hash = hmac_instance.hexdigest() + return signature == computed_hash + + @staticmethod + def is_valid_webhook_signature(header: str, data: bytes, secret: str) -> bool: + """Verifies the HMAC signature extracted from the "fpjs-event-signature" header of the incoming request. + This is a part of the webhook signing process, which is available only for enterprise customers. + If you wish to enable it, please contact our support: https://fingerprint.com/support""" + + signatures = header.split(',') + + for signature in signatures: + parts = signature.split('=') + if len(parts) == 2: + version, hash_value = parts + if version == "v1" and WebhookValidation.is_valid_hmac_signature(hash_value, data, secret): + return True + + return False + diff --git a/test-requirements.txt b/test-requirements.txt index 5a12a255..1163d4c8 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,5 +1,7 @@ -coverage>=4.0.3 -pytest -pluggy>=0.3.1 -py>=1.4.31 -randomize>=0.13 +pytest >= 7.2.1 +pytest-cov >= 2.8.1 +tox >= 3.9.0 +flake8 >= 4.0.0 +types-python-dateutil >= 2.8.19.14 +mypy >= 1.5 +python-dotenv >= 1.0.0 \ No newline at end of file diff --git a/test/mock_pool_manager.py b/test/mock_pool_manager.py new file mode 100644 index 00000000..e374bdc3 --- /dev/null +++ b/test/mock_pool_manager.py @@ -0,0 +1,69 @@ +from collections import Counter +from pathlib import Path +from urllib.parse import urlsplit, parse_qsl, urlunsplit, urlencode +from fingerprint_server_sdk import __version__ + +import urllib3 + +MOCK_SEARCH_EVENTS_200 = 'events/get_event_200.json' + + +class MockPoolManager(object): + + def __init__(self, tc, request_headers=None): + self.request_headers = request_headers + self._tc = tc + self._reqs = [] + self.request_headers = request_headers + + def expect_request(self, *args, **kwargs): + self._reqs.append((args, kwargs)) + + @staticmethod + def get_mock_from_path(path): + return path.split('/')[-1] + + def request(self, *args, **kwargs): + self._tc.assertTrue(len(self._reqs) > 0) + (request_method, request_url), request_config = self._reqs.pop(0) + + response_status_code = request_config.pop('response_status_code', 200) + response_data_file = request_config.pop('response_data_file', None) + response_text = request_config.pop('response_text', None) + response_headers = request_config.pop('response_headers', None) + + self._tc.maxDiff = None + self._tc.assertEqual(request_method, args[0]) + + url, ii_value = self._strip_query_param(args[1], "ii") + self._tc.assertIsInstance(ii_value, str) + self._tc.assertEqual(f"fingerprint-server-python-sdk/{__version__}", ii_value) + self._tc.assertEqual(request_url, url) + + self._tc.assertEqual(set(request_config.keys()), set(kwargs.keys())) + + if 'fields' in kwargs and 'fields' in request_config: + self._tc.assertEqual(Counter(kwargs['fields']), Counter(request_config['fields'])) + + response_body = None + if response_text is not None: + response_body = response_text.encode('utf-8') + elif response_data_file is not None: + if not isinstance(response_data_file, Path) and not isinstance(response_data_file, str): + raise TypeError('response_data_file must be str or Path') + base_dir = Path(__file__).resolve().parent / 'mocks' + mock_file_path = base_dir / response_data_file + with mock_file_path.open('r', encoding='utf-8') as mock_file: + response_body = mock_file.read().encode('utf-8') + + return urllib3.HTTPResponse(status=response_status_code, body=response_body, headers=response_headers) + + @staticmethod + def _strip_query_param(url: str, name: str): + s = urlsplit(url) + pairs = parse_qsl(s.query, keep_blank_values=True) + values = [v for k, v in pairs if k == name] + kept = [(k, v) for k, v in pairs if k != name] + new_query = urlencode(kept, doseq=True) + new_url = urlunsplit((s.scheme, s.netloc, s.path, new_query, s.fragment)) + return new_url, (values[0] if values else None) \ No newline at end of file diff --git a/test/mocks/errors/400_bot_type_invalid.json b/test/mocks/errors/400_bot_type_invalid.json deleted file mode 100644 index 8dd65266..00000000 --- a/test/mocks/errors/400_bot_type_invalid.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "invalid bot type" - } -} diff --git a/test/mocks/errors/400_end_time_invalid.json b/test/mocks/errors/400_end_time_invalid.json deleted file mode 100644 index 88654093..00000000 --- a/test/mocks/errors/400_end_time_invalid.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "invalid end time" - } -} \ No newline at end of file diff --git a/test/mocks/errors/400_event_id_invalid.json b/test/mocks/errors/400_event_id_invalid.json new file mode 100644 index 00000000..5c43577e --- /dev/null +++ b/test/mocks/errors/400_event_id_invalid.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "request_cannot_be_parsed", + "message": "invalid event_id" + } +} diff --git a/test/mocks/errors/400_ip_address_invalid.json b/test/mocks/errors/400_ip_address_invalid.json deleted file mode 100644 index 5969bab6..00000000 --- a/test/mocks/errors/400_ip_address_invalid.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "invalid ip address" - } -} \ No newline at end of file diff --git a/test/mocks/errors/400_limit_invalid.json b/test/mocks/errors/400_limit_invalid.json deleted file mode 100644 index 46297eb4..00000000 --- a/test/mocks/errors/400_limit_invalid.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "invalid limit" - } -} diff --git a/test/mocks/errors/400_linked_id_invalid.json b/test/mocks/errors/400_linked_id_invalid.json deleted file mode 100644 index 72de54e0..00000000 --- a/test/mocks/errors/400_linked_id_invalid.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "linked_id can't be greater than 256 characters long" - } -} diff --git a/test/mocks/errors/400_pagination_key_invalid.json b/test/mocks/errors/400_pagination_key_invalid.json deleted file mode 100644 index df559f9a..00000000 --- a/test/mocks/errors/400_pagination_key_invalid.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "invalid pagination key" - } -} diff --git a/test/mocks/errors/400_request_body_invalid.json b/test/mocks/errors/400_request_body_invalid.json index ce56deff..c71fae96 100644 --- a/test/mocks/errors/400_request_body_invalid.json +++ b/test/mocks/errors/400_request_body_invalid.json @@ -1,6 +1,6 @@ { "error": { - "code": "RequestCannotBeParsed", + "code": "request_cannot_be_parsed", "message": "request body is not valid" } } diff --git a/test/mocks/errors/400_reverse_invalid.json b/test/mocks/errors/400_reverse_invalid.json deleted file mode 100644 index 540800fa..00000000 --- a/test/mocks/errors/400_reverse_invalid.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "invalid reverse param" - } -} diff --git a/test/mocks/errors/400_start_time_invalid.json b/test/mocks/errors/400_start_time_invalid.json deleted file mode 100644 index 5d93f929..00000000 --- a/test/mocks/errors/400_start_time_invalid.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "invalid start time" - } -} \ No newline at end of file diff --git a/test/mocks/errors/400_visitor_id_invalid.json b/test/mocks/errors/400_visitor_id_invalid.json index c204c568..ae7a3596 100644 --- a/test/mocks/errors/400_visitor_id_invalid.json +++ b/test/mocks/errors/400_visitor_id_invalid.json @@ -1,6 +1,6 @@ { "error": { - "code": "RequestCannotBeParsed", + "code": "request_cannot_be_parsed", "message": "invalid visitor id" } } diff --git a/test/mocks/errors/400_visitor_id_required.json b/test/mocks/errors/400_visitor_id_required.json deleted file mode 100644 index 6c5801a0..00000000 --- a/test/mocks/errors/400_visitor_id_required.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestCannotBeParsed", - "message": "visitor id is required" - } -} diff --git a/test/mocks/errors/403_feature_not_enabled.json b/test/mocks/errors/403_feature_not_enabled.json index 9820a568..1478d51d 100644 --- a/test/mocks/errors/403_feature_not_enabled.json +++ b/test/mocks/errors/403_feature_not_enabled.json @@ -1,6 +1,6 @@ { "error": { - "code": "FeatureNotEnabled", + "code": "feature_not_enabled", "message": "feature not enabled" } } diff --git a/test/mocks/errors/403_secret_api_key_required.json b/test/mocks/errors/403_secret_api_key_required.json new file mode 100644 index 00000000..9ed2f958 --- /dev/null +++ b/test/mocks/errors/403_secret_api_key_required.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "secret_api_key_required", + "message": "secret API key in header is missing or empty" + } +} diff --git a/test/mocks/errors/403_subscription_not_active.json b/test/mocks/errors/403_subscription_not_active.json deleted file mode 100644 index 3deac898..00000000 --- a/test/mocks/errors/403_subscription_not_active.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "SubscriptionNotActive", - "message": "forbidden" - } -} diff --git a/test/mocks/errors/403_token_not_found.json b/test/mocks/errors/403_token_not_found.json deleted file mode 100644 index 3936b530..00000000 --- a/test/mocks/errors/403_token_not_found.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "TokenNotFound", - "message": "secret key is not found" - } -} diff --git a/test/mocks/errors/403_token_required.json b/test/mocks/errors/403_token_required.json deleted file mode 100644 index 544d8714..00000000 --- a/test/mocks/errors/403_token_required.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "TokenRequired", - "message": "secret key is required" - } -} diff --git a/test/mocks/errors/403_wrong_region.json b/test/mocks/errors/403_wrong_region.json deleted file mode 100644 index 8acc9e01..00000000 --- a/test/mocks/errors/403_wrong_region.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "WrongRegion", - "message": "wrong region" - } -} diff --git a/test/mocks/errors/404_event_not_found.json b/test/mocks/errors/404_event_not_found.json new file mode 100644 index 00000000..f7f7e542 --- /dev/null +++ b/test/mocks/errors/404_event_not_found.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "event_not_found", + "message": "event id not found" + } +} diff --git a/test/mocks/errors/404_request_not_found.json b/test/mocks/errors/404_request_not_found.json deleted file mode 100644 index 389b351c..00000000 --- a/test/mocks/errors/404_request_not_found.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "error": { - "code": "RequestNotFound", - "message": "request id is not found" - } -} diff --git a/test/mocks/errors/404_visitor_not_found.json b/test/mocks/errors/404_visitor_not_found.json index 11da4f3d..e4076f4f 100644 --- a/test/mocks/errors/404_visitor_not_found.json +++ b/test/mocks/errors/404_visitor_not_found.json @@ -1,6 +1,6 @@ { "error": { - "code": "VisitorNotFound", + "code": "visitor_not_found", "message": "visitor not found" } } diff --git a/test/mocks/errors/409_state_not_ready.json b/test/mocks/errors/409_state_not_ready.json index 36e6dde3..4ba3ac53 100644 --- a/test/mocks/errors/409_state_not_ready.json +++ b/test/mocks/errors/409_state_not_ready.json @@ -1,6 +1,6 @@ { "error": { - "code": "StateNotReady", + "code": "state_not_ready", "message": "resource is not mutable yet, try again" } } diff --git a/test/mocks/errors/429_too_many_requests.json b/test/mocks/errors/429_too_many_requests.json index e38639aa..bbbc7c41 100644 --- a/test/mocks/errors/429_too_many_requests.json +++ b/test/mocks/errors/429_too_many_requests.json @@ -1,6 +1,6 @@ { "error": { - "code": "TooManyRequests", + "code": "too_many_requests", "message": "too many requests" } } diff --git a/test/mocks/events/get_event_200.json b/test/mocks/events/get_event_200.json new file mode 100644 index 00000000..8985aa0e --- /dev/null +++ b/test/mocks/events/get_event_200.json @@ -0,0 +1,282 @@ +{ + "linked_id": "somelinkedId", + "tags": {}, + "timestamp": 1708102555327, + "event_id": "1708102555327.NLOjmg", + "url": "https://www.example.com/login?hope{this{works[!", + "ip_address": "61.127.217.15", + "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....", + "client_referrer": "https://example.com/blog/my-article", + "browser_details": { + "browser_name": "Chrome", + "browser_major_version": "74", + "browser_full_version": "74.0.3729", + "os": "Windows", + "os_version": "7", + "device": "Other" + }, + "identification": { + "visitor_id": "Ibk1527CUFmcnjLwIs4A9", + "confidence": { + "score": 0.97, + "version": "1.1" + }, + "visitor_found": false, + "first_seen_at": 1708102555327, + "last_seen_at": 1708102555327 + }, + "supplementary_id_high_recall": { + "visitor_id": "3HNey93AkBW6CRbxV6xP", + "visitor_found": true, + "confidence": { + "score": 0.97, + "version": "1.1" + }, + "first_seen_at": 1708102555327, + "last_seen_at": 1708102555327 + }, + "proximity": { + "id": "w1aTfd4MCvl", + "precision_radius": 10, + "confidence": 0.95 + }, + "bot": "not_detected", + "root_apps": false, + "emulator": false, + "ip_info": { + "v4": { + "address": "94.142.239.124", + "geolocation": { + "accuracy_radius": 20, + "latitude": 50.05, + "longitude": 14.4, + "postal_code": "150 00", + "timezone": "Europe/Prague", + "city_name": "Prague", + "country_code": "CZ", + "country_name": "Czechia", + "continent_code": "EU", + "continent_name": "Europe", + "subdivisions": [ + { + "iso_code": "10", + "name": "Hlavni mesto Praha" + } + ] + }, + "asn": "7922", + "asn_name": "COMCAST-7922", + "asn_network": "73.136.0.0/13", + "asn_type": "isp", + "datacenter_result": true, + "datacenter_name": "DediPath" + }, + "v6": { + "address": "2001:db8:3333:4444:5555:6666:7777:8888", + "geolocation": { + "accuracy_radius": 5, + "latitude": 49.982, + "longitude": 36.2566, + "postal_code": "10112", + "timezone": "Europe/Berlin", + "city_name": "Berlin", + "country_code": "DE", + "country_name": "Germany", + "continent_code": "EU", + "continent_name": "Europe", + "subdivisions": [ + { + "iso_code": "BE", + "name": "Land Berlin" + } + ] + }, + "asn": "6805", + "asn_name": "Telefonica Germany", + "asn_network": "2a02:3100::/24", + "asn_type": "isp", + "datacenter_result": false, + "datacenter_name": "" + } + }, + "ip_blocklist": { + "email_spam": false, + "attack_source": false, + "tor_node": false + }, + "proxy": true, + "proxy_confidence": "low", + "proxy_details": { + "proxy_type": "residential", + "last_seen_at": 1708102555327, + "provider": "Massive" + }, + "vpn": false, + "vpn_confidence": "high", + "vpn_origin_timezone": "Europe/Berlin", + "vpn_origin_country": "unknown", + "vpn_methods": { + "timezone_mismatch": false, + "public_vpn": false, + "auxiliary_mobile": false, + "os_mismatch": false, + "relay": false + }, + "incognito": false, + "tampering": false, + "tampering_details": { + "anomaly_score": 0.1955, + "anti_detect_browser": false + }, + "cloned_app": false, + "factory_reset_timestamp": 0, + "jailbroken": false, + "frida": false, + "privacy_settings": false, + "virtual_machine": false, + "location_spoofing": false, + "velocity": { + "distinct_ip": { + "5_minutes": 1, + "1_hour": 1, + "24_hours": 1 + }, + "distinct_country": { + "5_minutes": 1, + "1_hour": 2, + "24_hours": 2 + }, + "events": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "ip_events": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "distinct_ip_by_linked_id": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "distinct_visitor_id_by_linked_id": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + } + }, + "developer_tools": false, + "mitm_attack": false, + "sdk": { + "platform": "js", + "version": "3.11.10", + "integrations": [ + { + "name": "fingerprint-pro-react", + "version": "3.11.10", + "subintegration": { + "name": "preact", + "version": "10.21.0" + } + } + ] + }, + "replayed": false, + "high_activity_device": false, + "raw_device_attributes": { + "math": "5f030fa7d2e5f9f757bfaf81642eb1a6", + "vendor": "Google Inc.", + "plugins": [ + { + "description": "Portable Document Format", + "mimeTypes": [ + { + "suffixes": "pdf", + "type": "application/pdf" + }, + { + "suffixes": "pdf", + "type": "text/pdf" + } + ], + "name": "PDF Viewer" + } + ], + "webgl_extensions": { + "context_attributes": "6b1ed336830d2bc96442a9d76373252a", + "extension_parameters": "86a8abb36f0cb30b5946dec0c761d042", + "extensions": "57233d7b10f89fcd1ff95e3837ccd72d", + "parameters": "ea118c48e308bc4b0677118bbb3019ec", + "shader_precisions": "f223dfbcd580cf142da156d93790eb83", + "unsupported_extensions": [] + }, + "cookies_enabled": true, + "webgl_basics": { + "renderer": "WebKit WebGL", + "renderer_unmasked": "ANGLE (Apple, ANGLE Metal Renderer: Apple M4, Unspecified Version)", + "shading_language_version": "WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)", + "vendor": "WebKit", + "vendor_unmasked": "Google Inc. (Apple)", + "version": "WebGL 1.0 (OpenGL ES 2.0 Chromium)" + }, + "canvas": { + "geometry": "db3c1462576a399a03ae93d0ab9eb5c4", + "text": "70c3d3f7eb4408dc37a6bf8af1c51029", + "winding": true + }, + "hardware_concurrency": 10, + "languages": [ + [ + "en-US" + ] + ], + "color_depth": 24, + "fonts": [ + "Arial Unicode MS", + "Gill Sans", + "Helvetica Neue", + "Menlo" + ], + "indexed_db": true, + "touch_support": { + "max_touch_points": 0, + "touch_event": false, + "touch_start": false + }, + "device_memory": 8, + "oscpu": "Windows NT 6.1; Win64; x64", + "architecture": 127, + "screen_resolution": [ + 1920, + 1080 + ], + "timezone": "America/Sao_Paulo", + "emoji": { + "bottom": 32, + "font": "Times", + "height": 18, + "left": 8, + "right": 1608, + "top": 14, + "width": 1600, + "x": 8, + "y": 14 + }, + "font_preferences": { + "apple": 147.5625, + "default": 147.5625, + "min": 9.234375, + "mono": 133.0625, + "sans": 144.015625, + "serif": 147.5625, + "system": 146.09375 + }, + "platform": "MacIntel", + "local_storage": true, + "session_storage": true, + "date_time_locale": "en-US", + "audio": 124.04347745512496 + } +} \ No newline at end of file diff --git a/test/mocks/events/get_event_ruleset_200.json b/test/mocks/events/get_event_ruleset_200.json new file mode 100644 index 00000000..b02bfb2d --- /dev/null +++ b/test/mocks/events/get_event_ruleset_200.json @@ -0,0 +1,296 @@ +{ + "linked_id": "somelinkedId", + "tags": {}, + "timestamp": 1708102555327, + "event_id": "1708102555327.NLOjmg", + "url": "https://www.example.com/login?hope{this{works[!", + "ip_address": "61.127.217.15", + "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....", + "client_referrer": "https://example.com/blog/my-article", + "browser_details": { + "browser_name": "Chrome", + "browser_major_version": "74", + "browser_full_version": "74.0.3729", + "os": "Windows", + "os_version": "7", + "device": "Other" + }, + "identification": { + "visitor_id": "Ibk1527CUFmcnjLwIs4A9", + "confidence": { + "score": 0.97, + "version": "1.1" + }, + "visitor_found": false, + "first_seen_at": 1708102555327, + "last_seen_at": 1708102555327 + }, + "supplementary_id_high_recall": { + "visitor_id": "3HNey93AkBW6CRbxV6xP", + "visitor_found": true, + "confidence": { + "score": 0.97, + "version": "1.1" + }, + "first_seen_at": 1708102555327, + "last_seen_at": 1708102555327 + }, + "proximity": { + "id": "w1aTfd4MCvl", + "precision_radius": 10, + "confidence": 0.95 + }, + "bot": "not_detected", + "root_apps": false, + "emulator": false, + "ip_info": { + "v4": { + "address": "94.142.239.124", + "geolocation": { + "accuracy_radius": 20, + "latitude": 50.05, + "longitude": 14.4, + "postal_code": "150 00", + "timezone": "Europe/Prague", + "city_name": "Prague", + "country_code": "CZ", + "country_name": "Czechia", + "continent_code": "EU", + "continent_name": "Europe", + "subdivisions": [ + { + "iso_code": "10", + "name": "Hlavni mesto Praha" + } + ] + }, + "asn": "7922", + "asn_name": "COMCAST-7922", + "asn_network": "73.136.0.0/13", + "asn_type": "isp", + "datacenter_result": true, + "datacenter_name": "DediPath" + }, + "v6": { + "address": "2001:db8:3333:4444:5555:6666:7777:8888", + "geolocation": { + "accuracy_radius": 5, + "latitude": 49.982, + "longitude": 36.2566, + "postal_code": "10112", + "timezone": "Europe/Berlin", + "city_name": "Berlin", + "country_code": "DE", + "country_name": "Germany", + "continent_code": "EU", + "continent_name": "Europe", + "subdivisions": [ + { + "iso_code": "BE", + "name": "Land Berlin" + } + ] + }, + "asn": "6805", + "asn_name": "Telefonica Germany", + "asn_network": "2a02:3100::/24", + "asn_type": "isp", + "datacenter_result": false, + "datacenter_name": "" + } + }, + "ip_blocklist": { + "email_spam": false, + "attack_source": false, + "tor_node": false + }, + "proxy": true, + "proxy_confidence": "low", + "proxy_details": { + "proxy_type": "residential", + "last_seen_at": 1708102555327, + "provider": "Massive" + }, + "vpn": false, + "vpn_confidence": "high", + "vpn_origin_timezone": "Europe/Berlin", + "vpn_origin_country": "unknown", + "vpn_methods": { + "timezone_mismatch": false, + "public_vpn": false, + "auxiliary_mobile": false, + "os_mismatch": false, + "relay": false + }, + "incognito": false, + "tampering": false, + "tampering_details": { + "anomaly_score": 0.1955, + "anti_detect_browser": false + }, + "cloned_app": false, + "factory_reset_timestamp": 0, + "jailbroken": false, + "frida": false, + "privacy_settings": false, + "virtual_machine": false, + "location_spoofing": false, + "velocity": { + "distinct_ip": { + "5_minutes": 1, + "1_hour": 1, + "24_hours": 1 + }, + "distinct_country": { + "5_minutes": 1, + "1_hour": 2, + "24_hours": 2 + }, + "events": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "ip_events": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "distinct_ip_by_linked_id": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "distinct_visitor_id_by_linked_id": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + } + }, + "developer_tools": false, + "mitm_attack": false, + "sdk": { + "platform": "js", + "version": "3.11.10", + "integrations": [ + { + "name": "fingerprint-pro-react", + "version": "3.11.10", + "subintegration": { + "name": "preact", + "version": "10.21.0" + } + } + ] + }, + "replayed": false, + "high_activity_device": false, + "raw_device_attributes": { + "math": "5f030fa7d2e5f9f757bfaf81642eb1a6", + "vendor": "Google Inc.", + "plugins": [ + { + "description": "Portable Document Format", + "mimeTypes": [ + { + "suffixes": "pdf", + "type": "application/pdf" + }, + { + "suffixes": "pdf", + "type": "text/pdf" + } + ], + "name": "PDF Viewer" + } + ], + "webgl_extensions": { + "context_attributes": "6b1ed336830d2bc96442a9d76373252a", + "extension_parameters": "86a8abb36f0cb30b5946dec0c761d042", + "extensions": "57233d7b10f89fcd1ff95e3837ccd72d", + "parameters": "ea118c48e308bc4b0677118bbb3019ec", + "shader_precisions": "f223dfbcd580cf142da156d93790eb83", + "unsupported_extensions": [] + }, + "cookies_enabled": true, + "webgl_basics": { + "renderer": "WebKit WebGL", + "renderer_unmasked": "ANGLE (Apple, ANGLE Metal Renderer: Apple M4, Unspecified Version)", + "shading_language_version": "WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)", + "vendor": "WebKit", + "vendor_unmasked": "Google Inc. (Apple)", + "version": "WebGL 1.0 (OpenGL ES 2.0 Chromium)" + }, + "canvas": { + "geometry": "db3c1462576a399a03ae93d0ab9eb5c4", + "text": "70c3d3f7eb4408dc37a6bf8af1c51029", + "winding": true + }, + "hardware_concurrency": 10, + "languages": [ + [ + "en-US" + ] + ], + "color_depth": 24, + "fonts": [ + "Arial Unicode MS", + "Gill Sans", + "Helvetica Neue", + "Menlo" + ], + "indexed_db": true, + "touch_support": { + "max_touch_points": 0, + "touch_event": false, + "touch_start": false + }, + "device_memory": 8, + "oscpu": "Windows NT 6.1; Win64; x64", + "architecture": 127, + "screen_resolution": [ + 1920, + 1080 + ], + "timezone": "America/Sao_Paulo", + "emoji": { + "bottom": 32, + "font": "Times", + "height": 18, + "left": 8, + "right": 1608, + "top": 14, + "width": 1600, + "x": 8, + "y": 14 + }, + "font_preferences": { + "apple": 147.5625, + "default": 147.5625, + "min": 9.234375, + "mono": 133.0625, + "sans": 144.015625, + "serif": 147.5625, + "system": 146.09375 + }, + "platform": "MacIntel", + "local_storage": true, + "session_storage": true, + "date_time_locale": "en-US", + "audio": 124.04347745512496 + }, + "rule_action": { + "type": "block", + "status_code": 403, + "headers": [ + { + "name": "Content-Type", + "value": "application/json" + } + ], + "body": "{\"title\":\"Forbidden\"}", + "ruleset_id": "rs_b1k1blhqpOX3kU", + "rule_id": "r_uE0af8497PFAOD", + "rule_expression": "bot in [\"bad\"] || incognito" + } +} \ No newline at end of file diff --git a/test/mocks/events/search/get_event_search_200.json b/test/mocks/events/search/get_event_search_200.json new file mode 100644 index 00000000..2affda77 --- /dev/null +++ b/test/mocks/events/search/get_event_search_200.json @@ -0,0 +1,287 @@ +{ + "events": [ + { + "linked_id": "somelinkedId", + "tags": {}, + "timestamp": 1708102555327, + "event_id": "1708102555327.NLOjmg", + "url": "https://www.example.com/login?hope{this{works[!", + "ip_address": "61.127.217.15", + "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....", + "client_referrer": "https://example.com/blog/my-article", + "browser_details": { + "browser_name": "Chrome", + "browser_major_version": "74", + "browser_full_version": "74.0.3729", + "os": "Windows", + "os_version": "7", + "device": "Other" + }, + "identification": { + "visitor_id": "Ibk1527CUFmcnjLwIs4A9", + "confidence": { + "score": 0.97, + "version": "1.1" + }, + "visitor_found": false, + "first_seen_at": 1708102555327, + "last_seen_at": 1708102555327 + }, + "supplementary_id_high_recall": { + "visitor_id": "3HNey93AkBW6CRbxV6xP", + "visitor_found": true, + "confidence": { + "score": 0.97, + "version": "1.1" + }, + "first_seen_at": 1708102555327, + "last_seen_at": 1708102555327 + }, + "proximity": { + "id": "w1aTfd4MCvl", + "precision_radius": 10, + "confidence": 0.95 + }, + "bot": "not_detected", + "root_apps": false, + "emulator": false, + "ip_info": { + "v4": { + "address": "94.142.239.124", + "geolocation": { + "accuracy_radius": 20, + "latitude": 50.05, + "longitude": 14.4, + "postal_code": "150 00", + "timezone": "Europe/Prague", + "city_name": "Prague", + "country_code": "CZ", + "country_name": "Czechia", + "continent_code": "EU", + "continent_name": "Europe", + "subdivisions": [ + { + "iso_code": "10", + "name": "Hlavni mesto Praha" + } + ] + }, + "asn": "7922", + "asn_name": "COMCAST-7922", + "asn_network": "73.136.0.0/13", + "asn_type": "isp", + "datacenter_result": true, + "datacenter_name": "DediPath" + }, + "v6": { + "address": "2001:db8:3333:4444:5555:6666:7777:8888", + "geolocation": { + "accuracy_radius": 5, + "latitude": 49.982, + "longitude": 36.2566, + "postal_code": "10112", + "timezone": "Europe/Berlin", + "city_name": "Berlin", + "country_code": "DE", + "country_name": "Germany", + "continent_code": "EU", + "continent_name": "Europe", + "subdivisions": [ + { + "iso_code": "BE", + "name": "Land Berlin" + } + ] + }, + "asn": "6805", + "asn_name": "Telefonica Germany", + "asn_network": "2a02:3100::/24", + "asn_type": "isp", + "datacenter_result": false, + "datacenter_name": "" + } + }, + "ip_blocklist": { + "email_spam": false, + "attack_source": false, + "tor_node": false + }, + "proxy": true, + "proxy_confidence": "low", + "proxy_details": { + "proxy_type": "residential", + "last_seen_at": 1708102555327, + "provider": "Massive" + }, + "vpn": false, + "vpn_confidence": "high", + "vpn_origin_timezone": "Europe/Berlin", + "vpn_origin_country": "unknown", + "vpn_methods": { + "timezone_mismatch": false, + "public_vpn": false, + "auxiliary_mobile": false, + "os_mismatch": false, + "relay": false + }, + "incognito": false, + "tampering": false, + "tampering_details": { + "anomaly_score": 0.1955, + "anti_detect_browser": false + }, + "cloned_app": false, + "factory_reset_timestamp": 0, + "jailbroken": false, + "frida": false, + "privacy_settings": false, + "virtual_machine": false, + "location_spoofing": false, + "velocity": { + "distinct_ip": { + "5_minutes": 1, + "1_hour": 1, + "24_hours": 1 + }, + "distinct_country": { + "5_minutes": 1, + "1_hour": 2, + "24_hours": 2 + }, + "events": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "ip_events": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "distinct_ip_by_linked_id": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "distinct_visitor_id_by_linked_id": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + } + }, + "developer_tools": false, + "mitm_attack": false, + "sdk": { + "platform": "js", + "version": "3.11.10", + "integrations": [ + { + "name": "fingerprint-pro-react", + "version": "3.11.10", + "subintegration": { + "name": "preact", + "version": "10.21.0" + } + } + ] + }, + "replayed": false, + "high_activity_device": false, + "raw_device_attributes": { + "math": "5f030fa7d2e5f9f757bfaf81642eb1a6", + "vendor": "Google Inc.", + "plugins": [ + { + "description": "Portable Document Format", + "mimeTypes": [ + { + "suffixes": "pdf", + "type": "application/pdf" + }, + { + "suffixes": "pdf", + "type": "text/pdf" + } + ], + "name": "PDF Viewer" + } + ], + "webgl_extensions": { + "context_attributes": "6b1ed336830d2bc96442a9d76373252a", + "extension_parameters": "86a8abb36f0cb30b5946dec0c761d042", + "extensions": "57233d7b10f89fcd1ff95e3837ccd72d", + "parameters": "ea118c48e308bc4b0677118bbb3019ec", + "shader_precisions": "f223dfbcd580cf142da156d93790eb83", + "unsupported_extensions": [] + }, + "cookies_enabled": true, + "webgl_basics": { + "renderer": "WebKit WebGL", + "renderer_unmasked": "ANGLE (Apple, ANGLE Metal Renderer: Apple M4, Unspecified Version)", + "shading_language_version": "WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)", + "vendor": "WebKit", + "vendor_unmasked": "Google Inc. (Apple)", + "version": "WebGL 1.0 (OpenGL ES 2.0 Chromium)" + }, + "canvas": { + "geometry": "db3c1462576a399a03ae93d0ab9eb5c4", + "text": "70c3d3f7eb4408dc37a6bf8af1c51029", + "winding": true + }, + "hardware_concurrency": 10, + "languages": [ + [ + "en-US" + ] + ], + "color_depth": 24, + "fonts": [ + "Arial Unicode MS", + "Gill Sans", + "Helvetica Neue", + "Menlo" + ], + "indexed_db": true, + "touch_support": { + "max_touch_points": 0, + "touch_event": false, + "touch_start": false + }, + "device_memory": 8, + "oscpu": "Windows NT 6.1; Win64; x64", + "architecture": 127, + "screen_resolution": [ + 1920, + 1080 + ], + "timezone": "America/Sao_Paulo", + "emoji": { + "bottom": 32, + "font": "Times", + "height": 18, + "left": 8, + "right": 1608, + "top": 14, + "width": 1600, + "x": 8, + "y": 14 + }, + "font_preferences": { + "apple": 147.5625, + "default": 147.5625, + "min": 9.234375, + "mono": 133.0625, + "sans": 144.015625, + "serif": 147.5625, + "system": 146.09375 + }, + "platform": "MacIntel", + "local_storage": true, + "session_storage": true, + "date_time_locale": "en-US", + "audio": 124.04347745512496 + } + } + ], + "pagination_key": "1708102555327" +} \ No newline at end of file diff --git a/test/mocks/get_event_200.json b/test/mocks/get_event_200.json deleted file mode 100644 index 7560b9a6..00000000 --- a/test/mocks/get_event_200.json +++ /dev/null @@ -1,354 +0,0 @@ -{ - "products": { - "identification": { - "data": { - "visitorId": "Ibk1527CUFmcnjLwIs4A9", - "requestId": "1708102555327.NLOjmg", - "incognito": true, - "linkedId": "somelinkedId", - "tag": {}, - "time": "2019-05-21T16:40:13Z", - "timestamp": 1582299576512, - "url": "https://www.example.com/login?hope{this{works[!", - "ip": "61.127.217.15", - "ipLocation": { - "accuracyRadius": 10, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "61202", - "timezone": "Europe/Dusseldorf", - "city": { - "name": "Dusseldorf" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "63", - "name": "North Rhine-Westphalia" - } - ] - }, - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "74", - "browserFullVersion": "74.0.3729", - "os": "Windows", - "osVersion": "7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." - }, - "confidence": { - "score": 0.97 - }, - "visitorFound": false, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": null, - "subscription": null - }, - "sdk": { - "platform": "js", - "version": "3.11.10" - }, - "replayed": false - } - }, - "botd": { - "data": { - "bot": { - "result": "notDetected" - }, - "url": "https://www.example.com/login?hope{this{works}[!", - "ip": "61.127.217.15", - "time": "2019-05-21T16:40:13Z", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36", - "requestId": "1708102555327.NLOjmg" - } - }, - "rootApps": { - "data": { - "result": false - } - }, - "emulator": { - "data": { - "result": false - } - }, - "ipInfo": { - "data": { - "v4": { - "address": "94.142.239.124", - "geolocation": { - "accuracyRadius": 20, - "latitude": 50.05, - "longitude": 14.4, - "postalCode": "150 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "asn": { - "asn": "7922", - "name": "COMCAST-7922", - "network": "73.136.0.0/13" - }, - "datacenter": { - "result": true, - "name": "DediPath" - } - }, - "v6": { - "address": "2001:db8:3333:4444:5555:6666:7777:8888", - "geolocation": { - "accuracyRadius": 5, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "10112", - "timezone": "Europe/Berlin", - "city": { - "name": "Berlin" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "BE", - "name": "Land Berlin" - } - ] - }, - "asn": { - "asn": "6805", - "name": "Telefonica Germany", - "network": "2a02:3100::/24" - }, - "datacenter": { - "result": false, - "name": "" - } - } - } - }, - "ipBlocklist": { - "data": { - "result": false, - "details": { - "emailSpam": false, - "attackSource": false - } - } - }, - "tor": { - "data": { - "result": false - } - }, - "vpn": { - "data": { - "result": false, - "confidence": "high", - "originTimezone": "Europe/Berlin", - "originCountry": "unknown", - "methods": { - "timezoneMismatch": false, - "publicVPN": false, - "auxiliaryMobile": false, - "osMismatch": false, - "relay": false - } - } - }, - "proxy": { - "data": { - "result": true, - "confidence": "high", - "details": { - "proxyType": "residential", - "lastSeenAt": "2025-08-12T13:00:00Z" - } - } - }, - "incognito": { - "data": { - "result": false - } - }, - "tampering": { - "data": { - "result": false, - "anomalyScore": 0.1955, - "antiDetectBrowser": false - } - }, - "clonedApp": { - "data": { - "result": false - } - }, - "factoryReset": { - "data": { - "time": "1970-01-01T00:00:00Z", - "timestamp": 0 - } - }, - "jailbroken": { - "data": { - "result": false - } - }, - "frida": { - "data": { - "result": false - } - }, - "privacySettings": { - "data": { - "result": false - } - }, - "virtualMachine": { - "data": { - "result": false - } - }, - "rawDeviceAttributes": { - "data": { - "architecture": { - "value": 127 - }, - "audio": { - "value": 35.73832903057337 - }, - "canvas": { - "value": { - "Winding": true, - "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", - "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" - } - }, - "colorDepth": { - "value": 30 - }, - "colorGamut": { - "value": "p3" - }, - "contrast": { - "value": 0 - }, - "cookiesEnabled": { - "value": true - }, - "cpuClass": {}, - "fonts": { - "value": ["Arial Unicode MS", "Gill Sans", "Helvetica Neue", "Menlo"] - } - } - }, - "highActivity": { - "data": { - "result": false - } - }, - "locationSpoofing": { - "data": { - "result": false - } - }, - "velocity": { - "data": { - "distinctIp": { - "intervals": { - "5m": 1, - "1h": 1, - "24h": 1 - } - }, - "distinctLinkedId": {}, - "distinctCountry": { - "intervals": { - "5m": 1, - "1h": 2, - "24h": 2 - } - }, - "events": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "ipEvents": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "distinctIpByLinkedId": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "distinctVisitorIdByLinkedId": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - } - } - }, - "developerTools": { - "data": { - "result": false - } - }, - "mitmAttack": { - "data": { - "result": false - } - }, - "proximity": { - "data": { - "id": "w1aTfd4MCvl", - "precisionRadius": 10, - "confidence": 0.95 - } - } - } -} diff --git a/test/mocks/get_event_200_all_errors.json b/test/mocks/get_event_200_all_errors.json deleted file mode 100644 index 15ea2037..00000000 --- a/test/mocks/get_event_200_all_errors.json +++ /dev/null @@ -1,164 +0,0 @@ -{ - "products": { - "identification": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "botd": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "ipInfo": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "incognito": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "rootApps": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "clonedApp": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "factoryReset": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "jailbroken": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "frida": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "emulator": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "ipBlocklist": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "tor": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "vpn": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "proxy": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "privacySettings": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "virtualMachine": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "tampering": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "rawDeviceAttributes": { - "data": { - "audio": { - "error": { - "name": "Error", - "message": "internal server error" - } - }, - "canvas": { - "error": { - "name": "Error", - "message": "internal server error" - } - } - } - }, - "locationSpoofing": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "highActivity": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "suspectScore": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "velocity": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "developerTools": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "mitmAttack": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "proximity": { - "error": { - "code": "Failed", - "message": "internal server error" - } - } - } -} diff --git a/test/mocks/get_event_200_botd_failed_error.json b/test/mocks/get_event_200_botd_failed_error.json deleted file mode 100644 index 0afa5b79..00000000 --- a/test/mocks/get_event_200_botd_failed_error.json +++ /dev/null @@ -1,69 +0,0 @@ -{ - "products": { - "identification": { - "data": { - "visitorId": "Ibk1527CUFmcnjLwIs4A9", - "requestId": "0KSh65EnVoB85JBmloQK", - "incognito": true, - "linkedId": "somelinkedId", - "time": "2019-05-21T16:40:13Z", - "tag": {}, - "timestamp": 1582299576512, - "url": "https://www.example.com/login", - "ip": "61.127.217.15", - "ipLocation": { - "accuracyRadius": 10, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "61202", - "timezone": "Europe/Dusseldorf", - "city": { - "name": "Dusseldorf" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "subdivisions": [ - { - "isoCode": "63", - "name": "North Rhine-Westphalia" - } - ] - }, - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "74", - "browserFullVersion": "74.0.3729", - "os": "Windows", - "osVersion": "7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." - }, - "confidence": { - "score": 0.97 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": "2022-03-16T11:28:34.023Z", - "subscription": null - }, - "replayed": false - } - }, - "botd": { - "error": { - "code": "Failed", - "message": "internal server error" - } - } - } -} diff --git a/test/mocks/get_event_200_extra_fields.json b/test/mocks/get_event_200_extra_fields.json deleted file mode 100644 index 5a56a1c7..00000000 --- a/test/mocks/get_event_200_extra_fields.json +++ /dev/null @@ -1,91 +0,0 @@ -{ - "products": { - "identification": { - "data": { - "visitorId": "Ibk1527CUFmcnjLwIs4A9", - "requestId": "0KSh65EnVoB85JBmloQK", - "incognito": true, - "linkedId": "somelinkedId", - "tag": {}, - "time": "2019-05-21T16:40:13Z", - "timestamp": 1582299576512, - "url": "https://www.example.com/login", - "ip": "61.127.217.15", - "ipLocation": { - "accuracyRadius": 10, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "61202", - "timezone": "Europe/Dusseldorf", - "city": { - "name": "Dusseldorf" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "subdivisions": [ - { - "isoCode": "63", - "name": "North Rhine-Westphalia" - } - ] - }, - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "74", - "browserFullVersion": "74.0.3729", - "os": "Windows", - "osVersion": "7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." - }, - "confidence": { - "score": 0.97, - "revision": "v1.1" - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": "2022-03-16T11:28:34.023Z", - "subscription": null - }, - "replayed": false - } - }, - "botd": { - "data": { - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36", - "requestId": "1708102555327.NLOjmg", - "bot": { - "result": "notDetected" - }, - "url": "https://www.example.com/login", - "ip": "61.127.217.15", - "time": "2019-05-21T16:40:13Z" - } - }, - "product3": { - "data": { - "result": false - } - }, - "product4": { - "data": { - "result": true, - "details": { - "detail1": true, - "detail2": "detail description", - "detail3": 42 - } - } - } - } -} diff --git a/test/mocks/get_event_200_identification_failed_error.json b/test/mocks/get_event_200_identification_failed_error.json deleted file mode 100644 index 4739f36e..00000000 --- a/test/mocks/get_event_200_identification_failed_error.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "products": { - "identification": { - "error": { - "code": "Failed", - "message": "internal server error" - } - }, - "botd": { - "data": { - "bot": { - "result": "bad", - "type": "headlessChrome" - }, - "url": "https://example.com/login", - "ip": "94.60.143.223", - "time": "2024-02-23T10:20:25.287Z", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/121.0.6167.57 Safari/537.36", - "requestId": "1708683625245.tuJ4nD" - } - } - } -} diff --git a/test/mocks/get_event_200_too_many_requests_error.json b/test/mocks/get_event_200_too_many_requests_error.json deleted file mode 100644 index 138aae72..00000000 --- a/test/mocks/get_event_200_too_many_requests_error.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "products": { - "identification": { - "error": { - "code": "429 Too Many Requests", - "message": "too many requests" - } - }, - "botd": { - "error": { - "code": "TooManyRequests", - "message": "too many requests" - } - } - } -} diff --git a/test/mocks/get_event_200_with_broken_format.json b/test/mocks/get_event_200_with_broken_format.json deleted file mode 100644 index 58081140..00000000 --- a/test/mocks/get_event_200_with_broken_format.json +++ /dev/null @@ -1,301 +0,0 @@ -{ - "products": { - "identification": { - "data": { - "visitorId": "Ibk1527CUFmcnjLwIs4A9", - "requestId": "1708102555327.NLOjmg", - "incognito": true, - "linkedId": { - "broken": "format" - }, - "tag": {}, - "time": "2019-05-21T16:40:13Z", - "timestamp": 1582299576512, - "url": "https://www.example.com/login?hope{this{works[!", - "ip": "61.127.217.15", - "ipLocation": { - "accuracyRadius": 10, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "61202", - "timezone": "Europe/Dusseldorf", - "city": { - "name": "Dusseldorf" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "63", - "name": "North Rhine-Westphalia" - } - ] - }, - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "74", - "browserFullVersion": "74.0.3729", - "os": "Windows", - "osVersion": "7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." - }, - "confidence": { - "score": 0.97 - }, - "visitorFound": false, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": null, - "subscription": null - }, - "replayed": false - } - }, - "botd": { - "data": { - "bot": { - "result": "notDetected" - }, - "url": "https://www.example.com/login?hope{this{works}[!", - "ip": "61.127.217.15", - "time": "2019-05-21T16:40:13Z", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36", - "requestId": "1708102555327.NLOjmg" - } - }, - "rootApps": { - "data": { - "result": false - } - }, - "emulator": { - "data": { - "result": false - } - }, - "ipInfo": { - "data": { - "v4": { - "address": "94.142.239.124", - "geolocation": { - "accuracyRadius": 20, - "latitude": 50.05, - "longitude": 14.4, - "postalCode": "150 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "asn": { - "asn": "7922", - "name": "COMCAST-7922", - "network": "73.136.0.0/13" - }, - "datacenter": { - "result": true, - "name": "DediPath" - } - }, - "v6": { - "address": "2001:db8:3333:4444:5555:6666:7777:8888", - "geolocation": { - "accuracyRadius": 5, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "10112", - "timezone": "Europe/Berlin", - "city": { - "name": "Berlin" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "BE", - "name": "Land Berlin" - } - ] - }, - "asn": { - "asn": "6805", - "name": "Telefonica Germany", - "network": "2a02:3100::/24" - }, - "datacenter": { - "result": false, - "name": "" - } - } - } - }, - "ipBlocklist": { - "data": { - "result": false, - "details": { - "emailSpam": false, - "attackSource": false - } - } - }, - "tor": { - "data": { - "result": false - } - }, - "vpn": { - "data": { - "result": false, - "originTimezone": "Europe/Berlin", - "originCountry": "unknown", - "methods": { - "timezoneMismatch": false, - "publicVPN": false, - "auxiliaryMobile": false - } - } - }, - "proxy": { - "data": { - "result": true, - "confidence": "high", - "details": { - "proxyType": "residential", - "lastSeenAt": "2025-08-12T13:00:00Z" - } - } - }, - "incognito": { - "data": { - "result": false - } - }, - "tampering": { - "data": { - "result": false, - "anomalyScore": 0.1955 - } - }, - "clonedApp": { - "data": { - "result": false - } - }, - "factoryReset": { - "data": { - "time": "1970-01-01T00:00:00Z", - "timestamp": 0 - } - }, - "jailbroken": { - "data": { - "result": false - } - }, - "frida": { - "data": { - "result": false - } - }, - "privacySettings": { - "data": { - "result": false - } - }, - "virtualMachine": { - "data": { - "result": false - } - }, - "rawDeviceAttributes": { - "data": { - "architecture": { - "value": 127 - }, - "audio": { - "value": 35.73832903057337 - }, - "canvas": { - "value": { - "Winding": true, - "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", - "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" - } - }, - "colorDepth": { - "value": 30 - }, - "colorGamut": { - "value": "p3" - }, - "contrast": { - "value": 0 - }, - "cookiesEnabled": { - "value": true - }, - "cpuClass": {}, - "fonts": { - "value": [ - "Arial Unicode MS", - "Gill Sans", - "Helvetica Neue", - "Menlo" - ] - } - } - }, - "highActivity": { - "data": { - "result": false - } - }, - "locationSpoofing": { - "data": { - "result": false - } - }, - "mitmAttack": { - "data": { - "result": false - } - }, - "proximity": { - "data": { - "id": "w1aTfd4MCvl", - "precisionRadius": 10, - "confidence": 0.95 - } - } - } -} diff --git a/test/mocks/get_event_200_with_unknown_field.json b/test/mocks/get_event_200_with_unknown_field.json deleted file mode 100644 index 6af6ad63..00000000 --- a/test/mocks/get_event_200_with_unknown_field.json +++ /dev/null @@ -1,299 +0,0 @@ -{ - "unknown": "field", - "products": { - "unknown": "field", - "identification": { - "unknown": "field", - "data": { - "unknown": "field", - "visitorId": "Ibk1527CUFmcnjLwIs4A9", - "requestId": "1708102555327.NLOjmg", - "incognito": true, - "linkedId": "somelinkedId", - "tag": {}, - "time": "2019-05-21T16:40:13Z", - "timestamp": 1582299576512, - "url": "https://www.example.com/login?hope{this{works[!", - "ip": "61.127.217.15", - "ipLocation": { - "accuracyRadius": 10, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "61202", - "timezone": "Europe/Dusseldorf", - "city": { - "name": "Dusseldorf" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "63", - "name": "North Rhine-Westphalia" - } - ] - }, - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "74", - "browserFullVersion": "74.0.3729", - "os": "Windows", - "osVersion": "7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." - }, - "confidence": { - "score": 0.97 - }, - "visitorFound": false, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": null, - "subscription": null - }, - "replayed": false - } - }, - "botd": { - "data": { - "bot": { - "result": "notDetected" - }, - "url": "https://www.example.com/login?hope{this{works}[!", - "ip": "61.127.217.15", - "time": "2019-05-21T16:40:13Z", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36", - "requestId": "1708102555327.NLOjmg" - } - }, - "rootApps": { - "data": { - "result": false - } - }, - "emulator": { - "data": { - "result": false - } - }, - "ipInfo": { - "data": { - "v4": { - "address": "94.142.239.124", - "geolocation": { - "accuracyRadius": 20, - "latitude": 50.05, - "longitude": 14.4, - "postalCode": "150 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "asn": { - "asn": "7922", - "name": "COMCAST-7922", - "network": "73.136.0.0/13" - }, - "datacenter": { - "result": true, - "name": "DediPath" - } - }, - "v6": { - "address": "2001:db8:3333:4444:5555:6666:7777:8888", - "geolocation": { - "accuracyRadius": 5, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "10112", - "timezone": "Europe/Berlin", - "city": { - "name": "Berlin" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "BE", - "name": "Land Berlin" - } - ] - }, - "asn": { - "asn": "6805", - "name": "Telefonica Germany", - "network": "2a02:3100::/24" - }, - "datacenter": { - "result": false, - "name": "" - } - } - } - }, - "ipBlocklist": { - "data": { - "result": false, - "details": { - "emailSpam": false, - "attackSource": false - } - } - }, - "tor": { - "data": { - "result": false - } - }, - "vpn": { - "data": { - "result": false, - "originTimezone": "Europe/Berlin", - "originCountry": "unknown", - "methods": { - "timezoneMismatch": false, - "publicVPN": false, - "auxiliaryMobile": false - } - } - }, - "proxy": { - "data": { - "result": false, - "confidence": "high" - } - }, - "incognito": { - "data": { - "result": false - } - }, - "tampering": { - "data": { - "result": false, - "anomalyScore": 0.1955 - } - }, - "clonedApp": { - "data": { - "result": false - } - }, - "factoryReset": { - "data": { - "time": "1970-01-01T00:00:00Z", - "timestamp": 0 - } - }, - "jailbroken": { - "data": { - "result": false - } - }, - "frida": { - "data": { - "result": false - } - }, - "privacySettings": { - "data": { - "result": false - } - }, - "virtualMachine": { - "data": { - "result": false - } - }, - "rawDeviceAttributes": { - "data": { - "architecture": { - "value": 127 - }, - "audio": { - "value": 35.73832903057337 - }, - "canvas": { - "value": { - "Winding": true, - "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", - "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" - } - }, - "colorDepth": { - "value": 30 - }, - "colorGamut": { - "value": "p3" - }, - "contrast": { - "value": 0 - }, - "cookiesEnabled": { - "value": true - }, - "cpuClass": {}, - "fonts": { - "value": [ - "Arial Unicode MS", - "Gill Sans", - "Helvetica Neue", - "Menlo" - ] - } - } - }, - "highActivity": { - "data": { - "result": false - } - }, - "locationSpoofing": { - "data": { - "result": false - } - }, - "mitmAttack": { - "data": { - "result": false - } - }, - "proximity": { - "data": { - "id": "w1aTfd4MCvl", - "precisionRadius": 10, - "confidence": 0.95 - } - } - } -} diff --git a/test/mocks/get_event_search_200.json b/test/mocks/get_event_search_200.json deleted file mode 100644 index 27b7848d..00000000 --- a/test/mocks/get_event_search_200.json +++ /dev/null @@ -1,354 +0,0 @@ -{ - "events": [ - { - "products": { - "identification": { - "data": { - "visitorId": "Ibk1527CUFmcnjLwIs4A9", - "requestId": "1708102555327.NLOjmg", - "incognito": true, - "linkedId": "somelinkedId", - "tag": {}, - "time": "2019-05-21T16:40:13Z", - "timestamp": 1582299576512, - "url": "https://www.example.com/login?hope{this{works[!", - "ip": "61.127.217.15", - "ipLocation": { - "accuracyRadius": 10, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "61202", - "timezone": "Europe/Dusseldorf", - "city": { - "name": "Dusseldorf" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "63", - "name": "North Rhine-Westphalia" - } - ] - }, - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "74", - "browserFullVersion": "74.0.3729", - "os": "Windows", - "osVersion": "7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." - }, - "confidence": { - "score": 0.97 - }, - "visitorFound": false, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": null, - "subscription": null - }, - "replayed": false - } - }, - "botd": { - "data": { - "bot": { - "result": "notDetected" - }, - "url": "https://www.example.com/login?hope{this{works}[!", - "ip": "61.127.217.15", - "time": "2019-05-21T16:40:13Z", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36", - "requestId": "1708102555327.NLOjmg" - } - }, - "rootApps": { - "data": { - "result": false - } - }, - "emulator": { - "data": { - "result": false - } - }, - "ipInfo": { - "data": { - "v4": { - "address": "94.142.239.124", - "geolocation": { - "accuracyRadius": 20, - "latitude": 50.05, - "longitude": 14.4, - "postalCode": "150 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "asn": { - "asn": "7922", - "name": "COMCAST-7922", - "network": "73.136.0.0/13" - }, - "datacenter": { - "result": true, - "name": "DediPath" - } - }, - "v6": { - "address": "2001:db8:3333:4444:5555:6666:7777:8888", - "geolocation": { - "accuracyRadius": 5, - "latitude": 49.982, - "longitude": 36.2566, - "postalCode": "10112", - "timezone": "Europe/Berlin", - "city": { - "name": "Berlin" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "BE", - "name": "Land Berlin" - } - ] - }, - "asn": { - "asn": "6805", - "name": "Telefonica Germany", - "network": "2a02:3100::/24" - }, - "datacenter": { - "result": false, - "name": "" - } - } - } - }, - "ipBlocklist": { - "data": { - "result": false, - "details": { - "emailSpam": false, - "attackSource": false - } - } - }, - "tor": { - "data": { - "result": false - } - }, - "vpn": { - "data": { - "result": false, - "confidence": "high", - "originTimezone": "Europe/Berlin", - "originCountry": "unknown", - "methods": { - "timezoneMismatch": false, - "publicVPN": false, - "auxiliaryMobile": false, - "osMismatch": false, - "relay": false - } - } - }, - "proxy": { - "data": { - "result": false, - "confidence": "high", - "details": { - "proxyType": "residential", - "lastSeenAt": "2025-08-12T13:00:00Z" - } - } - }, - "incognito": { - "data": { - "result": false - } - }, - "tampering": { - "data": { - "result": false, - "anomalyScore": 0.1955, - "antiDetectBrowser": false - } - }, - "clonedApp": { - "data": { - "result": false - } - }, - "factoryReset": { - "data": { - "time": "1970-01-01T00:00:00Z", - "timestamp": 0 - } - }, - "jailbroken": { - "data": { - "result": false - } - }, - "frida": { - "data": { - "result": false - } - }, - "privacySettings": { - "data": { - "result": false - } - }, - "virtualMachine": { - "data": { - "result": false - } - }, - "rawDeviceAttributes": { - "data": { - "architecture": { - "value": 127 - }, - "audio": { - "value": 35.73832903057337 - }, - "canvas": { - "value": { - "Winding": true, - "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", - "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" - } - }, - "colorDepth": { - "value": 30 - }, - "colorGamut": { - "value": "p3" - }, - "contrast": { - "value": 0 - }, - "cookiesEnabled": { - "value": true - }, - "cpuClass": {}, - "fonts": { - "value": ["Arial Unicode MS", "Gill Sans", "Helvetica Neue", "Menlo"] - } - } - }, - "highActivity": { - "data": { - "result": false - } - }, - "locationSpoofing": { - "data": { - "result": false - } - }, - "velocity": { - "data": { - "distinctIp": { - "intervals": { - "5m": 1, - "1h": 1, - "24h": 1 - } - }, - "distinctLinkedId": {}, - "distinctCountry": { - "intervals": { - "5m": 1, - "1h": 2, - "24h": 2 - } - }, - "events": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "ipEvents": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "distinctIpByLinkedId": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "distinctVisitorIdByLinkedId": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - } - } - }, - "developerTools": { - "data": { - "result": false - } - }, - "mitmAttack": { - "data": { - "result": false - } - }, - "proximity": { - "data": { - "id": "w1aTfd4MCvl", - "precisionRadius": 10, - "confidence": 0.95 - } - } - }} - ], - "paginationKey": "1655373953086" -} diff --git a/test/mocks/get_visitors_200_limit_1.json b/test/mocks/get_visitors_200_limit_1.json deleted file mode 100644 index f6357ea5..00000000 --- a/test/mocks/get_visitors_200_limit_1.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "visitorId": "AcxioeQKffpXF8iGQK3P", - "visits": [ - { - "requestId": "1655373953086.DDlfmP", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "82.118.30.68", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 50.0805, - "longitude": 14.467, - "postalCode": "130 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "timestamp": 1655373953094, - "time": "2022-06-16T10:05:53Z", - "url": "https://dashboard.fingerprint.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-16T10:03:00.912Z", - "subscription": "2022-06-16T10:03:00.912Z" - } - } - ], - "lastTimestamp": 1655373953086, - "paginationKey": "1655373953086.DDlfmP" -} diff --git a/test/mocks/get_visitors_200_limit_500.json b/test/mocks/get_visitors_200_limit_500.json deleted file mode 100644 index 3e3aceb0..00000000 --- a/test/mocks/get_visitors_200_limit_500.json +++ /dev/null @@ -1,3030 +0,0 @@ -{ - "visitorId": "AcxioeQKffpXF8iGQK3P", - "visits": [ - { - "requestId": "1655373780901.HhjRFX", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "188.242.36.107", - "ipLocation": { - "accuracyRadius": 5, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1655373780912, - "time": "2022-06-16T10:03:00Z", - "url": "https://fingerprint.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-16T05:27:30.578Z", - "subscription": "2022-06-16T05:27:30.578Z" - } - }, - { - "requestId": "1655357250568.vqejDF", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "82.118.30.62", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 50.0805, - "longitude": 14.467, - "postalCode": "130 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "timestamp": 1655357250578, - "time": "2022-06-16T05:27:30Z", - "url": "https://fingerprint.com/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-15T15:28:33.479Z", - "subscription": "2022-06-15T15:28:33.479Z" - } - }, - { - "requestId": "1655306913474.kFQsQx", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "82.118.30.68", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 50.0805, - "longitude": 14.467, - "postalCode": "130 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "timestamp": 1655306913479, - "time": "2022-06-15T15:28:33Z", - "url": "https://fingerprint.com/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-15T08:47:34.677Z", - "subscription": "2022-06-15T08:47:34.677Z" - } - }, - { - "requestId": "1655282854672.vz4ZlN", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "82.118.30.91", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 50.0805, - "longitude": 14.467, - "postalCode": "130 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "timestamp": 1655282854677, - "time": "2022-06-15T08:47:34Z", - "url": "https://fingerprint.com/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-14T14:19:42.753Z", - "subscription": "2022-06-14T14:19:42.753Z" - } - }, - { - "requestId": "1655216382743.RDRa4h", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "188.242.36.107", - "ipLocation": { - "accuracyRadius": 5, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1655216382753, - "time": "2022-06-14T14:19:42Z", - "url": "https://fingerprint.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-13T07:53:19.878Z", - "subscription": "2022-06-13T07:53:19.878Z" - } - }, - { - "requestId": "1655106799870.C8m8hR", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.137", - "timestamp": 1655106799878, - "time": "2022-06-13T07:53:19Z", - "url": "https://fingerprint.com/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-07T12:54:35.413Z", - "subscription": "2022-06-07T12:54:35.413Z" - } - }, - { - "requestId": "1654606475406.2uXCJx", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.157", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651 - }, - "timestamp": 1654606475413, - "time": "2022-06-07T12:54:35Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-07T09:37:57.43Z", - "subscription": "2022-06-07T09:37:57.43Z" - } - }, - { - "requestId": "1654594677423.pCHmKJ", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "188.242.36.107", - "ipLocation": { - "timezone": "Europe/Moscow" - }, - "timestamp": 1654594677430, - "time": "2022-06-07T09:37:57Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-07T09:37:50.109Z", - "subscription": "2022-06-07T09:37:50.109Z" - } - }, - { - "requestId": "1654594670097.Lmodmj", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "188.242.36.107", - "ipLocation": { - "accuracyRadius": 5, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1654594670109, - "time": "2022-06-07T09:37:50Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-07T08:31:31.9Z", - "subscription": "2022-06-07T08:31:31.9Z" - } - }, - { - "requestId": "1654590691894.aCYqYE", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "188.242.36.107", - "ipLocation": { - "accuracyRadius": 5, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1654590691900, - "time": "2022-06-07T08:31:31Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-06T09:05:25.954Z", - "subscription": "2022-06-06T09:05:25.954Z" - } - }, - { - "requestId": "1654506325946.ijIwzu", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1654506325954, - "time": "2022-06-06T09:05:25Z", - "url": "https://fingerprintcom.netlify.app/blog/name-change/", - "tag": {}, - "confidence": { - "score": 0.99 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-02T16:58:53.635Z", - "subscription": "2022-06-02T16:58:53.635Z" - } - }, - { - "requestId": "1654189133629.0V1gtF", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1654189133635, - "time": "2022-06-02T16:58:53Z", - "url": "https://fingerprintcom.netlify.app/blog/name-change/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-06-02T16:58:51.483Z", - "subscription": "2022-06-02T16:58:51.483Z" - } - }, - { - "requestId": "1654189131472.r49Bbh", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "102", - "browserFullVersion": "102.0.5005", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1654189131483, - "time": "2022-06-02T16:58:51Z", - "url": "https://fingerprintcom.netlify.app/", - "tag": {}, - "confidence": { - "score": 0.95 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-27T14:52:26.624Z", - "subscription": "2022-05-27T14:52:26.624Z" - } - }, - { - "requestId": "1653663146617.o8KpJO", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.64 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1653663146624, - "time": "2022-05-27T14:52:26Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-20T09:50:06.7Z", - "subscription": "2022-05-20T09:50:06.7Z" - } - }, - { - "requestId": "1653040206694.Q5Csig", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1653040206700, - "time": "2022-05-20T09:50:06Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-19T16:27:38.029Z", - "subscription": "2022-05-19T16:27:38.029Z" - } - }, - { - "requestId": "1652977658020.xbfYhA", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1652977658029, - "time": "2022-05-19T16:27:38Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-17T15:09:32.666Z", - "subscription": "2022-05-17T15:09:32.666Z" - } - }, - { - "requestId": "1652800172657.xA22Pd", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1652800172666, - "time": "2022-05-17T15:09:32Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-17T14:18:17.631Z", - "subscription": "2022-05-17T14:18:17.631Z" - } - }, - { - "requestId": "1652797097626.faAMJO", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1652797097631, - "time": "2022-05-17T14:18:17Z", - "url": "https://fingerprintjs.com/careers/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-17T10:16:04.809Z", - "subscription": "2022-05-17T10:16:04.809Z" - } - }, - { - "requestId": "1652782564800.MWH0GO", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1652782564809, - "time": "2022-05-17T10:16:04Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-16T06:47:01.511Z", - "subscription": "2022-05-16T06:47:01.511Z" - } - }, - { - "requestId": "1652683621505.1tOjuc", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" - }, - "incognito": false, - "ip": "217.150.54.233", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1652683621511, - "time": "2022-05-16T06:47:01Z", - "url": "https://fingerprintjs.com/products/bot-detection/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-16T06:45:49.586Z", - "subscription": "2022-05-16T06:45:49.586Z" - } - }, - { - "requestId": "1652683586557.67Faeg", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" - }, - "incognito": true, - "ip": "217.150.54.233", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1652683586562, - "time": "2022-05-16T06:46:26Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 0.94 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-16T06:45:49.586Z", - "subscription": "2022-05-16T06:45:49.586Z" - } - }, - { - "requestId": "1652683549513.aVRqEP", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "101", - "browserFullVersion": "101.0.4951", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4951.54 Safari/537.36" - }, - "incognito": false, - "ip": "217.150.54.233", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1652683549586, - "time": "2022-05-16T06:45:49Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-05T10:11:25.96Z", - "subscription": "2022-05-05T10:11:25.96Z" - } - }, - { - "requestId": "1651745485951.Oj68me", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1651745485960, - "time": "2022-05-05T10:11:25Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-05T09:33:40.155Z", - "subscription": "2022-05-05T09:33:40.155Z" - } - }, - { - "requestId": "1651743220004.W02rhx", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1651743220155, - "time": "2022-05-05T09:33:40Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-05-03T15:26:32.826Z", - "subscription": "2022-05-03T15:26:32.826Z" - } - }, - { - "requestId": "1651591592822.Is9u93", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.157", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1651591592826, - "time": "2022-05-03T15:26:32Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-29T13:23:37.049Z", - "subscription": "2022-04-29T13:23:37.049Z" - } - }, - { - "requestId": "1651238617044.rMVPGS", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "89.38.224.165", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 44.804, - "longitude": 20.4651, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1651238617049, - "time": "2022-04-29T13:23:37Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-29T10:37:53.333Z", - "subscription": "2022-04-29T10:37:53.333Z" - } - }, - { - "requestId": "1651228673329.QZI2Cu", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "188.242.36.107", - "ipLocation": { - "accuracyRadius": 5, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1651228673333, - "time": "2022-04-29T10:37:53Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-28T13:58:06.323Z", - "subscription": "2022-04-28T13:58:06.323Z" - } - }, - { - "requestId": "1651154286221.YvuOCP", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "84.247.59.113", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 50.0971, - "longitude": 8.5952, - "postalCode": "65933", - "timezone": "Europe/Berlin", - "city": { - "name": "Frankfurt am Main" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "HE", - "name": "Hesse" - } - ] - }, - "timestamp": 1651154286323, - "time": "2022-04-28T13:58:06Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-28T12:16:02.564Z", - "subscription": "2022-04-28T12:16:02.564Z" - } - }, - { - "requestId": "1651148162556.dySgif", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "84.247.59.113", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 50.0971, - "longitude": 8.5952, - "postalCode": "65933", - "timezone": "Europe/Berlin", - "city": { - "name": "Frankfurt am Main" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "HE", - "name": "Hesse" - } - ] - }, - "timestamp": 1651148162564, - "time": "2022-04-28T12:16:02Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-28T11:57:13.267Z", - "subscription": "2022-04-28T11:57:13.267Z" - } - }, - { - "requestId": "1651147033260.SxmFvL", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "84.247.59.146", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 50.0971, - "longitude": 8.5952, - "postalCode": "65933", - "timezone": "Europe/Berlin", - "city": { - "name": "Frankfurt am Main" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "HE", - "name": "Hesse" - } - ] - }, - "timestamp": 1651147033267, - "time": "2022-04-28T11:57:13Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-28T11:57:06.24Z", - "subscription": "2022-04-28T11:57:06.24Z" - } - }, - { - "requestId": "1651147026139.aAZ8TO", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "84.247.59.146", - "ipLocation": { - "accuracyRadius": 20, - "latitude": 50.0971, - "longitude": 8.5952, - "postalCode": "65933", - "timezone": "Europe/Berlin", - "city": { - "name": "Frankfurt am Main" - }, - "country": { - "code": "DE", - "name": "Germany" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "HE", - "name": "Hesse" - } - ] - }, - "timestamp": 1651147026240, - "time": "2022-04-28T11:57:06Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-26T14:10:31.908Z", - "subscription": "2022-04-26T14:10:31.908Z" - } - }, - { - "requestId": "1650982231903.eG0b6v", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.105", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650982231908, - "time": "2022-04-26T14:10:31Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-26T11:43:37.373Z", - "subscription": "2022-04-26T11:43:37.373Z" - } - }, - { - "requestId": "1650973417360.xupFFD", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.99", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650973417373, - "time": "2022-04-26T11:43:37Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-26T11:43:30.111Z", - "subscription": "2022-04-26T11:43:30.111Z" - } - }, - { - "requestId": "1650973410104.AQD4qu", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.99", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650973410111, - "time": "2022-04-26T11:43:30Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-26T11:22:34.148Z", - "subscription": "2022-04-26T11:22:34.148Z" - } - }, - { - "requestId": "1650972154133.lSWE8a", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.96", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650972154148, - "time": "2022-04-26T11:22:34Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-26T11:22:03.83Z", - "subscription": "2022-04-26T11:22:03.83Z" - } - }, - { - "requestId": "1650972123824.xk8MUR", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.96", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650972123830, - "time": "2022-04-26T11:22:03Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-25T09:46:15.458Z", - "subscription": "2022-04-25T09:46:15.458Z" - } - }, - { - "requestId": "1650879975452.kfuowM", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "188.242.36.107", - "ipLocation": { - "accuracyRadius": 5, - "latitude": 59.8983, - "longitude": 30.2618, - "postalCode": "190924", - "timezone": "Europe/Moscow", - "city": { - "name": "St Petersburg" - }, - "country": { - "code": "RU", - "name": "Russia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "SPE", - "name": "St.-Petersburg" - } - ] - }, - "timestamp": 1650879975458, - "time": "2022-04-25T09:46:15Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-22T16:51:44.816Z", - "subscription": "2022-04-22T16:51:44.816Z" - } - }, - { - "requestId": "1650646304808.xQbAju", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.227", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650646304816, - "time": "2022-04-22T16:51:44Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-21T11:43:33.116Z", - "subscription": "2022-04-21T11:43:33.116Z" - } - }, - { - "requestId": "1650541413105.leAPLz", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.89", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650541413116, - "time": "2022-04-21T11:43:33Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-20T17:11:54.717Z", - "subscription": "2022-04-20T17:11:54.717Z" - } - }, - { - "requestId": "1650474714710.M1IGsl", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.111", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650474714717, - "time": "2022-04-20T17:11:54Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-20T17:11:47.217Z", - "subscription": "2022-04-20T17:11:47.217Z" - } - }, - { - "requestId": "1650474707211.CEUuZk", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.111", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650474707217, - "time": "2022-04-20T17:11:47Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-20T17:11:12.076Z", - "subscription": "2022-04-20T17:11:12.076Z" - } - }, - { - "requestId": "1650474672071.Pz4WsK", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.111", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650474672076, - "time": "2022-04-20T17:11:12Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T12:29:06.692Z", - "subscription": "2022-04-19T12:29:06.692Z" - } - }, - { - "requestId": "1650371346684.1d7sgv", - "browserDetails": { - "browserName": "Chrome Mobile", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Android", - "osVersion": "6.0", - "device": "Nexus 5", - "userAgent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Mobile Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.198", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650371346692, - "time": "2022-04-19T12:29:06Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T12:29:02.15Z", - "subscription": "2022-04-19T12:29:02.15Z" - } - }, - { - "requestId": "1650371342145.oWyfRx", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.198", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650371342150, - "time": "2022-04-19T12:29:02Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T11:35:14.729Z", - "subscription": "2022-04-19T11:35:14.729Z" - } - }, - { - "requestId": "1650368114723.YEXcHI", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.206", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650368114729, - "time": "2022-04-19T11:35:14Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T11:13:33.107Z", - "subscription": "2022-04-19T11:13:33.107Z" - } - }, - { - "requestId": "1650366813101.SvUZC1", - "browserDetails": { - "browserName": "Chrome Mobile", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Android", - "osVersion": "6.0", - "device": "Nexus 5", - "userAgent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Mobile Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.204", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650366813107, - "time": "2022-04-19T11:13:33Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T11:13:28.453Z", - "subscription": "2022-04-19T11:13:28.453Z" - } - }, - { - "requestId": "1650366808426.Hy6j7v", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.204", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650366808453, - "time": "2022-04-19T11:13:28Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T11:07:05.19Z", - "subscription": "2022-04-19T11:07:05.19Z" - } - }, - { - "requestId": "1650366425184.xvYkdr", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.204", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650366425190, - "time": "2022-04-19T11:07:05Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T11:07:00.483Z", - "subscription": "2022-04-19T11:07:00.483Z" - } - }, - { - "requestId": "1650366420377.VR5pDX", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.204", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650366420483, - "time": "2022-04-19T11:07:00Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T10:37:45.279Z", - "subscription": "2022-04-19T10:37:45.279Z" - } - }, - { - "requestId": "1650364665274.qq31O4", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.172", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650364665279, - "time": "2022-04-19T10:37:45Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T10:22:58.87Z", - "subscription": "2022-04-19T10:22:58.87Z" - } - }, - { - "requestId": "1650363778864.tsVBjO", - "browserDetails": { - "browserName": "Chrome Mobile", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Android", - "osVersion": "6.0", - "device": "Nexus 5", - "userAgent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Mobile Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.210", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650363778870, - "time": "2022-04-19T10:22:58Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T10:22:46.894Z", - "subscription": "2022-04-19T10:22:46.894Z" - } - }, - { - "requestId": "1650363766889.KuVDpm", - "browserDetails": { - "browserName": "Chrome Mobile", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Android", - "osVersion": "6.0", - "device": "Nexus 5", - "userAgent": "Mozilla/5.0 (Linux; Android 6.0; Nexus 5 Build/MRA58N) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Mobile Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.210", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650363766894, - "time": "2022-04-19T10:22:46Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T10:07:01.528Z", - "subscription": "2022-04-19T10:07:01.528Z" - } - }, - { - "requestId": "1650362821521.dXH2Ce", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.180", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650362821528, - "time": "2022-04-19T10:07:01Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-19T10:02:42.46Z", - "subscription": "2022-04-19T10:02:42.46Z" - } - }, - { - "requestId": "1650362562448.a5cPLU", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.127 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.180", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650362562460, - "time": "2022-04-19T10:02:42Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-18T17:06:30.834Z", - "subscription": "2022-04-18T17:06:30.834Z" - } - }, - { - "requestId": "1650301590829.YXGX7h", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.195", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650301590834, - "time": "2022-04-18T17:06:30Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-18T12:23:30.446Z", - "subscription": "2022-04-18T12:23:30.446Z" - } - }, - { - "requestId": "1650284610441.lJrX4M", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.75 Safari/537.36" - }, - "incognito": false, - "ip": "45.86.200.179", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 52.3824, - "longitude": 4.8995, - "timezone": "Europe/Amsterdam", - "country": { - "code": "NL", - "name": "Netherlands" - }, - "continent": { - "code": "EU", - "name": "Europe" - } - }, - "timestamp": 1650284610446, - "time": "2022-04-18T12:23:30Z", - "url": "https://fingerprintjs.com/blog/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-04-06T14:53:00.526Z", - "subscription": "2022-04-06T14:53:00.526Z" - } - }, - { - "requestId": "1649256780522.WAXWf2", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36" - }, - "incognito": false, - "ip": "109.245.35.200", - "ipLocation": { - "accuracyRadius": 50, - "latitude": 44.8166, - "longitude": 20.4721, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1649256780526, - "time": "2022-04-06T14:53:00Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-03-18T11:08:35.698Z", - "subscription": "2022-03-18T11:08:35.698Z" - } - }, - { - "requestId": "1649256780520.RRC4PR", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "100", - "browserFullVersion": "100.0.4896", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/100.0.4896.60 Safari/537.36" - }, - "incognito": false, - "ip": "109.245.35.200", - "ipLocation": { - "accuracyRadius": 50, - "latitude": 44.8166, - "longitude": 20.4721, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1649256780525, - "time": "2022-04-06T14:53:00Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-03-18T11:08:35.698Z", - "subscription": "2022-03-18T11:08:35.698Z" - } - }, - { - "requestId": "1647601715689.iocXfW", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "98", - "browserFullVersion": "98.0.4758", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36" - }, - "incognito": false, - "ip": "178.223.21.183", - "ipLocation": { - "accuracyRadius": 50, - "latitude": 44.8166, - "longitude": 20.4721, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1647601715698, - "time": "2022-03-18T11:08:35Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-03-16T08:21:23.62Z", - "subscription": "2022-03-16T08:21:23.62Z" - } - }, - { - "requestId": "1647418883615.Vck2NA", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "98", - "browserFullVersion": "98.0.4758", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36" - }, - "incognito": false, - "ip": "87.116.165.97", - "ipLocation": { - "accuracyRadius": 50, - "latitude": 44.8166, - "longitude": 20.4721, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1647418883620, - "time": "2022-03-16T08:21:23Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-03-16T08:21:18.398Z", - "subscription": "2022-03-16T08:21:18.398Z" - } - }, - { - "requestId": "1647418878391.NZDmht", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "98", - "browserFullVersion": "98.0.4758", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36" - }, - "incognito": false, - "ip": "87.116.165.97", - "ipLocation": { - "accuracyRadius": 50, - "latitude": 44.8166, - "longitude": 20.4721, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1647418878398, - "time": "2022-03-16T08:21:18Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-03-15T11:46:51.858Z", - "subscription": "2022-03-15T11:46:51.858Z" - } - }, - { - "requestId": "1647344811836.RvNkL5", - "browserDetails": { - "browserName": "Chrome", - "browserMajorVersion": "98", - "browserFullVersion": "98.0.4758", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.109 Safari/537.36" - }, - "incognito": false, - "ip": "87.116.165.97", - "ipLocation": { - "accuracyRadius": 50, - "latitude": 44.8166, - "longitude": 20.4721, - "timezone": "Europe/Belgrade", - "city": { - "name": "Belgrade" - }, - "country": { - "code": "RS", - "name": "Serbia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "00", - "name": "Belgrade" - } - ] - }, - "timestamp": 1647344811858, - "time": "2022-03-15T11:46:51Z", - "url": "https://fingerprintjs.com/", - "tag": {}, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2022-02-04T11:31:20Z", - "subscription": "2022-02-04T11:31:20Z" - }, - "lastSeenAt": { - "global": "2022-03-08T12:33:05.677Z", - "subscription": "2022-03-08T12:33:05.677Z" - } - } - ] -} diff --git a/test/mocks/get_visitors_400_bad_request.json b/test/mocks/get_visitors_400_bad_request.json deleted file mode 100644 index c2b6e295..00000000 --- a/test/mocks/get_visitors_400_bad_request.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "error": "bad request" -} diff --git a/test/mocks/get_visitors_403_forbidden.json b/test/mocks/get_visitors_403_forbidden.json deleted file mode 100644 index 8a886d18..00000000 --- a/test/mocks/get_visitors_403_forbidden.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "error": "Forbidden (HTTP 403)" -} diff --git a/test/mocks/get_visitors_429_too_many_requests.json b/test/mocks/get_visitors_429_too_many_requests.json deleted file mode 100644 index 00d00f2e..00000000 --- a/test/mocks/get_visitors_429_too_many_requests.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "error": "too many requests" -} diff --git a/test/mocks/related-visitors/get_related_visitors_200.json b/test/mocks/related-visitors/get_related_visitors_200.json deleted file mode 100644 index 7a46a69e..00000000 --- a/test/mocks/related-visitors/get_related_visitors_200.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "relatedVisitors": [ - { - "visitorId": "NtCUJGceWX9RpvSbhvOm" - }, - { - "visitorId": "25ee02iZwGxeyT0jMNkZ" - } - ] -} diff --git a/test/mocks/related-visitors/get_related_visitors_200_empty.json b/test/mocks/related-visitors/get_related_visitors_200_empty.json deleted file mode 100644 index 6c9b02c1..00000000 --- a/test/mocks/related-visitors/get_related_visitors_200_empty.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "relatedVisitors": [] -} diff --git a/test/mocks/update_event_multiple_fields_request.json b/test/mocks/update_event_multiple_fields_request.json deleted file mode 100644 index f85d2e75..00000000 --- a/test/mocks/update_event_multiple_fields_request.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "linkedId": "myNewLinkedId", - "tag": { - "myTag": "myNewValue" - }, - "suspect": true -} diff --git a/test/mocks/update_event_one_field_request.json b/test/mocks/update_event_one_field_request.json deleted file mode 100644 index 0ebd1549..00000000 --- a/test/mocks/update_event_one_field_request.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "linkedId": "myNewLinkedId" -} diff --git a/test/mocks/webhook.json b/test/mocks/webhook.json deleted file mode 100644 index 1180fcdc..00000000 --- a/test/mocks/webhook.json +++ /dev/null @@ -1,293 +0,0 @@ -{ - "requestId": "Px6VxbRC6WBkA39yeNH3", - "url": "https://banking.example.com/signup", - "ip": "216.3.128.12", - "tag": { - "requestType": "signup", - "yourCustomId": 45321 - }, - "time": "2019-10-12T07:20:50.52Z", - "timestamp": 1554910997788, - "ipLocation": { - "accuracyRadius": 1, - "city": { - "name": "Bolingbrook" - }, - "continent": { - "code": "NA", - "name": "North America" - }, - "country": { - "code": "US", - "name": "United States" - }, - "latitude": 41.12933, - "longitude": -88.9954, - "postalCode": "60547", - "subdivisions": [ - { - "isoCode": "IL", - "name": "Illinois" - } - ], - "timezone": "America/Chicago" - }, - "linkedId": "any-string", - "visitorId": "3HNey93AkBW6CRbxV6xP", - "visitorFound": true, - "confidence": { - "score": 0.97 - }, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": "2022-03-16T11:28:34.023Z", - "subscription": null - }, - "browserDetails": { - "browserName": "Chrome", - "browserFullVersion": "73.0.3683.86", - "browserMajorVersion": "73", - "os": "Mac OS X", - "osVersion": "10.14.3", - "device": "Other", - "userAgent": "(Macintosh; Intel Mac OS X 10_14_3) Chrome/73.0.3683.86" - }, - "incognito": false, - "clientReferrer": "https://google.com?search=banking+services", - "bot": { - "result": "bad", - "type": "selenium" - }, - "userAgent": "(Macintosh; Intel Mac OS X 10_14_3) Chrome/73.0.3683.86", - "rootApps": { - "result": false - }, - "emulator": { - "result": false - }, - "ipInfo": { - "v4": { - "address": "94.142.239.124", - "geolocation": { - "accuracyRadius": 20, - "latitude": 50.05, - "longitude": 14.4, - "postalCode": "150 00", - "timezone": "Europe/Prague", - "city": { - "name": "Prague" - }, - "country": { - "code": "CZ", - "name": "Czechia" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "10", - "name": "Hlavni mesto Praha" - } - ] - }, - "asn": { - "asn": "7922", - "name": "COMCAST-7922", - "network": "73.136.0.0/13" - }, - "datacenter": { - "result": true, - "name": "DediPath" - } - } - }, - "ipBlocklist": { - "result": false, - "details": { - "emailSpam": false, - "attackSource": false - } - }, - "tor": { - "result": false - }, - "vpn": { - "result": false, - "confidence": "high", - "originTimezone": "Europe/Berlin", - "originCountry": "unknown", - "methods": { - "timezoneMismatch": false, - "publicVPN": false, - "auxiliaryMobile": false, - "osMismatch": false, - "relay": false - } - }, - "proxy": { - "result": true, - "confidence": "high", - "details": { - "proxyType": "residential", - "lastSeenAt": "2025-08-12T13:00:00Z" - } - }, - "tampering": { - "result": false, - "anomalyScore": 0, - "antiDetectBrowser": false - }, - "clonedApp": { - "result": false - }, - "factoryReset": { - "time": "1970-01-01T00:00:00Z", - "timestamp": 0 - }, - "jailbroken": { - "result": false - }, - "frida": { - "result": false - }, - "privacySettings": { - "result": false - }, - "virtualMachine": { - "result": false - }, - "rawDeviceAttributes": { - "architecture": { - "value": 127 - }, - "audio": { - "value": 35.73832903057337 - }, - "canvas": { - "value": { - "Winding": true, - "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", - "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" - } - }, - "colorDepth": { - "value": 30 - }, - "colorGamut": { - "value": "srgb" - }, - "contrast": { - "value": 0 - }, - "cookiesEnabled": { - "value": true - } - }, - "highActivity": { - "result": false - }, - "locationSpoofing": { - "result": true - }, - "suspectScore": { - "result": 0 - }, - "velocity": { - "distinctIp": { - "intervals": { - "5m": 1, - "1h": 1, - "24h": 1 - } - }, - "distinctLinkedId": {}, - "distinctCountry": { - "intervals": { - "5m": 1, - "1h": 2, - "24h": 2 - } - }, - "events": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "ipEvents": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "distinctIpByLinkedId": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - }, - "distinctVisitorIdByLinkedId": { - "intervals": { - "5m": 1, - "1h": 5, - "24h": 5 - } - } - }, - "developerTools": { - "result": false - }, - "mitmAttack": { - "result": false - }, - "sdk": { - "platform": "js", - "version": "3.11.10" - }, - "replayed": false, - "supplementaryIds": { - "standard": { - "visitorId": "3HNey93AkBW6CRbxV6xP", - "visitorFound": true, - "confidence": { - "score": 0.97 - }, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": "2022-03-16T11:28:34.023Z", - "subscription": "2022-03-16T11:28:34.023Z" - } - }, - "highRecall": { - "visitorId": "3HNey93AkBW6CRbxV6xP", - "visitorFound": true, - "confidence": { - "score": 0.97 - }, - "firstSeenAt": { - "global": "2022-03-16T11:26:45.362Z", - "subscription": "2022-03-16T11:31:01.101Z" - }, - "lastSeenAt": { - "global": "2022-03-16T11:28:34.023Z", - "subscription": "2022-03-16T11:28:34.023Z" - } - } - }, - "proximity": { - "id": "w1aTfd4MCvl", - "precisionRadius": 10, - "confidence": 0.95 - } -} diff --git a/test/test_base_model.py b/test/test_base_model.py deleted file mode 100644 index edf1b67a..00000000 --- a/test/test_base_model.py +++ /dev/null @@ -1,135 +0,0 @@ -import pprint -import unittest -from typing import Dict - -from fingerprint_server_sdk import BaseModel - - -class ExampleModel(BaseModel): - """Example model that inherits from BaseModel for testing purposes.""" - swagger_types: Dict[str, str] = { - 'name': 'str', - 'details': 'dict', - 'items': 'list', - 'sub_model': 'object' - } - - attribute_map: Dict[str, str] = { - 'name': 'name', - 'details': 'details', - 'items': 'items', - 'sub_model': 'sub_model' - } - - nullable_map: Dict[str, str] = { - 'name': False, - 'details': False, - 'items': False, - 'sub_model': False - } - - def __init__(self, name=None, details=None, items=None, sub_model=None): - self.name = name - self.details = details - self.items = items - self.sub_model = sub_model - - -class SubModel(BaseModel): - """SubModel to be used in ExampleModel.""" - swagger_types: Dict[str, str] = { - 'id': 'int', - 'value': 'str' - } - - attribute_map: Dict[str, str] = { - 'id': 'id', - 'value': 'value' - } - - nullable_map: Dict[str, str] = { - 'id': False, - 'value': False - } - - def __init__(self, id=None, value=None): - self.id = id - self.value = value - - -class MyTestCase(unittest.TestCase): - - def setUp(self): - """Set up test fixtures.""" - self.sub_model = SubModel(id=1, value="sub_value") - self.model = ExampleModel(name="Test Model", details={"key": "value"}, items=[1, 2, 3], sub_model=self.sub_model) - - def test_to_dict(self): - """Test conversion to dictionary.""" - expected = { - 'name': "Test Model", - 'details': {"key": "value"}, - 'items': [1, 2, 3], - 'sub_model': {'id': 1, 'value': 'sub_value'} - } - self.assertEqual(self.model.to_dict(), expected) - - def test_to_dict_with_none(self): - """Test conversion to dictionary with None values.""" - model = ExampleModel(name=None, details=None, items=None, sub_model=None) - expected = {} - self.assertEqual(model.to_dict(), expected) - - def test_to_dict_with_dict_of_models(self): - """Test conversion to dictionary with a dictionary of models.""" - model = ExampleModel(name="Test Model", details={"key": "value"}, items=[1, 2, 3], sub_model={"sub": self.sub_model}) - expected = { - 'name': "Test Model", - 'details': {"key": "value"}, - 'items': [1, 2, 3], - 'sub_model': {'sub': {'id': 1, 'value': 'sub_value'}} - } - self.assertEqual(model.to_dict(), expected) - - def test_to_str(self): - """Test conversion to string.""" - expected_str = pprint.pformat(self.model.to_dict()) - self.assertEqual(self.model.to_str(), expected_str) - - def test_repr(self): - """Test __repr__ method.""" - expected_repr = self.model.to_str() - self.assertEqual(repr(self.model), expected_repr) - - def test_eq(self): - """Test equality comparison.""" - model1 = ExampleModel(name="Test Model", details={"key": "value"}, items=[1, 2, 3], sub_model=self.sub_model) - model2 = ExampleModel(name="Test Model", details={"key": "value"}, items=[1, 2, 3], sub_model=self.sub_model) - sub_model2 = SubModel(id=1, value="sub_value") - model3 = ExampleModel(name="Test Model", details={"key": "value"}, items=[1, 2, 3], sub_model=sub_model2) - self.assertTrue(model1 == model2) - self.assertTrue(model1 == model3) - - def test_ne(self): - """Test inequality comparison.""" - model1 = ExampleModel(name="Test Model", details={"key": "value"}, items=[1, 2, 3], sub_model=self.sub_model) - sub_model2 = SubModel(id=2, value="different_value") - model2 = ExampleModel(name="Test Model", details={"key": "value"}, items=[1, 2, 3], sub_model=sub_model2) - self.assertTrue(model1 != model2) - self.assertTrue(model1 != sub_model2) - self.assertTrue(model2 != sub_model2) - - def test_dict_inheritance(self): - """Test behavior when inheriting from dict.""" - class DictInheritedModel(dict, BaseModel): - swagger_types: Dict[str, str] = {} - attribute_map: Dict[str, str] = {} - - dict_inherited_model = DictInheritedModel() - dict_inherited_model["key"] = "value" - expected = {"key": "value"} - self.assertEqual(dict_inherited_model.to_dict(), expected) - - -if __name__ == '__main__': - unittest.main() diff --git a/test/test_fingerprint_api.py b/test/test_fingerprint_api.py index 821f770b..7b47446d 100644 --- a/test/test_fingerprint_api.py +++ b/test/test_fingerprint_api.py @@ -1,822 +1,382 @@ # coding: utf-8 -""" - Fingerprint Server API - - Fingerprint Server API allows you to get information about visitors and about individual events in a server environment. This API can be used for data exports, decision-making, and data analysis scenarios. # noqa: E501 - - OpenAPI spec version: 3 - Contact: support@fingerprint.com - Generated by: https://github.com/swagger-api/swagger-codegen.git -""" - -import io -import os import unittest - -import urllib3 - -from fingerprint_server_sdk import (Configuration, ErrorResponse, ErrorPlainResponse, ErrorCode, - RawDeviceAttributes, EventsUpdateRequest, RelatedVisitorsResponse, - SearchEventsResponse, SearchEventsResponseEvents, Products) -from fingerprint_server_sdk.api.fingerprint_api import FingerprintApi # noqa: E501 -from fingerprint_server_sdk.rest import KnownApiException, ApiException from urllib.parse import urlencode -from collections import Counter - -API_KEY = 'private_key' - -VERSION = '8.11.0' - -MOCK_GET_VISITORS_200_LIMIT_1 = 'get_visitors_200_limit_1.json' -MOCK_GET_VISITORS_200_LIMIT_500 = 'get_visitors_200_limit_500.json' - -MOCK_GET_VISITORS_ERROR_403 = 'get_visitors_403_forbidden.json' -MOCK_GET_VISITORS_ERROR_429 = 'get_visitors_429_too_many_requests.json' - -MOCK_DELETE_VISITORS_400_EMPTY_VISITOR_ID = '400_visitor_id_required.json' # errors/ -MOCK_DELETE_VISITORS_400_INCORRECT_VISITOR_ID = '400_visitor_id_invalid.json' # errors/ -MOCK_DELETE_VISITORS_403_FEATURE_NOT_ENABLED = '403_feature_not_enabled.json' # errors/ -MOCK_DELETE_VISITORS_403_TOKEN_NOT_FOUND = '403_token_not_found.json' # errors/ -MOCK_DELETE_VISITORS_403_TOKEN_REQUIRED = '403_token_required.json' # errors/ -MOCK_DELETE_VISITORS_403_WRONG_REGION = '403_wrong_region.json' # errors/ -MOCK_DELETE_VISITORS_403_SUBSCRIPTION_NOT_ACTIVE = '403_subscription_not_active.json' # errors/ -MOCK_DELETE_VISITORS_404_VISITOR_NOT_FOUND = '404_visitor_not_found.json' # errors/ -MOCK_DELETE_VISITORS_429_TO_MANY_REQUESTS = '429_too_many_requests.json' # errors/ - -MOCK_GET_EVENT_200 = 'get_event_200.json' -MOCK_GET_EVENT_200_BOTD_FAILED_ERROR = 'get_event_200_botd_failed_error.json' -MOCK_GET_EVENT_200_TOO_MANY_REQUESTS_ERROR = 'get_event_200_too_many_requests_error.json' -MOCK_GET_EVENT_200_IDENTIFICATION_FAILED_ERROR = 'get_event_200_identification_failed_error.json' -MOCK_GET_EVENT_200_ALL_ERRORS = 'get_event_200_all_errors.json' -MOCK_GET_EVENT_200_BROKEN_FORMAT = 'get_event_200_with_broken_format.json' - -MOCK_GET_EVENT_403_TOKEN_REQUIRED = '403_token_required.json' # errors/ -MOCK_GET_EVENT_403_TOKEN_NOT_FOUND = '403_token_not_found.json' # errors/ -MOCK_GET_EVENT_403_WRONG_REGION = '403_wrong_region.json' # errors/ -MOCK_GET_EVENT_404 = '404_request_not_found.json' # errors/ - -MOCK_UPDATE_EVENT_400 = '400_request_body_invalid.json' # errors/ -MOCK_UPDATE_EVENT_403_TOKEN_REQUIRED = '403_token_required.json' # errors/ -MOCK_UPDATE_EVENT_403_TOKEN_NOT_FOUND = '403_token_not_found.json' # errors/ -MOCK_UPDATE_EVENT_403_WRONG_REGION = '403_wrong_region.json' # errors/ -MOCK_UPDATE_EVENT_404 = '404_request_not_found.json' # errors/ -MOCK_UPDATE_EVENT_409 = '409_state_not_ready.json' # errors/ - -MOCK_GET_RELATED_VISITORS_200 = 'related-visitors/get_related_visitors_200.json' -MOCK_GET_RELATED_VISITORS_400 = '400_visitor_id_invalid.json' # errors/ -MOCK_GET_RELATED_VISITORS_403 = '403_feature_not_enabled.json' # errors/ -MOCK_GET_RELATED_VISITORS_404 = '404_visitor_not_found.json' # errors/ -MOCK_GET_RELATED_VISITORS_429 = '429_too_many_requests.json' # errors/ - -MOCK_SEARCH_EVENTS_200 = 'get_event_search_200.json' -MOCK_SEARCH_EVENTS_400 = '400_ip_address_invalid.json' # errors/ -MOCK_SEARCH_EVENTS_403 = '403_feature_not_enabled.json' # errors/ - -class MockPoolManager(object): - - def __init__(self, tc, request_headers=None): - if request_headers is None: - request_headers = {} - self._tc = tc - self._reqs = [] - self.request_headers = request_headers - - def expect_request(self, *args, **kwargs): - self._reqs.append((args, kwargs)) - @staticmethod - def get_mock_from_path(path): - return path.split('/')[-1] - - def request(self, *args, **kwargs): - self._tc.assertTrue(len(self._reqs) > 0) - (request_method, request_url), request_config = self._reqs.pop(0) - status = 200 - if request_config.get('status') is not None: - status = request_config.get('status') - request_config.pop('status') - - if request_config.get('method') != 'GET': - request_path = request_url.split('?')[0] - else: - request_path = request_url - - self._tc.maxDiff = None - self._tc.assertEqual(request_method, args[0]) - self._tc.assertEqual(request_url, args[1]) - - self._tc.assertEqual(set(request_config.keys()), set(kwargs.keys())) - if 'fields' in kwargs and 'fields' in request_config: - self._tc.assertEqual(Counter(kwargs['fields']), Counter(request_config['fields'])) - - # TODO Add support for more complex paths? - mock_file_by_first_argument = MockPoolManager.get_mock_from_path(request_path) - - if mock_file_by_first_argument == 'bad_text_data': - return urllib3.HTTPResponse(status=200, body='really bad data') - if mock_file_by_first_argument == 'bad_json_data': - return urllib3.HTTPResponse(status=200, body='{}') - if mock_file_by_first_argument == 'empty_event_answer': - return urllib3.HTTPResponse(status=200, body='{"products": {}}') - if mock_file_by_first_argument == 'delete_visitor': - return urllib3.HTTPResponse(status=200, body='OK') - if mock_file_by_first_argument == 'update_event': - return urllib3.HTTPResponse(status=200, body='OK') - try: - if mock_file_by_first_argument == 'related-visitors': - # Extract file name from visitor_id param - mock_file_by_first_argument = request_config['fields'][1][1] - if mock_file_by_first_argument == 'search': - if status == 200: - mock_file_by_first_argument = MOCK_SEARCH_EVENTS_200 - else: - mock_file_by_first_argument = request_config['fields'][2][1] - - path = './test/mocks/' + mock_file_by_first_argument - - if not os.path.isfile(path): - path = './test/mocks/errors/' + mock_file_by_first_argument - - with io.open(path, 'r', encoding='utf-8') as mock_file: - answer_mock = mock_file.read() - mock_file.close() - return urllib3.HTTPResponse(status=status, body=answer_mock, headers=self.request_headers) - except IOError as e: - print(e) - return urllib3.HTTPResponse(status=200, - body='{"visitorId": "%s", "visits": []}' % mock_file_by_first_argument) - pass +from fingerprint_server_sdk import Configuration, __version__, Event, EventSearch, EventUpdate, BadRequestException, \ + ErrorResponse, ErrorCode, ForbiddenException, NotFoundException, TooManyRequestsException, ConflictException +from fingerprint_server_sdk.api.fingerprint_api import FingerprintApi +from fingerprint_server_sdk.configuration import Region +from test.mock_pool_manager import MockPoolManager + +API_KEY = '' +REGION = Region.US class TestFingerprintApi(unittest.TestCase): """FingerprintApi unit test stubs""" - def setUp(self): - configuration = Configuration(api_key=API_KEY, region="us") - self.api = FingerprintApi(configuration) # noqa: E501 - self.integration_info = ('ii', 'fingerprint-pro-server-python-sdk/%s' % VERSION) + def setUp(self) -> None: + configuration = Configuration(api_key=API_KEY, region=REGION) + self.integration_info = ('ii', 'fingerprint-server-python-sdk/%s' % __version__) self.request_headers = { 'Content-Type': 'application/json', - 'Auth-API-Key': 'private_key', + 'Authorization': f'Bearer {API_KEY}', 'Accept': 'application/json', - 'User-Agent': 'Swagger-Codegen/%s/python' % VERSION + 'User-Agent': 'fingerprint-server-python-sdk/%s' % __version__ } + self.api = FingerprintApi(configuration) - def tearDown(self): + def tearDown(self) -> None: del self.api - pass @staticmethod - def get_visitors_path(visitor_id, region='us'): - domain = { - "us": "api.fpjs.io", - "eu": "eu.api.fpjs.io", - "ap": "ap.api.fpjs.io", - }.get(region, "api.fpjs.io") - return 'https://%s/visitors/%s' % (domain, visitor_id) + def get_event_path(event_id, region: Region = Region.US): + base = Configuration.get_host(region) + return '%s/events/%s' % (base, event_id) @staticmethod - def get_events_path(request_id, region='us'): - domain = { - "us": "api.fpjs.io", - "eu": "eu.api.fpjs.io", - "ap": "ap.api.fpjs.io", - }.get(region, "api.fpjs.io") - return 'https://%s/events/%s' % (domain, request_id) + def get_search_events_path(params: dict, region: Region = Region.US): + base = Configuration.get_host(region) + url = '%s/events' % base + if not params: + return url + + query_param_pairs: list[tuple[str, str]] = [] + for k, v in params.items(): + if v is None: + continue + if isinstance(v, (list, tuple)): + for item in v: + if item is None: + continue + query_param_pairs.append((k, str(item))) + else: + query_param_pairs.append((k, str(v))) + + return f"{url}?{urlencode(query_param_pairs, doseq=True)}" if query_param_pairs else url @staticmethod - def get_related_visitors_path(region='us'): - domain = { - "us": "api.fpjs.io", - "eu": "eu.api.fpjs.io", - "ap": "ap.api.fpjs.io", - }.get(region, "api.fpjs.io") - return 'https://%s/related-visitors' % domain + def delete_visitor_path(visitor_id, region: Region = Region.US): + base = Configuration.get_host(region) + return '%s/visitors/%s' % (base, visitor_id) - @staticmethod - def get_search_events_path(region='us'): - domain = { - "us": "api.fpjs.io", - "eu": "eu.api.fpjs.io", - "ap": "ap.api.fpjs.io", - }.get(region, "api.fpjs.io") - return 'https://%s/events/search' % domain - - def test_get_visits_correct_data(self): - """Test checks correct code run result in default scenario""" + def test_delete_visitor_data(self) -> None: + """Test case for delete_visitor_data + + Delete data by visitor ID + """ mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool + visitor_id = "XXXXXXXXXXXXXXXXXXXX" + mock_pool.expect_request('DELETE', TestFingerprintApi.delete_visitor_path(visitor_id), + body=None, response_text="{}", headers=self.request_headers, + preload_content=True, timeout=None) - mocks = [MOCK_GET_VISITORS_200_LIMIT_1, - MOCK_GET_VISITORS_200_LIMIT_500 - ] - - for mock_file in mocks: - mock_pool.expect_request('GET', - TestFingerprintApi.get_visitors_path(visitor_id=mock_file), - fields=[self.integration_info], headers=self.request_headers, - preload_content=True, timeout=None) - - for mock_file in mocks: - self.api.get_visits(mock_file) + self.api.delete_visitor_data(visitor_id) - def test_get_visits_error_403(self): - """Test checks correct code run result in case of 403 error for get_visits method""" + def test_delete_visitor_data_bad_request(self) -> None: + """Test case for delete_visitor_data with 400 Bad Request response""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool - mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=MOCK_GET_VISITORS_ERROR_403), - fields=[self.integration_info], headers=self.request_headers, - preload_content=True, timeout=None, status=403) - with self.assertRaises(KnownApiException) as context: - self.api.get_visits(MOCK_GET_VISITORS_ERROR_403) - self.assertEqual(context.exception.status, 403) - structured_error = context.exception.structured_error - self.assertIsInstance(structured_error, ErrorPlainResponse) + visitor_id = "invalid_visitor_id" + mock_pool.expect_request('DELETE',TestFingerprintApi.delete_visitor_path(visitor_id), body=None, headers=self.request_headers, preload_content=True, timeout=None, response_status_code=400, response_data_file="errors/400_visitor_id_invalid.json") - def test_get_visits_error_429(self): - """Test checks correct code run result in case of 429 error for get_visits method""" - mock_pool = MockPoolManager(self, request_headers={'Retry-After': '4'}) - self.api.api_client.rest_client.pool_manager = mock_pool - mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=MOCK_GET_VISITORS_ERROR_429), - fields=[self.integration_info], headers=self.request_headers, - preload_content=True, timeout=None, status=429) - with self.assertRaises(KnownApiException) as context: - self.api.get_visits(MOCK_GET_VISITORS_ERROR_429) - self.assertEqual(context.exception.status, 429) - self.assertIsInstance(context.exception.structured_error, ErrorPlainResponse) - self.assertEqual(context.exception.structured_error.retry_after, 4) + with self.assertRaises(BadRequestException) as context: + self.api.delete_visitor_data(visitor_id) - def test_get_visits_error_429_empty_retry_after(self): - """Test checks retry after value in exception in case of 429 error for get_visits method""" - mock_pool = MockPoolManager(self) - self.api.api_client.rest_client.pool_manager = mock_pool - mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=MOCK_GET_VISITORS_ERROR_429), - fields=[self.integration_info], headers=self.request_headers, - preload_content=True, timeout=None, status=429) - with self.assertRaises(KnownApiException) as context: - self.api.get_visits(MOCK_GET_VISITORS_ERROR_429) - self.assertEqual(context.exception.status, 429) - self.assertIsInstance(context.exception.structured_error, ErrorPlainResponse) - self.assertEqual(context.exception.structured_error.retry_after, 1) + self.assertEqual(context.exception.status, 400) + self.assertIsInstance(context.exception.data, ErrorResponse) + self.assertEqual(context.exception.data.error.code, ErrorCode.REQUEST_CANNOT_BE_PARSED) - def test_get_event_correct_data(self): - """Test checks correct code run result in default scenario""" + def test_delete_visitor_data_forbidden(self) -> None: + """Test case for delete_visitor_data with 403 Forbidden response""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool - mock_pool.expect_request('GET', TestFingerprintApi.get_events_path(request_id=MOCK_GET_EVENT_200), - fields=[self.integration_info], headers=self.request_headers, - preload_content=True, timeout=None) + visitor_id = "XXXXXXXXXXXXXXXXXXXX" + mock_pool.expect_request('DELETE', TestFingerprintApi.delete_visitor_path(visitor_id), body=None, + headers=self.request_headers, preload_content=True, timeout=None, + response_status_code=403, response_data_file="errors/403_feature_not_enabled.json") + + with self.assertRaises(ForbiddenException) as context: + self.api.delete_visitor_data(visitor_id) - event_response = self.api.get_event(MOCK_GET_EVENT_200) - event_response_dict = event_response.to_dict() - self.assertIsNone(event_response_dict["products"]["identification"]["data"]["last_seen_at"]["_global"]) - self.assertIsNone(event_response_dict["products"]["identification"]["data"]["last_seen_at"]["subscription"]) - self.assertIsInstance(event_response.products.raw_device_attributes.data, RawDeviceAttributes) + self.assertEqual(context.exception.status, 403) + self.assertIsInstance(context.exception.data, ErrorResponse) + self.assertEqual(context.exception.data.error.code, ErrorCode.FEATURE_NOT_ENABLED) - def test_get_event_errors_200(self): - """Test checks correct code run result in scenario of arrors in BotD or identification API""" + def test_delete_visitor_data_not_found(self) -> None: + """Test case for delete_visitor_data with 404 Not Found response""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool + visitor_id = "nonexistent_visitor_id" + mock_pool.expect_request('DELETE', TestFingerprintApi.delete_visitor_path(visitor_id), body=None, + headers=self.request_headers, preload_content=True, timeout=None, + response_status_code=404, response_data_file="errors/404_visitor_not_found.json") - mocks = [MOCK_GET_EVENT_200_BOTD_FAILED_ERROR, - MOCK_GET_EVENT_200_TOO_MANY_REQUESTS_ERROR, - MOCK_GET_EVENT_200_IDENTIFICATION_FAILED_ERROR, - MOCK_GET_EVENT_200_ALL_ERRORS] - - for mock_file in mocks: - mock_pool.expect_request('GET', - TestFingerprintApi.get_events_path(request_id=mock_file), - fields=[self.integration_info], headers=self.request_headers, - preload_content=True, timeout=None) + with self.assertRaises(NotFoundException) as context: + self.api.delete_visitor_data(visitor_id) - for mock_file in mocks: - self.api.get_event(mock_file) + self.assertEqual(context.exception.status, 404) + self.assertIsInstance(context.exception.data, ErrorResponse) + self.assertEqual(context.exception.data.error.code, ErrorCode.VISITOR_NOT_FOUND) - def test_get_event_error_403(self): - """Test checks correct code run result in case of 403 error for get_event method""" + def test_delete_visitor_data_too_many_requests(self) -> None: + """Test case for delete_visitor_data with 429 Too Many Requests response""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool - test_cases = [ - (MOCK_GET_EVENT_403_TOKEN_REQUIRED, ErrorCode.TOKENREQUIRED), - (MOCK_GET_EVENT_403_TOKEN_NOT_FOUND, ErrorCode.TOKENNOTFOUND), - (MOCK_GET_EVENT_403_WRONG_REGION, ErrorCode.WRONGREGION), - ] + visitor_id = "XXXXXXXXXXXXXXXXXXXX" + mock_pool.expect_request('DELETE', TestFingerprintApi.delete_visitor_path(visitor_id), body=None, + headers=self.request_headers, preload_content=True, timeout=None, + response_status_code=429, response_data_file="errors/429_too_many_requests.json", response_headers={'Retry-After': '5'}) - for (mock_file, error_code) in test_cases: - mock_pool.expect_request('GET', TestFingerprintApi.get_events_path(request_id=mock_file), - fields=[self.integration_info], headers=self.request_headers, - preload_content=True, timeout=None, status=403) + with self.assertRaises(TooManyRequestsException) as context: + self.api.delete_visitor_data(visitor_id) - for (mock_file, error_code) in test_cases: - with self.assertRaises(KnownApiException) as context: - self.api.get_event(mock_file) - self.assertEqual(context.exception.status, 403) - self.assertIsInstance(context.exception.structured_error, ErrorResponse) - self.assertEqual(context.exception.structured_error.error.code, error_code) + self.assertEqual(context.exception.status, 429) + self.assertIsInstance(context.exception.data, ErrorResponse) + self.assertEqual(context.exception.data.error.code, ErrorCode.TOO_MANY_REQUESTS) - def test_get_event_error_404(self): - """Test checks correct code run result in case of 404 error for get_event method""" - mock_pool = MockPoolManager(self) - self.api.api_client.rest_client.pool_manager = mock_pool - mock_pool.expect_request('GET', TestFingerprintApi.get_events_path(request_id=MOCK_GET_EVENT_404), - fields=[self.integration_info], headers=self.request_headers, - preload_content=True, timeout=None, status=404) - with self.assertRaises(KnownApiException) as context: - self.api.get_event(MOCK_GET_EVENT_404) - self.assertEqual(context.exception.status, 404) - self.assertIsInstance(context.exception.structured_error, ErrorResponse) - self.assertEqual(context.exception.structured_error.error.code, ErrorCode.REQUESTNOTFOUND) + def test_get_event(self) -> None: + """Test case for get_event - def test_get_event_empty_data(self): - """Test checks correct code running in case of there is no events""" + Get an event by event ID + """ mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool - mocked_id = 'empty_event_answer' - mock_pool.expect_request('GET', TestFingerprintApi.get_events_path(request_id=mocked_id), - fields=[self.integration_info], headers=self.request_headers, - preload_content=True, timeout=None) + event_id = "0000000000000.XXXXX" + mock_pool.expect_request('GET', TestFingerprintApi.get_event_path(event_id), + fields=[], headers=self.request_headers, + preload_content=True, timeout=None, response_data_file="events/get_event_200.json") - response = self.api.get_event(mocked_id) - self.assertIsNotNone(response.products) - for field in response.products.attribute_map.keys(): - value = getattr(response.products, field) - self.assertIsNone(value, f"Signal '{field}' is not empty") + event_response = self.api.get_event(event_id) + self.assertIsInstance(event_response, Event) - def test_get_visits_empty_answer(self): - """Test checks correct code running in case of there is no visits""" + def test_get_event_bad_request(self) -> None: + """Test case for get_event with 400 Bad Request response""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool - mocked_id = 'empty_answer' - mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=mocked_id), - fields=[self.integration_info], headers=self.request_headers, - preload_content=True, timeout=None) - self.assertEqual(self.api.get_visits(mocked_id).visits, []) + event_id = "invalid" + mock_pool.expect_request('GET', TestFingerprintApi.get_event_path(event_id), + fields=[], headers=self.request_headers, + preload_content=True, timeout=None, + response_status_code=400, response_data_file="errors/400_event_id_invalid.json") - def test_get_visits_bad_data(self): - """Test checks exception raising when client receives answer with bad data shape""" - mock_pool = MockPoolManager(self) - self.api.api_client.rest_client.pool_manager = mock_pool - test_cases = [ - ('bad_text_data', 'really bad data'), - ('bad_json_data', '{}') - ] - for (mocked_id, raw_data) in test_cases: - mock_pool.expect_request('GET', TestFingerprintApi.get_visitors_path(visitor_id=mocked_id), - fields=[self.integration_info], headers=self.request_headers, - preload_content=True, timeout=None) - with self.assertRaises(ApiException) as context: - self.api.get_visits(mocked_id) - self.assertEqual(context.exception.status, 200) - self.assertIsInstance(context.exception.reason, ValueError) - self.assertEqual(context.exception.body, raw_data) - - def test_init_with_region(self): - """Test that link for us region generates correct""" - regions_list = ["us", "eu", "ap"] - for region in regions_list: - configuration = Configuration(api_key=API_KEY, region=region) - del self.api - self.api = FingerprintApi(configuration) # noqa: E501 - mock_pool = MockPoolManager(self) - self.api.api_client.rest_client.pool_manager = mock_pool - mocked_id = 'empty_answer' - mock_pool.expect_request('GET', - TestFingerprintApi.get_visitors_path(visitor_id=mocked_id, region=region), - fields=[self.integration_info], headers=self.request_headers, - preload_content=True, timeout=None) - self.assertEqual(self.api.get_visits(mocked_id).visits, []) - - def test_delete_visitor_data(self): - """Test that delete visit method works""" - mock_pool = MockPoolManager(self) - self.api.api_client.rest_client.pool_manager = mock_pool - mocked_id = 'delete_visitor' - mock_pool.expect_request('DELETE', - TestFingerprintApi.get_visitors_path(visitor_id=mocked_id) + '?' + urlencode( - [self.integration_info]), - body='{}', headers=self.request_headers, preload_content=True, timeout=None) - self.api.delete_visitor_data(mocked_id) - - def test_delete_visitor_data_400_error(self): - """Test that delete visit method returns 400 error""" - mock_pool = MockPoolManager(self) - self.api.api_client.rest_client.pool_manager = mock_pool - test_cases = [ - (MOCK_DELETE_VISITORS_400_EMPTY_VISITOR_ID, ErrorCode.REQUESTCANNOTBEPARSED), - (MOCK_DELETE_VISITORS_400_INCORRECT_VISITOR_ID, ErrorCode.REQUESTCANNOTBEPARSED), - ] + with self.assertRaises(BadRequestException) as context: + self.api.get_event(event_id) - for (mock_file, error_code) in test_cases: - mock_pool.expect_request('DELETE', - TestFingerprintApi.get_visitors_path(visitor_id=mock_file) + '?' + urlencode( - [self.integration_info]), - body='{}', headers=self.request_headers, preload_content=True, timeout=None, - status=400) - for (mock_file, error_code) in test_cases: - with self.assertRaises(KnownApiException) as context: - self.api.delete_visitor_data(mock_file) - self.assertEqual(context.exception.status, 400) - self.assertIsInstance(context.exception.structured_error, ErrorResponse) - self.assertEqual(context.exception.structured_error.error.code, error_code) - - def test_delete_visitor_data_403_error(self): - """Test that delete visit method returns 403 error""" + self.assertEqual(context.exception.status, 400) + self.assertIsInstance(context.exception.data, ErrorResponse) + self.assertEqual(context.exception.data.error.code, ErrorCode.REQUEST_CANNOT_BE_PARSED) + + def test_get_event_forbidden(self) -> None: + """Test case for get_event with 403 Forbidden response""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool + event_id = "0000000000000.XXXXX" + mock_pool.expect_request('GET', TestFingerprintApi.get_event_path(event_id), + fields=[], headers=self.request_headers, + preload_content=True, timeout=None, + response_status_code=403, response_data_file="errors/403_secret_api_key_required.json") - test_cases = [ - (MOCK_DELETE_VISITORS_403_FEATURE_NOT_ENABLED, ErrorCode.FEATURENOTENABLED), - (MOCK_DELETE_VISITORS_403_TOKEN_NOT_FOUND, ErrorCode.TOKENNOTFOUND), - (MOCK_DELETE_VISITORS_403_TOKEN_REQUIRED, ErrorCode.TOKENREQUIRED), - (MOCK_DELETE_VISITORS_403_WRONG_REGION, ErrorCode.WRONGREGION), - (MOCK_DELETE_VISITORS_403_SUBSCRIPTION_NOT_ACTIVE, ErrorCode.SUBSCRIPTIONNOTACTIVE), - ] + with self.assertRaises(ForbiddenException) as context: + self.api.get_event(event_id) + + self.assertEqual(context.exception.status, 403) + self.assertIsInstance(context.exception.data, ErrorResponse) + self.assertEqual(context.exception.data.error.code, ErrorCode.SECRET_API_KEY_REQUIRED) - for (mock_file, error_code) in test_cases: - mock_pool.expect_request('DELETE', - TestFingerprintApi.get_visitors_path(visitor_id=mock_file) + '?' + urlencode( - [self.integration_info]), - body='{}', headers=self.request_headers, preload_content=True, timeout=None, - status=403) - - for (mock_file, error_code) in test_cases: - with self.assertRaises(KnownApiException) as context: - self.api.delete_visitor_data(mock_file) - self.assertEqual(context.exception.status, 403) - self.assertIsInstance(context.exception.structured_error, ErrorResponse) - self.assertEqual(context.exception.structured_error.error.code, error_code) - - def test_delete_visitor_data_404_error(self): - """Test that delete visit method returns 404 error""" + def test_get_event_not_found(self) -> None: + """Test case for get_event with 404 Not Found response""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool + event_id = "nonexistent_event_id" + mock_pool.expect_request('GET', TestFingerprintApi.get_event_path(event_id), + fields=[], headers=self.request_headers, + preload_content=True, timeout=None, + response_status_code=404, response_data_file="errors/404_event_not_found.json") - mock_pool.expect_request('DELETE', - TestFingerprintApi.get_visitors_path( - visitor_id=MOCK_DELETE_VISITORS_404_VISITOR_NOT_FOUND) + '?' + urlencode( - [self.integration_info]), - body='{}', headers=self.request_headers, preload_content=True, timeout=None, - status=404) + with self.assertRaises(NotFoundException) as context: + self.api.get_event(event_id) - with self.assertRaises(KnownApiException) as context: - self.api.delete_visitor_data(MOCK_DELETE_VISITORS_404_VISITOR_NOT_FOUND) self.assertEqual(context.exception.status, 404) - self.assertIsInstance(context.exception.structured_error, ErrorResponse) - self.assertEqual(context.exception.structured_error.error.code, ErrorCode.VISITORNOTFOUND) + self.assertIsInstance(context.exception.data, ErrorResponse) + self.assertEqual(context.exception.data.error.code, ErrorCode.EVENT_NOT_FOUND) - def test_delete_visitor_data_429_error(self): - """Test that delete visit method returns 429 error""" + def test_get_event_too_many_requests(self) -> None: + """Test case for get_event with 429 Too Many Requests response""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool + event_id = "0000000000000.XXXXX" + mock_pool.expect_request('GET', TestFingerprintApi.get_event_path(event_id), + fields=[], headers=self.request_headers, + preload_content=True, timeout=None, + response_status_code=429, response_data_file="errors/429_too_many_requests.json") - mock_pool.expect_request('DELETE', - TestFingerprintApi.get_visitors_path( - visitor_id=MOCK_DELETE_VISITORS_429_TO_MANY_REQUESTS) + '?' + urlencode( - [self.integration_info]), - body='{}', headers=self.request_headers, preload_content=True, timeout=None, - status=429) + with self.assertRaises(TooManyRequestsException) as context: + self.api.get_event(event_id) - with self.assertRaises(KnownApiException) as context: - self.api.delete_visitor_data(MOCK_DELETE_VISITORS_429_TO_MANY_REQUESTS) self.assertEqual(context.exception.status, 429) - self.assertIsInstance(context.exception.structured_error, ErrorResponse) - self.assertEqual(context.exception.structured_error.error.code, ErrorCode.TOOMANYREQUESTS) + self.assertIsInstance(context.exception.data, ErrorResponse) + self.assertEqual(context.exception.data.error.code, ErrorCode.TOO_MANY_REQUESTS) - def test_update_event(self): - """Test that update event method returns 200""" - test_cases = [ - (EventsUpdateRequest(linked_id='qwe'), '{"linkedId": "qwe"}'), - (EventsUpdateRequest(tag={'qwe': 123}), '{"tag": {"qwe": 123}}'), - (EventsUpdateRequest(suspect=False), '{"suspect": false}'), - (EventsUpdateRequest(suspect=True), '{"suspect": true}'), - (EventsUpdateRequest(linked_id='qwe', tag={'qwe': 123}, suspect=False), - '{"linkedId": "qwe", "tag": {"qwe": 123}, "suspect": false}') - ] + def test_search_events(self) -> None: + """Test case for search_events + + Search events + """ + params = { + 'limit': 2 + } mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool + mock_pool.expect_request('GET', TestFingerprintApi.get_search_events_path(params), + fields=[], headers=self.request_headers, + preload_content=True, timeout=None, response_data_file="events/search/get_event_search_200.json") + event_response = self.api.search_events(**params) + self.assertIsInstance(event_response, EventSearch) + self.assertEqual(len(event_response.events), 1) + first_event = event_response.events[0] + self.assertIsInstance(first_event, Event) + self.assertEqual(first_event.event_id, "1708102555327.NLOjmg") - mock_file = 'update_event' - - for (update_body, serialized_body) in test_cases: - mock_pool.expect_request('PUT', - TestFingerprintApi.get_events_path(request_id=mock_file) + '?' + urlencode( - [self.integration_info]), - headers=self.request_headers, preload_content=True, timeout=None, status=200, - body=serialized_body) - - self.api.update_event(update_body, mock_file) + def test_search_events_bad_request(self) -> None: + """Test case for search_events with 400 Bad Request response""" + params = {'limit': 99} - def test_update_event_400_error(self): - """Test that update event method returns 400 error""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool + mock_pool.expect_request('GET', TestFingerprintApi.get_search_events_path(params), + fields=[], headers=self.request_headers, + preload_content=True, timeout=None, + response_status_code=400, response_data_file="errors/400_request_body_invalid.json") - mock_pool.expect_request('PUT', - TestFingerprintApi.get_events_path(request_id=MOCK_UPDATE_EVENT_400) + '?' + urlencode( - [self.integration_info]), - headers=self.request_headers, preload_content=True, timeout=None, status=400, - body="{}") + with self.assertRaises(BadRequestException) as context: + self.api.search_events(**params) - with self.assertRaises(KnownApiException) as context: - self.api.update_event({}, MOCK_UPDATE_EVENT_400) self.assertEqual(context.exception.status, 400) - self.assertIsInstance(context.exception.structured_error, ErrorResponse) - self.assertEqual(context.exception.structured_error.error.code, ErrorCode.REQUESTCANNOTBEPARSED) - - def test_update_event_403_error(self): - """Test that delete visit method returns 403 error""" - mock_pool = MockPoolManager(self) - self.api.api_client.rest_client.pool_manager = mock_pool + self.assertIsInstance(context.exception.data, ErrorResponse) + self.assertEqual(context.exception.data.error.code, ErrorCode.REQUEST_CANNOT_BE_PARSED) - test_cases = [ - (MOCK_UPDATE_EVENT_403_TOKEN_REQUIRED, ErrorCode.TOKENREQUIRED), - (MOCK_UPDATE_EVENT_403_TOKEN_NOT_FOUND, ErrorCode.TOKENNOTFOUND), - (MOCK_UPDATE_EVENT_403_WRONG_REGION, ErrorCode.WRONGREGION), - ] + def test_search_events_forbidden(self) -> None: + """Test case for search_events with 403 Forbidden response""" + params = {'limit': 2} - for (mock_file, error_code) in test_cases: - mock_pool.expect_request('PUT', - TestFingerprintApi.get_events_path(request_id=mock_file) + '?' + urlencode( - [self.integration_info]), - headers=self.request_headers, preload_content=True, timeout=None, status=403, - body="{}") - - for (mock_file, error_code) in test_cases: - with self.assertRaises(KnownApiException) as context: - self.api.update_event({}, mock_file) - self.assertEqual(context.exception.status, 403) - self.assertIsInstance(context.exception.structured_error, ErrorResponse) - self.assertEqual(context.exception.structured_error.error.code, error_code) - - def test_update_event_404_error(self): - """Test that delete visit method returns 404 error""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool + mock_pool.expect_request('GET', TestFingerprintApi.get_search_events_path(params), + fields=[], headers=self.request_headers, + preload_content=True, timeout=None, + response_status_code=403, response_data_file="errors/403_secret_api_key_required.json") - mock_pool.expect_request('PUT', - TestFingerprintApi.get_events_path(request_id=MOCK_UPDATE_EVENT_404) + '?' + urlencode( - [self.integration_info]), - headers=self.request_headers, preload_content=True, timeout=None, status=404, - body="{}") + with self.assertRaises(ForbiddenException) as context: + self.api.search_events(**params) - with self.assertRaises(KnownApiException) as context: - self.api.update_event({}, MOCK_UPDATE_EVENT_404) - self.assertEqual(context.exception.status, 404) - self.assertIsInstance(context.exception.structured_error, ErrorResponse) - self.assertEqual(context.exception.structured_error.error.code, ErrorCode.REQUESTNOTFOUND) + self.assertEqual(context.exception.status, 403) + self.assertIsInstance(context.exception.data, ErrorResponse) + self.assertEqual(context.exception.data.error.code, ErrorCode.SECRET_API_KEY_REQUIRED) - def test_update_event_409_error(self): - """Test that delete visit method returns 409 error""" - mock_pool = MockPoolManager(self) - self.api.api_client.rest_client.pool_manager = mock_pool - mock_pool.expect_request('PUT', - TestFingerprintApi.get_events_path(request_id=MOCK_UPDATE_EVENT_409) + '?' + urlencode( - [self.integration_info]), - headers=self.request_headers, preload_content=True, timeout=None, status=409, - body="{}") + def test_update_event(self) -> None: + """Test case for update_event - with self.assertRaises(KnownApiException) as context: - self.api.update_event({}, MOCK_UPDATE_EVENT_409) - self.assertEqual(context.exception.status, 409) - self.assertIsInstance(context.exception.structured_error, ErrorResponse) - self.assertEqual(context.exception.structured_error.error.code, ErrorCode.STATENOTREADY) + Update an event + """ + test_cases = [ + (EventUpdate(linked_id='qwe'), '{"linkedId": "qwe"}'), + (EventUpdate(tags={'qwe': 123}), '{"tags": {"qwe": 123}}'), + (EventUpdate(suspect=False), '{"suspect": false}'), + (EventUpdate(suspect=True), '{"suspect": true}'), + (EventUpdate(linked_id='qwe', tags={'qwe': 123}, suspect=False), + '{"linkedId": "qwe", "tags": {"qwe": 123}, "suspect": false}') + ] - def test_get_event_wrong_shape(self): - """Test that get event method returns correct response""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool - mock_pool.expect_request('GET', TestFingerprintApi.get_events_path(request_id=MOCK_GET_EVENT_200_BROKEN_FORMAT), - fields=[self.integration_info], headers=self.request_headers, - preload_content=True, timeout=None) - - with io.open('./test/mocks/' + MOCK_GET_EVENT_200_BROKEN_FORMAT, encoding='utf-8') as raw_file: - raw_file_data = raw_file.read() - raw_file.close() + event_id = "0000000000000.XXXXX" - with self.assertRaises(ApiException) as context: - self.api.get_event(MOCK_GET_EVENT_200_BROKEN_FORMAT) - self.assertEqual(context.exception.status, 200) - self.assertIsInstance(context.exception.reason, ValueError) - self.assertEqual(context.exception.body, raw_file_data) - - def test_get_related_visitors(self): - """Test that get related visitors returns correct response""" - mock_pool = MockPoolManager(self) - self.api.api_client.rest_client.pool_manager = mock_pool - mock_pool.expect_request('GET', TestFingerprintApi.get_related_visitors_path(), - fields=[self.integration_info, ('visitor_id', MOCK_GET_RELATED_VISITORS_200)], - headers=self.request_headers, - preload_content=True, timeout=None) + for (update_body, serialized_body) in test_cases: + mock_pool.expect_request('PATCH', + TestFingerprintApi.get_event_path(event_id), + headers=self.request_headers, preload_content=True, timeout=None, + body=serialized_body, response_text="OK") - response = self.api.get_related_visitors(MOCK_GET_RELATED_VISITORS_200) - self.assertIsInstance(response, RelatedVisitorsResponse) + self.api.update_event(event_id, update_body) - def test_get_related_visitors_400(self): - """Test that related visitors returns 400 error""" + def test_update_event_bad_request(self) -> None: + """Test case for update_event with 400 Bad Request response""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool + event_id = "0000000000000.XXXXX" + update_body = EventUpdate(linked_id='test') + mock_pool.expect_request('PATCH', TestFingerprintApi.get_event_path(event_id), + headers=self.request_headers, preload_content=True, timeout=None, + body='{"linkedId": "test"}', + response_status_code=400, response_data_file="errors/400_request_body_invalid.json") - mock_pool.expect_request('GET', - TestFingerprintApi.get_related_visitors_path(), - fields=[self.integration_info, ('visitor_id', MOCK_GET_RELATED_VISITORS_400)], - headers=self.request_headers, preload_content=True, timeout=None, status=400, - ) + with self.assertRaises(BadRequestException) as context: + self.api.update_event(event_id, update_body) - with self.assertRaises(KnownApiException) as context: - self.api.get_related_visitors(MOCK_GET_RELATED_VISITORS_400) self.assertEqual(context.exception.status, 400) - self.assertIsInstance(context.exception.structured_error, ErrorResponse) - self.assertEqual(context.exception.structured_error.error.code, ErrorCode.REQUESTCANNOTBEPARSED) + self.assertIsInstance(context.exception.data, ErrorResponse) + self.assertEqual(context.exception.data.error.code, ErrorCode.REQUEST_CANNOT_BE_PARSED) - def test_get_related_visitors_403(self): - """Test that related visitors returns 403 error""" + def test_update_event_forbidden(self) -> None: + """Test case for update_event with 403 Forbidden response""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool + event_id = "0000000000000.XXXXX" + update_body = EventUpdate(suspect=True) + mock_pool.expect_request('PATCH', TestFingerprintApi.get_event_path(event_id), + headers=self.request_headers, preload_content=True, timeout=None, + body='{"suspect": true}', + response_status_code=403, response_data_file="errors/403_secret_api_key_required.json") - mock_pool.expect_request('GET', - TestFingerprintApi.get_related_visitors_path(), - fields=[self.integration_info, ('visitor_id', MOCK_GET_RELATED_VISITORS_403)], - headers=self.request_headers, preload_content=True, timeout=None, status=403, - ) + with self.assertRaises(ForbiddenException) as context: + self.api.update_event(event_id, update_body) - with self.assertRaises(KnownApiException) as context: - self.api.get_related_visitors(MOCK_GET_RELATED_VISITORS_403) self.assertEqual(context.exception.status, 403) - self.assertIsInstance(context.exception.structured_error, ErrorResponse) - self.assertEqual(context.exception.structured_error.error.code, ErrorCode.FEATURENOTENABLED) + self.assertIsInstance(context.exception.data, ErrorResponse) + self.assertEqual(context.exception.data.error.code, ErrorCode.SECRET_API_KEY_REQUIRED) - def test_get_related_visitors_404(self): - """Test that related visitors returns 404 error""" + def test_update_event_not_found(self) -> None: + """Test case for update_event with 404 Not Found response""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool + event_id = "nonexistent_event_id" + update_body = EventUpdate(suspect=True) + mock_pool.expect_request('PATCH', TestFingerprintApi.get_event_path(event_id), + headers=self.request_headers, preload_content=True, timeout=None, + body='{"suspect": true}', + response_status_code=404, response_data_file="errors/404_event_not_found.json") - mock_pool.expect_request('GET', - TestFingerprintApi.get_related_visitors_path(), - fields=[self.integration_info, ('visitor_id', MOCK_GET_RELATED_VISITORS_404)], - headers=self.request_headers, preload_content=True, timeout=None, status=404, - ) + with self.assertRaises(NotFoundException) as context: + self.api.update_event(event_id, update_body) - with self.assertRaises(KnownApiException) as context: - self.api.get_related_visitors(MOCK_GET_RELATED_VISITORS_404) self.assertEqual(context.exception.status, 404) - self.assertIsInstance(context.exception.structured_error, ErrorResponse) - self.assertEqual(context.exception.structured_error.error.code, ErrorCode.VISITORNOTFOUND) - - def test_get_related_visitors_429(self): - """Test that related visitors returns 429 error""" - mock_pool = MockPoolManager(self, request_headers={'Retry-After': '4'}) - self.api.api_client.rest_client.pool_manager = mock_pool - - mock_pool.expect_request('GET', - TestFingerprintApi.get_related_visitors_path(), - fields=[self.integration_info, ('visitor_id', MOCK_GET_RELATED_VISITORS_429)], - headers=self.request_headers, preload_content=True, timeout=None, status=429, - ) - - with self.assertRaises(KnownApiException) as context: - self.api.get_related_visitors(MOCK_GET_RELATED_VISITORS_429) - self.assertEqual(context.exception.status, 429) - self.assertIsInstance(context.exception.structured_error, ErrorResponse) - self.assertEqual(context.exception.structured_error.error.code, ErrorCode.TOOMANYREQUESTS) - self.assertEqual(context.exception.structured_error.retry_after, 4) - - def test_search_events_only_limit(self): - """Test that search events returns 200 with only limit param""" - mock_pool = MockPoolManager(self) - self.api.api_client.rest_client.pool_manager = mock_pool - mock_pool.expect_request('GET', TestFingerprintApi.get_search_events_path(), - fields=[self.integration_info, ('limit', 1)], - headers=self.request_headers, preload_content=True, timeout=None) - - response = self.api.search_events(1) - self.assertIsInstance(response, SearchEventsResponse) - event_response = response.events[0] - self.assertIsInstance(event_response, SearchEventsResponseEvents) - self.assertIsInstance(event_response.products, Products) - self.assertIsInstance(event_response.products.raw_device_attributes.data, RawDeviceAttributes) - - def test_search_events_all_params(self): - """Test that search events returns 200 with all params""" - base_params = { - 'limit': 100, - 'visitor_id': MOCK_SEARCH_EVENTS_200, - 'bot': 'good', - 'ip_address': '10.0.0.0/24', - 'linked_id': 'some_linked_id', - 'start': 1582299576511, - 'end': 1582299576513, - 'reverse': True, - 'suspect': False, - 'anti_detect_browser': True, - 'cloned_app': True, - 'factory_reset': True, - 'frida': True, - 'jailbroken': True, - 'min_suspect_score': .5, - 'privacy_settings': True, - 'root_apps': True, - 'tampering': True, - 'virtual_machine': True, - 'vpn': True, - 'vpn_confidence': 'medium', - 'emulator': True, - 'incognito': True, - 'ip_blocklist': True, - 'datacenter': True, - 'developer_tools': True, - 'location_spoofing': True, - 'mitm_attack': True, - 'proxy': True, - 'sdk_version': 'testSdkVersion', - 'sdk_platform': 'testSdkPlatform', - 'proximity_id': 'testProximityId', - 'proximity_precision_radius': 10, - } - - params = base_params.copy() - params.update({'environment': ['env1', 'env2']}) + self.assertIsInstance(context.exception.data, ErrorResponse) + self.assertEqual(context.exception.data.error.code, ErrorCode.EVENT_NOT_FOUND) - multivalue_expected_params = [ - ('environment', 'env1'), - ('environment', 'env2'), - ] - - expected_fields = [self.integration_info] + list(base_params.items()) + multivalue_expected_params - - mock_pool = MockPoolManager(self) - self.api.api_client.rest_client.pool_manager = mock_pool - mock_pool.expect_request( - 'GET', - TestFingerprintApi.get_search_events_path(), - fields=expected_fields, - headers=self.request_headers, - preload_content=True, - timeout=None - ) - - response = self.api.search_events(**params) - - self.assertIsInstance(response, SearchEventsResponse) - event_response = response.events[0] - self.assertIsInstance(event_response, SearchEventsResponseEvents) - self.assertIsInstance(event_response.products, Products) - self.assertIsInstance(event_response.products.raw_device_attributes.data, RawDeviceAttributes) - - def test_search_events_partial_params(self): - """Test that search events returns 200 with partial params provided""" - LIMIT = 100 - PAGINATION_KEY = '1741187431959' - BOT = 'good' - LINKED_ID = 'some_linked_id' - START = 1582299576511 - REVERSE = True - mock_pool = MockPoolManager(self) - self.api.api_client.rest_client.pool_manager = mock_pool - mock_pool.expect_request('GET', TestFingerprintApi.get_search_events_path(), - fields=[self.integration_info, ('limit', LIMIT), ('pagination_key', PAGINATION_KEY), - ('visitor_id', MOCK_SEARCH_EVENTS_200), ('bot', BOT), - ('linked_id', LINKED_ID), ('start', START), ('reverse', REVERSE)], - headers=self.request_headers, preload_content=True, timeout=None) - - response = self.api.search_events(LIMIT, visitor_id=MOCK_SEARCH_EVENTS_200, bot=BOT, linked_id=LINKED_ID, - start=START, reverse=REVERSE, pagination_key=PAGINATION_KEY) - self.assertIsInstance(response, SearchEventsResponse) - event_response = response.events[0] - self.assertIsInstance(event_response, SearchEventsResponseEvents) - self.assertIsInstance(event_response.products, Products) - self.assertIsInstance(event_response.products.raw_device_attributes.data, RawDeviceAttributes) - - def test_search_events_400(self): - """Test that search events returns 400 invalid ip address""" + def test_update_event_conflict(self) -> None: + """Test case for update_event with 409 Conflict response""" mock_pool = MockPoolManager(self) self.api.api_client.rest_client.pool_manager = mock_pool - mock_pool.expect_request('GET', TestFingerprintApi.get_search_events_path(), - fields=[self.integration_info, ('limit', 1), ('visitor_id', MOCK_SEARCH_EVENTS_400)], - headers=self.request_headers, preload_content=True, timeout=None, status=400) + event_id = "0000000000000.XXXXX" + update_body = EventUpdate(suspect=True) + mock_pool.expect_request('PATCH', TestFingerprintApi.get_event_path(event_id), + headers=self.request_headers, preload_content=True, timeout=None, + body='{"suspect": true}', + response_status_code=409, response_data_file="errors/409_state_not_ready.json") - with self.assertRaises(KnownApiException) as context: - self.api.search_events(1, visitor_id=MOCK_SEARCH_EVENTS_400) - self.assertEqual(context.exception.status, 400) - self.assertIsInstance(context.exception.structured_error, ErrorResponse) - self.assertEqual(context.exception.structured_error.error.code, ErrorCode.REQUESTCANNOTBEPARSED) + with self.assertRaises(ConflictException) as context: + self.api.update_event(event_id, update_body) - def test_search_events_403(self): - """Test that search events returns 403 feature not enabled""" - mock_pool = MockPoolManager(self) - self.api.api_client.rest_client.pool_manager = mock_pool - mock_pool.expect_request('GET', TestFingerprintApi.get_search_events_path(), - fields=[self.integration_info, ('limit', 1), ('visitor_id', MOCK_SEARCH_EVENTS_403)], - headers=self.request_headers, preload_content=True, timeout=None, status=403) + self.assertEqual(context.exception.status, 409) + self.assertIsInstance(context.exception.data, ErrorResponse) + self.assertEqual(context.exception.data.error.code, ErrorCode.STATE_NOT_READY) - with self.assertRaises(KnownApiException) as context: - self.api.search_events(1, visitor_id=MOCK_SEARCH_EVENTS_403) - self.assertEqual(context.exception.status, 403) - self.assertIsInstance(context.exception.structured_error, ErrorResponse) - self.assertEqual(context.exception.structured_error.error.code, ErrorCode.FEATURENOTENABLED) if __name__ == '__main__': unittest.main() diff --git a/test/test_sealed.py b/test/test_sealed.py index 3aa5bacf..0e4def76 100644 --- a/test/test_sealed.py +++ b/test/test_sealed.py @@ -1,12 +1,8 @@ import base64 -import io -import json import unittest -from unittest import expectedFailure -from fingerprint_server_sdk import ApiClientDeserializer, DecryptionAlgorithm, DecryptionKey, \ - unseal_event_response, UnsealError, UnsealAggregateError, EventsGetResponse, Products, \ - ProductIdentification, BrowserDetails +from fingerprint_server_sdk import DecryptionAlgorithm, DecryptionKey, \ + unseal_event_response, UnsealError, UnsealAggregateError, Event class TestSealed(unittest.TestCase): valid_key = base64.b64decode('p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53=') @@ -14,88 +10,177 @@ class TestSealed(unittest.TestCase): def test_unseal_aes256gcm(self): sealed_result = '''{ - "products": { - "identification": { - "data": { - "visitorId": "2ZEDCZEfOfXjEmMuE3tq", - "requestId": "1703067132750.Z5hutJ", - "browserDetails": { - "browserName": "Safari", - "browserMajorVersion": "17", - "browserFullVersion": "17.3", - "os": "Mac OS X", - "osVersion": "10.15.7", - "device": "Other", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15" - }, - "incognito": false, - "ip": "::1", - "ipLocation": { - "accuracyRadius": 1000, - "latitude": 59.3241, - "longitude": 18.0517, - "postalCode": "100 05", - "timezone": "Europe/Stockholm", - "city": { - "name": "Stockholm" - }, - "country": { - "code": "SE", - "name": "Sweden" - }, - "continent": { - "code": "EU", - "name": "Europe" - }, - "subdivisions": [ - { - "isoCode": "AB", - "name": "Stockholm County" - } - ] - }, - "timestamp": 1703067136286, - "time": "2023-12-20T10:12:16Z", - "url": "http://localhost:8080/", - "tag": { - "foo": "bar" - }, - "confidence": { - "score": 1 - }, - "visitorFound": true, - "firstSeenAt": { - "global": "2023-12-15T12:13:55.103Z", - "subscription": "2023-12-15T12:13:55.103Z" - }, - "lastSeenAt": { - "global": "2023-12-19T11:39:51.52Z", - "subscription": "2023-12-19T11:39:51.52Z" - }, - "replayed": false - } + "linked_id": "somelinkedId", + "tags": {}, + "timestamp": 1708102555327, + "event_id": "1708102555327.NLOjmg", + "url": "https://www.example.com/login?hope{this{works[!", + "ip_address": "61.127.217.15", + "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....", + "browser_details": { + "browser_name": "Chrome", + "browser_major_version": "74", + "browser_full_version": "74.0.3729", + "os": "Windows", + "os_version": "7", + "device": "Other" + }, + "identification": { + "visitor_id": "Ibk1527CUFmcnjLwIs4A9", + "confidence": { + "score": 0.97, + "version": "1.1" }, - "botd": { - "data": { - "bot": { - "result": "notDetected" - }, - "meta": { - "foo": "bar" - }, - "url": "http://localhost:8080/", - "ip": "::1", - "time": "2023-12-20T10:12:13.894Z", - "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3 Safari/605.1.15", - "requestId": "1703067132750.Z5hutJ" - } + "visitor_found": false, + "first_seen_at": 1708102555327, + "last_seen_at": 1708102555327 + }, + "supplementary_id_high_recall": { + "visitor_id": "3HNey93AkBW6CRbxV6xP", + "visitor_found": true, + "confidence": { + "score": 0.97, + "version": "1.1" + }, + "first_seen_at": 1708102555327, + "last_seen_at": 1708102555327 + }, + "bot": "not_detected", + "root_apps": false, + "emulator": false, + "ip_info": { + "v4": { + "address": "94.142.239.124", + "geolocation": { + "accuracy_radius": 20, + "latitude": 50.05, + "longitude": 14.4, + "postal_code": "150 00", + "timezone": "Europe/Prague", + "city_name": "Prague", + "country_code": "CZ", + "country_name": "Czechia", + "continent_code": "EU", + "continent_name": "Europe", + "subdivisions": [ + { + "iso_code": "10", + "name": "Hlavni mesto Praha" + } + ] + }, + "asn": "7922", + "asn_name": "COMCAST-7922", + "asn_network": "73.136.0.0/13", + "datacenter_result": true, + "datacenter_name": "DediPath" + }, + "v6": { + "address": "2001:db8:3333:4444:5555:6666:7777:8888", + "geolocation": { + "accuracy_radius": 5, + "latitude": 49.982, + "longitude": 36.2566, + "postal_code": "10112", + "timezone": "Europe/Berlin", + "city_name": "Berlin", + "country_code": "DE", + "country_name": "Germany", + "continent_code": "EU", + "continent_name": "Europe", + "subdivisions": [ + { + "iso_code": "BE", + "name": "Land Berlin" + } + ] + }, + "asn": "6805", + "asn_name": "Telefonica Germany", + "asn_network": "2a02:3100::/24", + "datacenter_result": false, + "datacenter_name": "" } - } + }, + "ip_blocklist": { + "email_spam": false, + "attack_source": false, + "tor_node": false + }, + "proxy": true, + "proxy_confidence": "low", + "proxy_details": { + "proxy_type": "residential", + "last_seen_at": 1708102555327 + }, + "vpn": false, + "vpn_confidence": "high", + "vpn_origin_timezone": "Europe/Berlin", + "vpn_origin_country": "unknown", + "vpn_methods": { + "timezone_mismatch": false, + "public_vpn": false, + "auxiliary_mobile": false, + "os_mismatch": false, + "relay": false + }, + "incognito": false, + "tampering": false, + "tampering_details": { + "anomaly_score": 0.1955, + "anti_detect_browser": false + }, + "cloned_app": false, + "factory_reset_timestamp": 0, + "jailbroken": false, + "frida": false, + "privacy_settings": false, + "virtual_machine": false, + "location_spoofing": false, + "velocity": { + "distinct_ip": { + "5_minutes": 1, + "1_hour": 1, + "24_hours": 1 + }, + "distinct_country": { + "5_minutes": 1, + "1_hour": 2, + "24_hours": 2 + }, + "events": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "ip_events": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "distinct_ip_by_linked_id": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "distinct_visitor_id_by_linked_id": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + } + }, + "developer_tools": false, + "mitm_attack": false, + "sdk": { + "platform": "js", + "version": "3.11.10" + }, + "replayed": false }''' - expected_result = ApiClientDeserializer.deserialize(json.loads(sealed_result), 'EventsGetResponse') + expected_result = Event.from_json(sealed_result) sealed_data = base64.b64decode( - 'noXc7etL3WJZn6BSZLV4tcjBr0uFr4+qvDrSdcZ9M1bb1MB+/le7UKY+6FJNFQHBm64X1/GVE3xkjBuW4mveH3jEK8cOSWBhl71tgYegxm+MkRHRAYM7vDPOS4sw1rb6xqdVZ/sovFP6yIqNRhrKWdO/B99vtext6l/NWlmXfTCoX3LHXYK94yr0O4eptZBwBK70fMB0YBR6iw1/zJOs9W6LZ50d2ml4wl/Ah1qJKmQueraKJaIIAQEUNbOm8ReoRsDrAWsVbIv2IscKEGNwZEjd5V1nZFkHLzOUQGKLjFQqGxFFmxV/PuDZve/lHyjmn9q3+UFJzJKXVOLyPTjhwQdjouvdJn5k9FEpH0hua+/KgSrcIKnKXtk7zPXAFEo9FeQJA3XJH8+dHcDgadl6/FIrAxtqrMRbngp7wKpltIySaCMi9P0qYoWnVvQC3gyc5xoW00UxcdPfXnQR9F21QfZ3EzULIbJQ5sUjwcg31h/IszlBXueHnGEiszhdXAIOHU865FLJsvLAqZD1A+R9/gurAG3kck1A/t8Vf8znmd8WeMezj0KObenNhHeDpjAFcAZS6evr8gDb/IZ6Ge3CUzBvfXUZNNlhEujS6yo/eK/plFACtbbIMiosQq1zRIMlLmAvlb42jNAwPtjb2JQhO+AP+EUUEe8nTDjyytZIHThzuipfVIRpxEbV9MdYt0Ri5EqI4LA2YiAMmphdaio4grw51oD63GgSeKXEUi1YoLUGmXCNbn5Q1vcQiGd5O+TJ3WzacMcBcPDFd9ZxVxe8qmn3gXWXlod4NmS5nhksiiYY0UUWqMMqEEZou5LhwV8FrQdebBNDQ9GKoGkaadJoJzkKZWYlO0ju5EYTlQCUTvHenefVmrHUccteVuwz6Fsp3d5p3SBGumpbdECjUMnO2OWkOzf4S0TArorl8KnB3TidzsM94eTr0M+/uz910HmnOqIYms80IBV3yFS0CEvcvuyjnEpW/vfOIbs0qFycNx34Hltqa0PdSSzcrFfMJjR5h9g/hORaO4MNXu9ORw==') + 'noXc7Xu7PIKu1tbMkMxLbQG4XU46Bv5dED98hqTkPYZnmb8PG81Q83Kpg541Vt4NQdkzfezDSVk8FP9ZzJ08L0MMb4S8bT78c10Op1LyKwZU6DGr1e3V+ZWcNzHVG1rPoL+eUHN6yR9MQp8/CmSUBQUPOOAUXdoqWohbfIGxoQIuQ5BtfpSJuYD6kTyswSi56wxzY/s24dMwgS2KnA81Y1pdi3ZVJKBdwGYGg4T5Dvcqu0GWv3sScKD9b4Tagfbe2m8nbXY/QtN770c7J1xo/TNXXdq4lyqaMyqIayHOwRBP58tNF8mACusm1pogOVIt456wIMetCGKxicPJr7m/Q02ONzhkMtzzXwgwriglGHfM7UbtTsCytCBP7J2vp0tEkHiq/X3qtuvSLJqNyRzwFJhgisKGftc5CIaT2VxVKKxkL/6Ws6FPm4sQB1UGtMCMftKpyb1lFzG9lwFkKvYN9+FGtvRM50mbrzz7ONDxbwykkxihAab36MIuk7dfhvnVLFAjrpuCkEFdWrtjVyWmM0xVeXpEUtP6Ijk5P+VuPZ1alV/JV1q4WvfrGMizEZbwbp6eQZg9mwKe4IX+FVi7sPF2S/CCLI/d90S5Yz6bBP9uiQ3pCVlYbVOkpwS0YQxnR+h5J50qodY7LuswNO5VlEgI0ztkjPQBr8koT4SM54X2z14tA2tKCxSv1psEL5HOk4IWN+9f3RVfDKBDruDiDd+BtZquhYLmOFat9K4h41NrPGAqv5tKmmJtx3llMs6LFHPKBlNlI5zgqE7T47xv2AWw5nqWM107t8lpRETIgJx+YN/Jv6byJSQm7afaeDtHXGceMPOKMziH1XgsiQiS56OsmyyRgaq5YCmMuaPw8gcgVa7RNZSafkP34aQBAuJOA3JFs5xcYcubKutD3h1mk697A8vwdtR/Gj0zTvuUnQ/9o3qHSLseAEIiY9/dS6WJnKXRKTonQi2F6DV9NTzFVQl99AH22jq6lIsjbEEKcq/ydFDUpgAq4lyp9nPBHuPXSojdG+1BWuUyjYykaqnLzzqKgRalGzeWmRHd2qeNw8Bz5OWYBw82C3gHRS2BB9VquIgEYktDvgJ5yRfDYkp8qgxHoYeR88ijccWgdvk+WH78OPdwqA7rqdAYcWqn9KNozoxuYddc0fnrHbgaWpanCmPp0gNEeb4r+i9FDGPSkgYBdyrEPHblsDN/Ad1dhLIHEDEtQyv13s6tDRgLVvhowrzqIM+5cm/abyTDhXzSYDfCw2Wf90cBOMsbQBB2N2YRqnrpA50PGp+0IwlPL7qZj1N4JGhvQD0ux8Ood6AiXpdguj7DMP+T0laHIjWee5/xGZB6g3EsCdOZJjVj7hSE/L3eV4No0WcLqJ5DPOgw+FnvQpxndCTc8DW83tNm624lm7scu0A499vEFj1dhtq5gUxsGcqzm09+Vk2V/d0sa77Xocqe3bcfS5lXc/pHrOc1qKlK8kTr2AYNwjeJJ14euuin361WBETd1I6n8eIs02HyBas09o9lT7Nq05jsnbxej6d0q6GH7IYusiBFTJaAZ6UXOV5i1NOcw9jaGyHms3M2N/b2cmXFYTIFZSjSfbqoI6YZF73sMPhEZqfZ5Jjq+ZLMC3A+yFPFJOW/0oolUGbcC8TBVmLi37Z9Wgc338w2Jf+I94SdViku') result = unseal_event_response(sealed_data, [ DecryptionKey(self.invalid_key, DecryptionAlgorithm['Aes256Gcm']), @@ -103,15 +188,12 @@ def test_unseal_aes256gcm(self): ]) self.assertEqual(result, expected_result) - self.assertIsInstance(result, EventsGetResponse) - self.assertIsInstance(result.products, Products) - self.assertIsInstance(result.products.identification, ProductIdentification) - self.assertIsInstance(result.products.identification.data.browser_details, BrowserDetails) + self.assertIsInstance(result, Event) def test_unseal_invalid_header(self): sealed_data = base64.b64decode( - 'xzXc7SXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNKlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw==') + 'noXc7xXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNxlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw==') with self.assertRaisesRegex(ValueError, "Invalid sealed data header"): unseal_event_response(sealed_data, [ @@ -121,7 +203,7 @@ def test_unseal_invalid_header(self): def test_unseal_invalid_algorithm(self): sealed_data = base64.b64decode( - 'noXc7SXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNKlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw==') + 'noXc7Xu7PIKu1tbMkMxLbQG4XU46Bv5dED98hqTkPYZnmb8PG81Q83Kpg541Vt4NQdkzfezDSVk8FP9ZzJ08L0MMb4S8bT78c10Op1LyKwZU6DGr1e3V+ZWcNzHVG1rPoL+eUHN6yR9MQp8/CmSUBQUPOOAUXdoqWohbfIGxoQIuQ5BtfpSJuYD6kTyswSi56wxzY/s24dMwgS2KnA81Y1pdi3ZVJKBdwGYGg4T5Dvcqu0GWv3sScKD9b4Tagfbe2m8nbXY/QtN770c7J1xo/TNXXdq4lyqaMyqIayHOwRBP58tNF8mACusm1pogOVIt456wIMetCGKxicPJr7m/Q02ONzhkMtzzXwgwriglGHfM7UbtTsCytCBP7J2vp0tEkHiq/X3qtuvSLJqNyRzwFJhgisKGftc5CIaT2VxVKKxkL/6Ws6FPm4sQB1UGtMCMftKpyb1lFzG9lwFkKvYN9+FGtvRM50mbrzz7ONDxbwykkxihAab36MIuk7dfhvnVLFAjrpuCkEFdWrtjVyWmM0xVeXpEUtP6Ijk5P+VuPZ1alV/JV1q4WvfrGMizEZbwbp6eQZg9mwKe4IX+FVi7sPF2S/CCLI/d90S5Yz6bBP9uiQ3pCVlYbVOkpwS0YQxnR+h5J50qodY7LuswNO5VlEgI0ztkjPQBr8koT4SM54X2z14tA2tKCxSv1psEL5HOk4IWN+9f3RVfDKBDruDiDd+BtZquhYLmOFat9K4h41NrPGAqv5tKmmJtx3llMs6LFHPKBlNlI5zgqE7T47xv2AWw5nqWM107t8lpRETIgJx+YN/Jv6byJSQm7afaeDtHXGceMPOKMziH1XgsiQiS56OsmyyRgaq5YCmMuaPw8gcgVa7RNZSafkP34aQBAuJOA3JFs5xcYcubKutD3h1mk697A8vwdtR/Gj0zTvuUnQ/9o3qHSLseAEIiY9/dS6WJnKXRKTonQi2F6DV9NTzFVQl99AH22jq6lIsjbEEKcq/ydFDUpgAq4lyp9nPBHuPXSojdG+1BWuUyjYykaqnLzzqKgRalGzeWmRHd2qeNw8Bz5OWYBw82C3gHRS2BB9VquIgEYktDvgJ5yRfDYkp8qgxHoYeR88ijccWgdvk+WH78OPdwqA7rqdAYcWqn9KNozoxuYddc0fnrHbgaWpanCmPp0gNEeb4r+i9FDGPSkgYBdyrEPHblsDN/Ad1dhLIHEDEtQyv13s6tDRgLVvhowrzqIM+5cm/abyTDhXzSYDfCw2Wf90cBOMsbQBB2N2YRqnrpA50PGp+0IwlPL7qZj1N4JGhvQD0ux8Ood6AiXpdguj7DMP+T0laHIjWee5/xGZB6g3EsCdOZJjVj7hSE/L3eV4No0WcLqJ5DPOgw+FnvQpxndCTc8DW83tNm624lm7scu0A499vEFj1dhtq5gUxsGcqzm09+Vk2V/d0sa77Xocqe3bcfS5lXc/pHrOc1qKlK8kTr2AYNwjeJJ14euuin361WBETd1I6n8eIs02HyBas09o9lT7Nq05jsnbxej6d0q6GH7IYusiBFTJaAZ6UXOV5i1NOcw9jaGyHms3M2N/b2cmXFYTIFZSjSfbqoI6YZF73sMPhEZqfZ5Jjq+ZLMC3A+yFPFJOW/0oolUGbcC8TBVmLi37Z9Wgc338w2Jf+I94SdViku') with self.assertRaisesRegex(ValueError, "Unsupported decryption algorithm: invalid"): unseal_event_response(sealed_data, [ diff --git a/update_event_example.py b/update_event_example.py index f8522f6b..a6c86b68 100644 --- a/update_event_example.py +++ b/update_event_example.py @@ -3,7 +3,8 @@ import fingerprint_server_sdk from fingerprint_server_sdk.rest import ApiException -from fingerprint_server_sdk.models import EventsUpdateRequest +from fingerprint_server_sdk.configuration import Region +from fingerprint_server_sdk.models import EventUpdate from dotenv import load_dotenv @@ -17,19 +18,20 @@ print(f'args: {args.linked_id}, {args.tag}, {args.suspect}') # configure +region_str = os.environ.get("REGION", "us").upper() configuration = fingerprint_server_sdk.Configuration( - api_key=os.environ["PRIVATE_KEY"], region=os.environ.get("REGION", "us")) + api_key=os.environ["PRIVATE_KEY"], region=Region[region_str]) # create an instance of the API class api_instance = fingerprint_server_sdk.FingerprintApi(configuration) -request_id = os.environ["REQUEST_ID_TO_UPDATE"] +event_id = os.environ["EVENT_ID_TO_UPDATE"] try: - updateBody = EventsUpdateRequest(**vars(args)) + updateBody = EventUpdate(**vars(args)) print(f'updateBody: {updateBody}') - api_instance.update_event(updateBody, request_id) + api_instance.update_event(event_id, updateBody) except ApiException as e: - print("Exception when calling DefaultApi->update_event: %s\n" % e) + print("Exception when calling update_event operation: %s\n" % e) exit(1) print("Visitor data updated!")