From c2e99cd104e6ab9c7e9f670636d984e829eb2747 Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Thu, 11 Jul 2024 21:12:39 +0200 Subject: [PATCH] feat: update schema BREAKING CHANGE: rename `error_event403_response`, `error_event403_response_error`, `many_requests_response` to `common403_error_response`, `error_common403_response` `too_many_requests_response` --- .swagger-codegen-ignore | 4 +- README.md | 10 ++-- ...onseError.md => Common403ErrorResponse.md} | 4 +- ...3Response.md => ErrorCommon403Response.md} | 4 +- docs/ErrorEvent404ResponseError.md | 2 +- docs/FingerprintApi.md | 16 +++--- docs/SignalResponseIncognito.md | 2 +- docs/SignalResponseRawDeviceAttributes.md | 2 +- docs/SignalResponseTampering.md | 2 +- ...Response.md => TooManyRequestsResponse.md} | 2 +- docs/VpnResultMethods.md | 2 +- fingerprint_pro_server_api_sdk/__init__.py | 6 +- .../api/fingerprint_api.py | 28 +++++----- .../models/__init__.py | 6 +- ...e_error.py => common403_error_response.py} | 32 +++++------ ...esponse.py => error_common403_response.py} | 24 ++++---- .../models/error_event404_response_error.py | 4 +- .../models/signal_response_incognito.py | 6 +- .../signal_response_raw_device_attributes.py | 6 +- .../models/signal_response_tampering.py | 6 +- ...ponse.py => too_many_requests_response.py} | 21 ++++--- .../models/vpn_result_methods.py | 4 +- generate.sh | 2 +- res/fingerprint-server-api.yaml | 56 ++++++++++--------- test/test_fingerprint_api.py | 10 ++-- 25 files changed, 132 insertions(+), 129 deletions(-) rename docs/{ErrorEvent403ResponseError.md => Common403ErrorResponse.md} (50%) rename docs/{ErrorEvent403Response.md => ErrorCommon403Response.md} (70%) rename docs/{ManyRequestsResponse.md => TooManyRequestsResponse.md} (92%) rename fingerprint_pro_server_api_sdk/models/{error_event403_response_error.py => common403_error_response.py} (71%) rename fingerprint_pro_server_api_sdk/models/{error_event403_response.py => error_common403_response.py} (80%) rename fingerprint_pro_server_api_sdk/models/{many_requests_response.py => too_many_requests_response.py} (79%) diff --git a/.swagger-codegen-ignore b/.swagger-codegen-ignore index f7f714dd..61c7d35c 100644 --- a/.swagger-codegen-ignore +++ b/.swagger-codegen-ignore @@ -27,6 +27,6 @@ git_push.sh tox.ini test/*.py -fingerprint_pro_server_api_sdk/models/many_requests_response.py +fingerprint_pro_server_api_sdk/models/too_many_requests_response.py requirements.txt -test-requirements.txt \ No newline at end of file +test-requirements.txt diff --git a/README.md b/README.md index 1971e62f..3ffa8114 100644 --- a/README.md +++ b/README.md @@ -168,8 +168,8 @@ All URIs are relative to *https://api.fpjs.io* Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*FingerprintApi* | [**get_event**](docs/FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by requestId -*FingerprintApi* | [**get_visits**](docs/FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitorId +*FingerprintApi* | [**get_event**](docs/FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by request ID +*FingerprintApi* | [**get_visits**](docs/FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID ## Documentation For Models @@ -178,13 +178,13 @@ Class | Method | HTTP request | Description - [BotdResult](docs/BotdResult.md) - [BrowserDetails](docs/BrowserDetails.md) - [ClonedAppResult](docs/ClonedAppResult.md) + - [Common403ErrorResponse](docs/Common403ErrorResponse.md) - [Confidence](docs/Confidence.md) - [DataCenter](docs/DataCenter.md) - [DeprecatedIPLocation](docs/DeprecatedIPLocation.md) - [DeprecatedIPLocationCity](docs/DeprecatedIPLocationCity.md) - [EmulatorResult](docs/EmulatorResult.md) - - [ErrorEvent403Response](docs/ErrorEvent403Response.md) - - [ErrorEvent403ResponseError](docs/ErrorEvent403ResponseError.md) + - [ErrorCommon403Response](docs/ErrorCommon403Response.md) - [ErrorEvent404Response](docs/ErrorEvent404Response.md) - [ErrorEvent404ResponseError](docs/ErrorEvent404ResponseError.md) - [ErrorVisits403](docs/ErrorVisits403.md) @@ -204,7 +204,6 @@ Class | Method | HTTP request | Description - [JailbrokenResult](docs/JailbrokenResult.md) - [Location](docs/Location.md) - [LocationSpoofingResult](docs/LocationSpoofingResult.md) - - [ManyRequestsResponse](docs/ManyRequestsResponse.md) - [PrivacySettingsResult](docs/PrivacySettingsResult.md) - [ProductError](docs/ProductError.md) - [ProductsResponse](docs/ProductsResponse.md) @@ -239,6 +238,7 @@ Class | Method | HTTP request | Description - [Subdivision](docs/Subdivision.md) - [SuspectScoreResult](docs/SuspectScoreResult.md) - [TamperingResult](docs/TamperingResult.md) + - [TooManyRequestsResponse](docs/TooManyRequestsResponse.md) - [TorResult](docs/TorResult.md) - [VirtualMachineResult](docs/VirtualMachineResult.md) - [Visit](docs/Visit.md) diff --git a/docs/ErrorEvent403ResponseError.md b/docs/Common403ErrorResponse.md similarity index 50% rename from docs/ErrorEvent403ResponseError.md rename to docs/Common403ErrorResponse.md index 100685ab..20f21f61 100644 --- a/docs/ErrorEvent403ResponseError.md +++ b/docs/Common403ErrorResponse.md @@ -1,9 +1,9 @@ -# ErrorEvent403ResponseError +# Common403ErrorResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **str** | Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - subscription not found for specified secret key * `SubscriptionNotActive` - subscription is not active * `WrongRegion` - server and subscription region differ | +**code** | **str** | Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - No Fingerprint application found for specified secret key * `SubscriptionNotActive` - Fingerprint application is not active * `WrongRegion` - server and application region differ * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application | **message** | **str** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ErrorEvent403Response.md b/docs/ErrorCommon403Response.md similarity index 70% rename from docs/ErrorEvent403Response.md rename to docs/ErrorCommon403Response.md index b8a3b792..c6420125 100644 --- a/docs/ErrorEvent403Response.md +++ b/docs/ErrorCommon403Response.md @@ -1,9 +1,9 @@ -# ErrorEvent403Response +# ErrorCommon403Response ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**error** | [**ErrorEvent403ResponseError**](ErrorEvent403ResponseError.md) | | [optional] +**error** | [**Common403ErrorResponse**](Common403ErrorResponse.md) | | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/ErrorEvent404ResponseError.md b/docs/ErrorEvent404ResponseError.md index 885f39b5..96e1f53d 100644 --- a/docs/ErrorEvent404ResponseError.md +++ b/docs/ErrorEvent404ResponseError.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **str** | Error code: * `RequestNotFound` - request not found for specified id | +**code** | **str** | Error code: * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. | **message** | **str** | | [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/docs/FingerprintApi.md b/docs/FingerprintApi.md index 897b9172..2d384f73 100644 --- a/docs/FingerprintApi.md +++ b/docs/FingerprintApi.md @@ -4,15 +4,15 @@ All URIs are relative to *https://api.fpjs.io* Method | HTTP request | Description ------------- | ------------- | ------------- -[**get_event**](FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by requestId -[**get_visits**](FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitorId +[**get_event**](FingerprintApi.md#get_event) | **GET** /events/{request_id} | Get event by request ID +[**get_visits**](FingerprintApi.md#get_visits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID # **get_event** > EventResponse get_event(request_id) -Get event by requestId +Get event by request ID -This endpoint allows you to get a detailed analysis of an individual request. **Only for Enterprise customers:** 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`. +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 @@ -43,7 +43,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **request_id** | **str**| The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. | + **request_id** | **str**| The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request. | ### Return type @@ -63,9 +63,9 @@ Name | Type | Description | Notes # **get_visits** > Response get_visits(visitor_id, request_id=request_id, linked_id=linked_id, limit=limit, pagination_key=pagination_key, before=before) -Get visits by visitorId +Get visits by visitor ID -This endpoint allows you to get a history of visits 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. +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. ### Example ```python @@ -96,7 +96,7 @@ except ApiException as e: Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **visitor_id** | **str**| Unique identifier of the visitor issued by Fingerprint Pro. | + **visitor_id** | **str**| Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#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/docs/js-agent#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/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** | **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] diff --git a/docs/SignalResponseIncognito.md b/docs/SignalResponseIncognito.md index db037e8a..b8154f64 100644 --- a/docs/SignalResponseIncognito.md +++ b/docs/SignalResponseIncognito.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**IncognitoResult**](IncognitoResult.md) | | [optional] -**error** | [**ProductError**](ProductError.md) | | [optional] +**error** | [**IdentificationError**](IdentificationError.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/SignalResponseRawDeviceAttributes.md b/docs/SignalResponseRawDeviceAttributes.md index 6a5a2027..d3092528 100644 --- a/docs/SignalResponseRawDeviceAttributes.md +++ b/docs/SignalResponseRawDeviceAttributes.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**RawDeviceAttributesResult**](RawDeviceAttributesResult.md) | | [optional] -**error** | [**ProductError**](ProductError.md) | | [optional] +**error** | [**IdentificationError**](IdentificationError.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/SignalResponseTampering.md b/docs/SignalResponseTampering.md index 328826d2..3fec7b6c 100644 --- a/docs/SignalResponseTampering.md +++ b/docs/SignalResponseTampering.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**TamperingResult**](TamperingResult.md) | | [optional] -**error** | [**ProductError**](ProductError.md) | | [optional] +**error** | [**IdentificationError**](IdentificationError.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/ManyRequestsResponse.md b/docs/TooManyRequestsResponse.md similarity index 92% rename from docs/ManyRequestsResponse.md rename to docs/TooManyRequestsResponse.md index 5d23e8ea..2d19e161 100644 --- a/docs/ManyRequestsResponse.md +++ b/docs/TooManyRequestsResponse.md @@ -1,4 +1,4 @@ -# ManyRequestsResponse +# TooManyRequestsResponse ## Properties Name | Type | Description | Notes diff --git a/docs/VpnResultMethods.md b/docs/VpnResultMethods.md index 74528c95..5fb0b1b7 100644 --- a/docs/VpnResultMethods.md +++ b/docs/VpnResultMethods.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**timezone_mismatch** | **bool** | User's browser timezone doesn't match the timezone from which the request was originally made. | +**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. | diff --git a/fingerprint_pro_server_api_sdk/__init__.py b/fingerprint_pro_server_api_sdk/__init__.py index dea46c32..9226f586 100644 --- a/fingerprint_pro_server_api_sdk/__init__.py +++ b/fingerprint_pro_server_api_sdk/__init__.py @@ -25,13 +25,13 @@ from fingerprint_pro_server_api_sdk.models.botd_result import BotdResult from fingerprint_pro_server_api_sdk.models.browser_details import BrowserDetails from fingerprint_pro_server_api_sdk.models.cloned_app_result import ClonedAppResult +from fingerprint_pro_server_api_sdk.models.common403_error_response import Common403ErrorResponse from fingerprint_pro_server_api_sdk.models.confidence import Confidence from fingerprint_pro_server_api_sdk.models.data_center import DataCenter from fingerprint_pro_server_api_sdk.models.deprecated_ip_location import DeprecatedIPLocation from fingerprint_pro_server_api_sdk.models.deprecated_ip_location_city import DeprecatedIPLocationCity from fingerprint_pro_server_api_sdk.models.emulator_result import EmulatorResult -from fingerprint_pro_server_api_sdk.models.error_event403_response import ErrorEvent403Response -from fingerprint_pro_server_api_sdk.models.error_event403_response_error import ErrorEvent403ResponseError +from fingerprint_pro_server_api_sdk.models.error_common403_response import ErrorCommon403Response from fingerprint_pro_server_api_sdk.models.error_event404_response import ErrorEvent404Response from fingerprint_pro_server_api_sdk.models.error_event404_response_error import ErrorEvent404ResponseError from fingerprint_pro_server_api_sdk.models.error_visits403 import ErrorVisits403 @@ -51,7 +51,6 @@ from fingerprint_pro_server_api_sdk.models.jailbroken_result import JailbrokenResult from fingerprint_pro_server_api_sdk.models.location import Location from fingerprint_pro_server_api_sdk.models.location_spoofing_result import LocationSpoofingResult -from fingerprint_pro_server_api_sdk.models.many_requests_response import ManyRequestsResponse from fingerprint_pro_server_api_sdk.models.privacy_settings_result import PrivacySettingsResult from fingerprint_pro_server_api_sdk.models.product_error import ProductError from fingerprint_pro_server_api_sdk.models.products_response import ProductsResponse @@ -86,6 +85,7 @@ from fingerprint_pro_server_api_sdk.models.subdivision import Subdivision from fingerprint_pro_server_api_sdk.models.suspect_score_result import SuspectScoreResult from fingerprint_pro_server_api_sdk.models.tampering_result import TamperingResult +from fingerprint_pro_server_api_sdk.models.too_many_requests_response import TooManyRequestsResponse from fingerprint_pro_server_api_sdk.models.tor_result import TorResult from fingerprint_pro_server_api_sdk.models.virtual_machine_result import VirtualMachineResult from fingerprint_pro_server_api_sdk.models.visit import Visit diff --git a/fingerprint_pro_server_api_sdk/api/fingerprint_api.py b/fingerprint_pro_server_api_sdk/api/fingerprint_api.py index 6faf74ec..7fd5a545 100644 --- a/fingerprint_pro_server_api_sdk/api/fingerprint_api.py +++ b/fingerprint_pro_server_api_sdk/api/fingerprint_api.py @@ -35,16 +35,16 @@ def __init__(self, configuration=None, pool=None): self.api_client = ApiClient(configuration, pool=pool) def get_event(self, request_id, **kwargs): # noqa: E501 - """Get event by requestId # noqa: E501 + """Get event by request ID # noqa: E501 - This endpoint allows you to get a detailed analysis of an individual request. **Only for Enterprise customers:** 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 + 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 str request_id: The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. (required) + :param str request_id: The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request. (required) :return: EventResponse If the method is called asynchronously, returns the request thread. @@ -57,16 +57,16 @@ def get_event(self, request_id, **kwargs): # noqa: E501 return data def get_event_with_http_info(self, request_id, **kwargs): # noqa: E501 - """Get event by requestId # noqa: E501 + """Get event by request ID # noqa: E501 - This endpoint allows you to get a detailed analysis of an individual request. **Only for Enterprise customers:** 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 + 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/docs/js-agent#requestid) of each analysis request. (required) + :param str request_id: The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request. (required) :return: EventResponse If the method is called asynchronously, returns the request thread. @@ -132,7 +132,7 @@ def get_event_with_http_info(self, request_id, **kwargs): # noqa: E501 collection_formats=collection_formats) except ApiException as e: if e.status == 403: - error = self.api_client.deserialize(e, 'ErrorEvent403Response', True) + error = self.api_client.deserialize(e, 'ErrorCommon403Response', True) raise extend_exception(e, error) if e.status == 404: error = self.api_client.deserialize(e, 'ErrorEvent404Response', True) @@ -140,16 +140,16 @@ def get_event_with_http_info(self, request_id, **kwargs): # noqa: E501 raise e def get_visits(self, visitor_id, **kwargs): # noqa: E501 - """Get visits by visitorId # noqa: E501 + """Get visits by visitor ID # noqa: E501 - This endpoint allows you to get a history of visits 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 + 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 str visitor_id: Unique identifier of the visitor issued by Fingerprint Pro. (required) + :param str visitor_id: Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#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/docs/js-agent#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/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. :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. @@ -167,16 +167,16 @@ def get_visits(self, visitor_id, **kwargs): # noqa: E501 return data def get_visits_with_http_info(self, visitor_id, **kwargs): # noqa: E501 - """Get visits by visitorId # noqa: E501 + """Get visits by visitor ID # noqa: E501 - This endpoint allows you to get a history of visits 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 + 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 identifier of the visitor issued by Fingerprint Pro. (required) + :param str visitor_id: Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#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/docs/js-agent#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/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. :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. @@ -260,6 +260,6 @@ def get_visits_with_http_info(self, visitor_id, **kwargs): # noqa: E501 error = self.api_client.deserialize(e, 'ErrorVisits403', True) raise extend_exception(e, error) if e.status == 429: - error = self.api_client.deserialize(e, 'ManyRequestsResponse', True) + error = self.api_client.deserialize(e, 'TooManyRequestsResponse', True) raise extend_exception(e, error) raise e diff --git a/fingerprint_pro_server_api_sdk/models/__init__.py b/fingerprint_pro_server_api_sdk/models/__init__.py index 81e3854a..512b8eb8 100644 --- a/fingerprint_pro_server_api_sdk/models/__init__.py +++ b/fingerprint_pro_server_api_sdk/models/__init__.py @@ -19,13 +19,13 @@ from fingerprint_pro_server_api_sdk.models.botd_result import BotdResult from fingerprint_pro_server_api_sdk.models.browser_details import BrowserDetails from fingerprint_pro_server_api_sdk.models.cloned_app_result import ClonedAppResult +from fingerprint_pro_server_api_sdk.models.common403_error_response import Common403ErrorResponse from fingerprint_pro_server_api_sdk.models.confidence import Confidence from fingerprint_pro_server_api_sdk.models.data_center import DataCenter from fingerprint_pro_server_api_sdk.models.deprecated_ip_location import DeprecatedIPLocation from fingerprint_pro_server_api_sdk.models.deprecated_ip_location_city import DeprecatedIPLocationCity from fingerprint_pro_server_api_sdk.models.emulator_result import EmulatorResult -from fingerprint_pro_server_api_sdk.models.error_event403_response import ErrorEvent403Response -from fingerprint_pro_server_api_sdk.models.error_event403_response_error import ErrorEvent403ResponseError +from fingerprint_pro_server_api_sdk.models.error_common403_response import ErrorCommon403Response from fingerprint_pro_server_api_sdk.models.error_event404_response import ErrorEvent404Response from fingerprint_pro_server_api_sdk.models.error_event404_response_error import ErrorEvent404ResponseError from fingerprint_pro_server_api_sdk.models.error_visits403 import ErrorVisits403 @@ -45,7 +45,6 @@ from fingerprint_pro_server_api_sdk.models.jailbroken_result import JailbrokenResult from fingerprint_pro_server_api_sdk.models.location import Location from fingerprint_pro_server_api_sdk.models.location_spoofing_result import LocationSpoofingResult -from fingerprint_pro_server_api_sdk.models.many_requests_response import ManyRequestsResponse from fingerprint_pro_server_api_sdk.models.privacy_settings_result import PrivacySettingsResult from fingerprint_pro_server_api_sdk.models.product_error import ProductError from fingerprint_pro_server_api_sdk.models.products_response import ProductsResponse @@ -80,6 +79,7 @@ from fingerprint_pro_server_api_sdk.models.subdivision import Subdivision from fingerprint_pro_server_api_sdk.models.suspect_score_result import SuspectScoreResult from fingerprint_pro_server_api_sdk.models.tampering_result import TamperingResult +from fingerprint_pro_server_api_sdk.models.too_many_requests_response import TooManyRequestsResponse from fingerprint_pro_server_api_sdk.models.tor_result import TorResult from fingerprint_pro_server_api_sdk.models.virtual_machine_result import VirtualMachineResult from fingerprint_pro_server_api_sdk.models.visit import Visit diff --git a/fingerprint_pro_server_api_sdk/models/error_event403_response_error.py b/fingerprint_pro_server_api_sdk/models/common403_error_response.py similarity index 71% rename from fingerprint_pro_server_api_sdk/models/error_event403_response_error.py rename to fingerprint_pro_server_api_sdk/models/common403_error_response.py index 4dd075c1..b9dcc880 100644 --- a/fingerprint_pro_server_api_sdk/models/error_event403_response_error.py +++ b/fingerprint_pro_server_api_sdk/models/common403_error_response.py @@ -15,7 +15,7 @@ import six -class ErrorEvent403ResponseError(object): +class Common403ErrorResponse(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -38,7 +38,7 @@ class ErrorEvent403ResponseError(object): } def __init__(self, code=None, message=None): # noqa: E501 - """ErrorEvent403ResponseError - a model defined in Swagger""" # noqa: E501 + """Common403ErrorResponse - a model defined in Swagger""" # noqa: E501 self._code = None self._message = None self.discriminator = None @@ -47,27 +47,27 @@ def __init__(self, code=None, message=None): # noqa: E501 @property def code(self): - """Gets the code of this ErrorEvent403ResponseError. # noqa: E501 + """Gets the code of this Common403ErrorResponse. # noqa: E501 - Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - subscription not found for specified secret key * `SubscriptionNotActive` - subscription is not active * `WrongRegion` - server and subscription region differ # noqa: E501 + Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - No Fingerprint application found for specified secret key * `SubscriptionNotActive` - Fingerprint application is not active * `WrongRegion` - server and application region differ * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application # noqa: E501 - :return: The code of this ErrorEvent403ResponseError. # noqa: E501 + :return: The code of this Common403ErrorResponse. # noqa: E501 :rtype: str """ return self._code @code.setter def code(self, code): - """Sets the code of this ErrorEvent403ResponseError. + """Sets the code of this Common403ErrorResponse. - Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - subscription not found for specified secret key * `SubscriptionNotActive` - subscription is not active * `WrongRegion` - server and subscription region differ # noqa: E501 + Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - No Fingerprint application found for specified secret key * `SubscriptionNotActive` - Fingerprint application is not active * `WrongRegion` - server and application region differ * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application # noqa: E501 - :param code: The code of this ErrorEvent403ResponseError. # noqa: E501 + :param code: The code of this Common403ErrorResponse. # noqa: E501 :type: str """ if code is None: raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 - allowed_values = ["TokenRequired", "TokenNotFound", "SubscriptionNotActive", "WrongRegion"] # noqa: E501 + allowed_values = ["TokenRequired", "TokenNotFound", "SubscriptionNotActive", "WrongRegion", "FeatureNotEnabled"] # noqa: E501 if (code not in allowed_values): raise ValueError( "Invalid value for `code` ({0}), must be one of {1}" # noqa: E501 @@ -78,20 +78,20 @@ def code(self, code): @property def message(self): - """Gets the message of this ErrorEvent403ResponseError. # noqa: E501 + """Gets the message of this Common403ErrorResponse. # noqa: E501 - :return: The message of this ErrorEvent403ResponseError. # noqa: E501 + :return: The message of this Common403ErrorResponse. # noqa: E501 :rtype: str """ return self._message @message.setter def message(self, message): - """Sets the message of this ErrorEvent403ResponseError. + """Sets the message of this Common403ErrorResponse. - :param message: The message of this ErrorEvent403ResponseError. # noqa: E501 + :param message: The message of this Common403ErrorResponse. # noqa: E501 :type: str """ if message is None: @@ -120,7 +120,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(ErrorEvent403ResponseError, dict): + if issubclass(Common403ErrorResponse, dict): for key, value in self.items(): result[key] = value @@ -136,14 +136,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, ErrorEvent403ResponseError): + if not isinstance(other, Common403ErrorResponse): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, ErrorEvent403ResponseError): + if not isinstance(other, Common403ErrorResponse): return True return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/error_event403_response.py b/fingerprint_pro_server_api_sdk/models/error_common403_response.py similarity index 80% rename from fingerprint_pro_server_api_sdk/models/error_event403_response.py rename to fingerprint_pro_server_api_sdk/models/error_common403_response.py index 77289f81..9ef6c174 100644 --- a/fingerprint_pro_server_api_sdk/models/error_event403_response.py +++ b/fingerprint_pro_server_api_sdk/models/error_common403_response.py @@ -15,7 +15,7 @@ import six -class ErrorEvent403Response(object): +class ErrorCommon403Response(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -28,7 +28,7 @@ class ErrorEvent403Response(object): and the value is json key in definition. """ swagger_types = { - 'error': 'ErrorEvent403ResponseError' + 'error': 'Common403ErrorResponse' } attribute_map = { @@ -36,7 +36,7 @@ class ErrorEvent403Response(object): } def __init__(self, error=None): # noqa: E501 - """ErrorEvent403Response - a model defined in Swagger""" # noqa: E501 + """ErrorCommon403Response - a model defined in Swagger""" # noqa: E501 self._error = None self.discriminator = None if error is not None: @@ -44,21 +44,21 @@ def __init__(self, error=None): # noqa: E501 @property def error(self): - """Gets the error of this ErrorEvent403Response. # noqa: E501 + """Gets the error of this ErrorCommon403Response. # noqa: E501 - :return: The error of this ErrorEvent403Response. # noqa: E501 - :rtype: ErrorEvent403ResponseError + :return: The error of this ErrorCommon403Response. # noqa: E501 + :rtype: Common403ErrorResponse """ return self._error @error.setter def error(self, error): - """Sets the error of this ErrorEvent403Response. + """Sets the error of this ErrorCommon403Response. - :param error: The error of this ErrorEvent403Response. # noqa: E501 - :type: ErrorEvent403ResponseError + :param error: The error of this ErrorCommon403Response. # noqa: E501 + :type: Common403ErrorResponse """ self._error = error @@ -84,7 +84,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(ErrorEvent403Response, dict): + if issubclass(ErrorCommon403Response, dict): for key, value in self.items(): result[key] = value @@ -100,14 +100,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, ErrorEvent403Response): + if not isinstance(other, ErrorCommon403Response): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, ErrorEvent403Response): + if not isinstance(other, ErrorCommon403Response): return True return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/error_event404_response_error.py b/fingerprint_pro_server_api_sdk/models/error_event404_response_error.py index af699771..82e6950a 100644 --- a/fingerprint_pro_server_api_sdk/models/error_event404_response_error.py +++ b/fingerprint_pro_server_api_sdk/models/error_event404_response_error.py @@ -49,7 +49,7 @@ def __init__(self, code=None, message=None): # noqa: E501 def code(self): """Gets the code of this ErrorEvent404ResponseError. # noqa: E501 - Error code: * `RequestNotFound` - request not found for specified id # noqa: E501 + Error code: * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. # noqa: E501 :return: The code of this ErrorEvent404ResponseError. # noqa: E501 :rtype: str @@ -60,7 +60,7 @@ def code(self): def code(self, code): """Sets the code of this ErrorEvent404ResponseError. - Error code: * `RequestNotFound` - request not found for specified id # noqa: E501 + Error code: * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. # noqa: E501 :param code: The code of this ErrorEvent404ResponseError. # noqa: E501 :type: str diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_incognito.py b/fingerprint_pro_server_api_sdk/models/signal_response_incognito.py index 0937e73d..fb23982b 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_incognito.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_incognito.py @@ -29,7 +29,7 @@ class SignalResponseIncognito(object): """ swagger_types = { 'data': 'IncognitoResult', - 'error': 'ProductError' + 'error': 'IdentificationError' } attribute_map = { @@ -74,7 +74,7 @@ def error(self): :return: The error of this SignalResponseIncognito. # noqa: E501 - :rtype: ProductError + :rtype: IdentificationError """ return self._error @@ -84,7 +84,7 @@ def error(self, error): :param error: The error of this SignalResponseIncognito. # noqa: E501 - :type: ProductError + :type: IdentificationError """ self._error = error diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_raw_device_attributes.py b/fingerprint_pro_server_api_sdk/models/signal_response_raw_device_attributes.py index 1fcca218..4efb2842 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_raw_device_attributes.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_raw_device_attributes.py @@ -29,7 +29,7 @@ class SignalResponseRawDeviceAttributes(object): """ swagger_types = { 'data': 'RawDeviceAttributesResult', - 'error': 'ProductError' + 'error': 'IdentificationError' } attribute_map = { @@ -74,7 +74,7 @@ def error(self): :return: The error of this SignalResponseRawDeviceAttributes. # noqa: E501 - :rtype: ProductError + :rtype: IdentificationError """ return self._error @@ -84,7 +84,7 @@ def error(self, error): :param error: The error of this SignalResponseRawDeviceAttributes. # noqa: E501 - :type: ProductError + :type: IdentificationError """ self._error = error diff --git a/fingerprint_pro_server_api_sdk/models/signal_response_tampering.py b/fingerprint_pro_server_api_sdk/models/signal_response_tampering.py index 28e8f52e..0aae8a2e 100644 --- a/fingerprint_pro_server_api_sdk/models/signal_response_tampering.py +++ b/fingerprint_pro_server_api_sdk/models/signal_response_tampering.py @@ -29,7 +29,7 @@ class SignalResponseTampering(object): """ swagger_types = { 'data': 'TamperingResult', - 'error': 'ProductError' + 'error': 'IdentificationError' } attribute_map = { @@ -74,7 +74,7 @@ def error(self): :return: The error of this SignalResponseTampering. # noqa: E501 - :rtype: ProductError + :rtype: IdentificationError """ return self._error @@ -84,7 +84,7 @@ def error(self, error): :param error: The error of this SignalResponseTampering. # noqa: E501 - :type: ProductError + :type: IdentificationError """ self._error = error diff --git a/fingerprint_pro_server_api_sdk/models/many_requests_response.py b/fingerprint_pro_server_api_sdk/models/too_many_requests_response.py similarity index 79% rename from fingerprint_pro_server_api_sdk/models/many_requests_response.py rename to fingerprint_pro_server_api_sdk/models/too_many_requests_response.py index 92b50080..ebb5c99d 100644 --- a/fingerprint_pro_server_api_sdk/models/many_requests_response.py +++ b/fingerprint_pro_server_api_sdk/models/too_many_requests_response.py @@ -3,7 +3,7 @@ """ Fingerprint Pro Server API - Fingerprint Pro 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 + Fingerprint Pro 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 @@ -15,8 +15,7 @@ import six - -class ManyRequestsResponse(object): +class TooManyRequestsResponse(object): """NOTE: This class is auto generated by the swagger code generator program. Do not edit the class manually. @@ -39,7 +38,7 @@ class ManyRequestsResponse(object): } def __init__(self, error=None): # noqa: E501 - """ManyRequestsResponse - a model defined in Swagger""" # noqa: E501 + """TooManyRequestsResponse - a model defined in Swagger""" # noqa: E501 self._error = None self.discriminator = None self.error = error @@ -47,22 +46,22 @@ def __init__(self, error=None): # noqa: E501 @property def error(self): - """Gets the error of this ManyRequestsResponse. # noqa: E501 + """Gets the error of this TooManyRequestsResponse. # noqa: E501 Error text. # noqa: E501 - :return: The error of this ManyRequestsResponse. # noqa: E501 + :return: The error of this TooManyRequestsResponse. # noqa: E501 :rtype: str """ return self._error @error.setter def error(self, error): - """Sets the error of this ManyRequestsResponse. + """Sets the error of this TooManyRequestsResponse. Error text. # noqa: E501 - :param error: The error of this ManyRequestsResponse. # noqa: E501 + :param error: The error of this TooManyRequestsResponse. # noqa: E501 :type: str """ if error is None: @@ -99,7 +98,7 @@ def to_dict(self): )) else: result[attr] = value - if issubclass(ManyRequestsResponse, dict): + if issubclass(TooManyRequestsResponse, dict): for key, value in self.items(): result[key] = value @@ -115,14 +114,14 @@ def __repr__(self): def __eq__(self, other): """Returns true if both objects are equal""" - if not isinstance(other, ManyRequestsResponse): + if not isinstance(other, TooManyRequestsResponse): return False return self.to_dict() == other.to_dict() def __ne__(self, other): """Returns true if both objects are not equal""" - if not isinstance(other, ManyRequestsResponse): + if not isinstance(other, TooManyRequestsResponse): return True return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/vpn_result_methods.py b/fingerprint_pro_server_api_sdk/models/vpn_result_methods.py index 0205afc4..92ad11c4 100644 --- a/fingerprint_pro_server_api_sdk/models/vpn_result_methods.py +++ b/fingerprint_pro_server_api_sdk/models/vpn_result_methods.py @@ -53,7 +53,7 @@ def __init__(self, timezone_mismatch=None, public_vpn=None, auxiliary_mobile=Non def timezone_mismatch(self): """Gets the timezone_mismatch of this VpnResultMethods. # noqa: E501 - User's browser timezone doesn't match the timezone from which the request was originally made. # noqa: E501 + The browser timezone doesn't match the timezone inferred from the request IP address. # noqa: E501 :return: The timezone_mismatch of this VpnResultMethods. # noqa: E501 :rtype: bool @@ -64,7 +64,7 @@ def timezone_mismatch(self): def timezone_mismatch(self, timezone_mismatch): """Sets the timezone_mismatch of this VpnResultMethods. - User's browser timezone doesn't match the timezone from which the request was originally made. # noqa: E501 + The browser timezone doesn't match the timezone inferred from the request IP address. # noqa: E501 :param timezone_mismatch: The timezone_mismatch of this VpnResultMethods. # noqa: E501 :type: bool diff --git a/generate.sh b/generate.sh index cdc997ca..be94e69c 100755 --- a/generate.sh +++ b/generate.sh @@ -22,7 +22,7 @@ fi find ./docs -type f ! -name "DecryptionKey.md" ! -name "SealedResults.md" -exec rm {} + cd fingerprint_pro_server_api_sdk/models shopt -s extglob -rm !("many_requests_response.py") +rm !("too_many_requests_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 diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index 792ce049..187ae5a4 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -36,14 +36,13 @@ paths: tags: - Fingerprint operationId: getEvent - summary: Get event by requestId + summary: Get event by request ID description: > - This endpoint allows you to get a detailed analysis of an individual - request. + Get a detailed analysis of an individual identification event, including + Smart Signals. - **Only for Enterprise customers:** Please note that the response - includes mobile signals (e.g. `rootApps`) even if the request originated - from a non-mobile platform. + 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. @@ -57,7 +56,7 @@ paths: description: >- The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of - each analysis request. + each identification request. required: true schema: type: string @@ -73,7 +72,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ErrorEvent403Response' + $ref: '#/components/schemas/ErrorCommon403Response' '404': description: Not found content: @@ -85,9 +84,9 @@ paths: tags: - Fingerprint operationId: getVisits - summary: Get visits by visitorId + summary: Get visits by visitor ID description: > - This endpoint allows you to get a history of visits for a specific + 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. @@ -102,7 +101,10 @@ paths: response is received. parameters: - name: visitor_id - description: Unique identifier of the visitor issued by Fingerprint Pro. + description: >- + Unique [visitor + identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) + issued by Fingerprint Pro. in: path required: true schema: @@ -210,8 +212,8 @@ paths: headers: Retry-After: description: >- - Indicates how long you should wait before attempting the next - request. + Indicates how many seconds you should wait before attempting the + next request. schema: type: integer format: int32 @@ -219,7 +221,7 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ManyRequestsResponse' + $ref: '#/components/schemas/TooManyRequestsResponse' /webhook: trace: tags: @@ -547,28 +549,30 @@ components: description: >- Fields `lastTimestamp` and `paginationKey` added when `limit` or `before` parameter provided and there is more data to show - ErrorEvent403Response: + ErrorCommon403Response: type: object additionalProperties: false properties: error: type: object additionalProperties: false - title: ErrorEvent403ResponseError + title: Common403ErrorResponse properties: code: type: string description: | Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty - * `TokenNotFound` - subscription not found for specified secret key - * `SubscriptionNotActive` - subscription is not active - * `WrongRegion` - server and subscription region differ + * `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 enum: - TokenRequired - TokenNotFound - SubscriptionNotActive - WrongRegion + - FeatureNotEnabled example: TokenRequired message: type: string @@ -589,7 +593,7 @@ components: type: string description: | Error code: - * `RequestNotFound` - request not found for specified id + * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. enum: - RequestNotFound example: RequestNotFound @@ -609,7 +613,7 @@ components: example: Forbidden (HTTP 403) required: - error - ManyRequestsResponse: + TooManyRequestsResponse: type: object additionalProperties: false properties: @@ -1234,7 +1238,7 @@ components: data: $ref: '#/components/schemas/IncognitoResult' error: - $ref: '#/components/schemas/ProductError' + $ref: '#/components/schemas/IdentificationError' rootApps: title: SignalResponseRootApps type: object @@ -1351,7 +1355,7 @@ components: data: $ref: '#/components/schemas/TamperingResult' error: - $ref: '#/components/schemas/ProductError' + $ref: '#/components/schemas/IdentificationError' highActivity: title: SignalResponseHighActivity type: object @@ -1387,7 +1391,7 @@ components: data: $ref: '#/components/schemas/RawDeviceAttributesResult' error: - $ref: '#/components/schemas/ProductError' + $ref: '#/components/schemas/IdentificationError' EventResponse: description: >- Contains results from all activated products - Fingerprint Pro, Bot @@ -1582,8 +1586,8 @@ components: timezoneMismatch: type: boolean description: >- - User's browser timezone doesn't match the timezone from which - the request was originally made. + The browser timezone doesn't match the timezone inferred from + the request IP address. example: false publicVPN: type: boolean diff --git a/test/test_fingerprint_api.py b/test/test_fingerprint_api.py index b64e953c..6b612383 100644 --- a/test/test_fingerprint_api.py +++ b/test/test_fingerprint_api.py @@ -17,8 +17,8 @@ import urllib3 -from fingerprint_pro_server_api_sdk import Configuration, ManyRequestsResponse, ErrorVisits403, ErrorEvent403Response, \ - ErrorEvent404Response +from fingerprint_pro_server_api_sdk import (Configuration, TooManyRequestsResponse, ErrorVisits403, + ErrorCommon403Response, ErrorEvent404Response) from fingerprint_pro_server_api_sdk.api.fingerprint_api import FingerprintApi # noqa: E501 from fingerprint_pro_server_api_sdk.rest import KnownApiException @@ -157,7 +157,7 @@ def test_get_visits_error_429(self): with self.assertRaises(KnownApiException) as context: self.api.get_visits(mock_file) self.assertEqual(context.exception.status, 429) - self.assertIsInstance(context.exception.structured_error, ManyRequestsResponse) + self.assertIsInstance(context.exception.structured_error, TooManyRequestsResponse) self.assertEqual(context.exception.structured_error.retry_after, 4) def test_get_visits_error_429_empty_retry_after(self): @@ -171,7 +171,7 @@ def test_get_visits_error_429_empty_retry_after(self): with self.assertRaises(KnownApiException) as context: self.api.get_visits(mock_file) self.assertEqual(context.exception.status, 429) - self.assertIsInstance(context.exception.structured_error, ManyRequestsResponse) + self.assertIsInstance(context.exception.structured_error, TooManyRequestsResponse) self.assertEqual(context.exception.structured_error.retry_after, 1) def test_get_event_correct_data(self): @@ -229,7 +229,7 @@ def test_get_event_error_403(self): with self.assertRaises(KnownApiException) as context: self.api.get_event(mock_file) self.assertEqual(context.exception.status, 403) - self.assertIsInstance(context.exception.structured_error, ErrorEvent403Response) + self.assertIsInstance(context.exception.structured_error, ErrorCommon403Response) def test_get_event_error_404(self): """Test checks correct code run result in case of 403 error"""