From 8beb757db67af38b7a112f93f1a7c21ef35e62a8 Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Fri, 15 Mar 2024 18:05:18 +0100 Subject: [PATCH] fix: make fields required according to real API response --- docs/EventResponse.md | 3 +- docs/FingerprintApi.md | 2 +- docs/HighActivityResult.md | 2 +- docs/IpBlockListResult.md | 4 +- docs/IpBlockListResultDetails.md | 4 +- docs/IpInfoResultV4.md | 4 +- docs/IpInfoResultV6.md | 4 +- docs/LocationSpoofingResult.md | 2 +- docs/SignalResponseRawDeviceAttributes.md | 1 + docs/TamperingResult.md | 4 +- docs/VpnResultMethods.md | 6 +-- .../models/event_response.py | 37 ++++++++++++++++--- .../models/high_activity_result.py | 5 ++- .../models/ip_block_list_result.py | 10 +++-- .../models/ip_block_list_result_details.py | 10 +++-- .../models/ip_info_result_v4.py | 10 +++-- .../models/ip_info_result_v6.py | 10 +++-- .../models/location_spoofing_result.py | 9 +++-- .../signal_response_raw_device_attributes.py | 32 ++++++++++++++-- .../models/tampering_result.py | 10 +++-- .../models/vpn_result_methods.py | 15 +++++--- 21 files changed, 127 insertions(+), 57 deletions(-) diff --git a/docs/EventResponse.md b/docs/EventResponse.md index 476eb47d..32c81c70 100644 --- a/docs/EventResponse.md +++ b/docs/EventResponse.md @@ -5,7 +5,8 @@ Contains results from all activated products - Fingerprint Pro, Bot Detection, a ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**products** | [**ProductsResponse**](ProductsResponse.md) | | [optional] +**products** | [**ProductsResponse**](ProductsResponse.md) | | +**error** | [**ProductError**](ProductError.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/FingerprintApi.md b/docs/FingerprintApi.md index d6cf0744..897b9172 100644 --- a/docs/FingerprintApi.md +++ b/docs/FingerprintApi.md @@ -12,7 +12,7 @@ Method | HTTP request | Description Get event by requestId -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 orignated 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`. +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`. ### Example ```python diff --git a/docs/HighActivityResult.md b/docs/HighActivityResult.md index 80435cc8..a7e7f5fa 100644 --- a/docs/HighActivityResult.md +++ b/docs/HighActivityResult.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**result** | **bool** | Flag indicating whether the request came from a high activity visitor. | [optional] +**result** | **bool** | Flag indicating whether the request came from a high activity visitor. | **daily_requests** | **float** | 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/IpBlockListResult.md b/docs/IpBlockListResult.md index c8b610a7..5fbd20d8 100644 --- a/docs/IpBlockListResult.md +++ b/docs/IpBlockListResult.md @@ -3,8 +3,8 @@ ## 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** | [**IpBlockListResultDetails**](IpBlockListResultDetails.md) | | [optional] +**result** | **bool** | `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. | +**details** | [**IpBlockListResultDetails**](IpBlockListResultDetails.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/IpBlockListResultDetails.md b/docs/IpBlockListResultDetails.md index 41c58a42..a3223854 100644 --- a/docs/IpBlockListResultDetails.md +++ b/docs/IpBlockListResultDetails.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**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] +**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). | [[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/IpInfoResultV4.md b/docs/IpInfoResultV4.md index 0ff48b16..e2559b16 100644 --- a/docs/IpInfoResultV4.md +++ b/docs/IpInfoResultV4.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**address** | **str** | | [optional] -**geolocation** | [**IPLocation**](IPLocation.md) | | [optional] +**address** | **str** | | +**geolocation** | [**IPLocation**](IPLocation.md) | | **asn** | [**ASN**](ASN.md) | | [optional] **datacenter** | [**DataCenter**](DataCenter.md) | | [optional] diff --git a/docs/IpInfoResultV6.md b/docs/IpInfoResultV6.md index 8bed1402..eae81b81 100644 --- a/docs/IpInfoResultV6.md +++ b/docs/IpInfoResultV6.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**address** | **str** | | [optional] -**geolocation** | [**IPLocation**](IPLocation.md) | | [optional] +**address** | **str** | | +**geolocation** | [**IPLocation**](IPLocation.md) | | **asn** | [**ASN**](ASN.md) | | [optional] **datacenter** | [**DataCenter**](DataCenter.md) | | [optional] diff --git a/docs/LocationSpoofingResult.md b/docs/LocationSpoofingResult.md index 8f41c6be..ba0f563d 100644 --- a/docs/LocationSpoofingResult.md +++ b/docs/LocationSpoofingResult.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**result** | **bool** | Flag indicating whether the request came from a device with location spoofing enabled. | [optional] +**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/SignalResponseRawDeviceAttributes.md b/docs/SignalResponseRawDeviceAttributes.md index fd044d43..6a5a2027 100644 --- a/docs/SignalResponseRawDeviceAttributes.md +++ b/docs/SignalResponseRawDeviceAttributes.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**RawDeviceAttributesResult**](RawDeviceAttributesResult.md) | | [optional] +**error** | [**ProductError**](ProductError.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/TamperingResult.md b/docs/TamperingResult.md index 18c531f3..d836cf18 100644 --- a/docs/TamperingResult.md +++ b/docs/TamperingResult.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**result** | **bool** | Flag indicating whether browser tampering was detected according to our internal thresholds. | [optional] -**anomaly_score** | **float** | Confidence score (`0.0 - 1.0`) for the tampering detection. Values above `0.5` suggest that we're reasonably sure there was a tampering attempt. Values below `0.5` are genuine browsers. | [optional] +**result** | **bool** | Flag indicating whether browser tampering was detected according to our internal thresholds. | +**anomaly_score** | **float** | Confidence score (`0.0 - 1.0`) for the tampering detection. Values above `0.5` suggest that we're reasonably sure there was a tampering attempt. Values below `0.5` are genuine browsers. | [[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/VpnResultMethods.md b/docs/VpnResultMethods.md index bba8c3d9..74528c95 100644 --- a/docs/VpnResultMethods.md +++ b/docs/VpnResultMethods.md @@ -3,9 +3,9 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**timezone_mismatch** | **bool** | User's browser timezone doesn't match the timezone from which the request was originally made. | [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] +**timezone_mismatch** | **bool** | User's browser timezone doesn't match the timezone from which the request was originally made. | +**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. | [[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_pro_server_api_sdk/models/event_response.py b/fingerprint_pro_server_api_sdk/models/event_response.py index 1df65b80..34b77b02 100644 --- a/fingerprint_pro_server_api_sdk/models/event_response.py +++ b/fingerprint_pro_server_api_sdk/models/event_response.py @@ -31,19 +31,23 @@ class EventResponse(object): and the value is json key in definition. """ swagger_types = { - 'products': 'ProductsResponse' + 'products': 'ProductsResponse', + 'error': 'ProductError' } attribute_map = { - 'products': 'products' + 'products': 'products', + 'error': 'error' } - def __init__(self, products=None): # noqa: E501 + def __init__(self, products=None, error=None): # noqa: E501 """EventResponse - a model defined in Swagger""" # noqa: E501 self._products = None + self._error = None self.discriminator = None - if products is not None: - self.products = products + self.products = products + if error is not None: + self.error = error @property def products(self): @@ -63,9 +67,32 @@ def products(self, products): :param products: The products of this EventResponse. # noqa: E501 :type: ProductsResponse """ + if products is None: + raise ValueError("Invalid value for `products`, must not be `None`") # noqa: E501 self._products = products + @property + def error(self): + """Gets the error of this EventResponse. # noqa: E501 + + + :return: The error of this EventResponse. # noqa: E501 + :rtype: ProductError + """ + return self._error + + @error.setter + def error(self, error): + """Sets the error of this EventResponse. + + + :param error: The error of this EventResponse. # noqa: E501 + :type: ProductError + """ + + self._error = error + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/fingerprint_pro_server_api_sdk/models/high_activity_result.py b/fingerprint_pro_server_api_sdk/models/high_activity_result.py index 3bb83f29..6bdaf6e8 100644 --- a/fingerprint_pro_server_api_sdk/models/high_activity_result.py +++ b/fingerprint_pro_server_api_sdk/models/high_activity_result.py @@ -42,8 +42,7 @@ def __init__(self, result=None, daily_requests=None): # noqa: E501 self._result = None self._daily_requests = None self.discriminator = None - if result is not None: - self.result = result + self.result = result if daily_requests is not None: self.daily_requests = daily_requests @@ -67,6 +66,8 @@ def result(self, result): :param result: The result of this HighActivityResult. # noqa: E501 :type: bool """ + if result is None: + raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 self._result = result diff --git a/fingerprint_pro_server_api_sdk/models/ip_block_list_result.py b/fingerprint_pro_server_api_sdk/models/ip_block_list_result.py index 9c0c0119..5ae947e9 100644 --- a/fingerprint_pro_server_api_sdk/models/ip_block_list_result.py +++ b/fingerprint_pro_server_api_sdk/models/ip_block_list_result.py @@ -42,10 +42,8 @@ def __init__(self, result=None, details=None): # 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 + self.result = result + self.details = details @property def result(self): @@ -67,6 +65,8 @@ def result(self, result): :param result: The result of this IpBlockListResult. # noqa: E501 :type: bool """ + if result is None: + raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 self._result = result @@ -88,6 +88,8 @@ def details(self, details): :param details: The details of this IpBlockListResult. # noqa: E501 :type: IpBlockListResultDetails """ + if details is None: + raise ValueError("Invalid value for `details`, must not be `None`") # noqa: E501 self._details = details diff --git a/fingerprint_pro_server_api_sdk/models/ip_block_list_result_details.py b/fingerprint_pro_server_api_sdk/models/ip_block_list_result_details.py index b2adbe6c..4af784f8 100644 --- a/fingerprint_pro_server_api_sdk/models/ip_block_list_result_details.py +++ b/fingerprint_pro_server_api_sdk/models/ip_block_list_result_details.py @@ -42,10 +42,8 @@ def __init__(self, email_spam=None, attack_source=None): # noqa: E501 self._email_spam = None self._attack_source = None self.discriminator = None - if email_spam is not None: - self.email_spam = email_spam - if attack_source is not None: - self.attack_source = attack_source + self.email_spam = email_spam + self.attack_source = attack_source @property def email_spam(self): @@ -67,6 +65,8 @@ def email_spam(self, email_spam): :param email_spam: The email_spam of this IpBlockListResultDetails. # noqa: E501 :type: bool """ + if email_spam is None: + raise ValueError("Invalid value for `email_spam`, must not be `None`") # noqa: E501 self._email_spam = email_spam @@ -90,6 +90,8 @@ def attack_source(self, attack_source): :param attack_source: The attack_source of this IpBlockListResultDetails. # noqa: E501 :type: bool """ + 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_pro_server_api_sdk/models/ip_info_result_v4.py b/fingerprint_pro_server_api_sdk/models/ip_info_result_v4.py index bbee6ae3..90a157b0 100644 --- a/fingerprint_pro_server_api_sdk/models/ip_info_result_v4.py +++ b/fingerprint_pro_server_api_sdk/models/ip_info_result_v4.py @@ -48,10 +48,8 @@ def __init__(self, address=None, geolocation=None, asn=None, datacenter=None): self._asn = None self._datacenter = None self.discriminator = None - if address is not None: - self.address = address - if geolocation is not None: - self.geolocation = geolocation + self.address = address + self.geolocation = geolocation if asn is not None: self.asn = asn if datacenter is not None: @@ -75,6 +73,8 @@ def address(self, address): :param address: The address of this IpInfoResultV4. # noqa: E501 :type: str """ + if address is None: + raise ValueError("Invalid value for `address`, must not be `None`") # noqa: E501 self._address = address @@ -96,6 +96,8 @@ def geolocation(self, geolocation): :param geolocation: The geolocation of this IpInfoResultV4. # noqa: E501 :type: IPLocation """ + if geolocation is None: + raise ValueError("Invalid value for `geolocation`, must not be `None`") # noqa: E501 self._geolocation = geolocation diff --git a/fingerprint_pro_server_api_sdk/models/ip_info_result_v6.py b/fingerprint_pro_server_api_sdk/models/ip_info_result_v6.py index a039f9f0..b1446197 100644 --- a/fingerprint_pro_server_api_sdk/models/ip_info_result_v6.py +++ b/fingerprint_pro_server_api_sdk/models/ip_info_result_v6.py @@ -48,10 +48,8 @@ def __init__(self, address=None, geolocation=None, asn=None, datacenter=None): self._asn = None self._datacenter = None self.discriminator = None - if address is not None: - self.address = address - if geolocation is not None: - self.geolocation = geolocation + self.address = address + self.geolocation = geolocation if asn is not None: self.asn = asn if datacenter is not None: @@ -75,6 +73,8 @@ def address(self, address): :param address: The address of this IpInfoResultV6. # noqa: E501 :type: str """ + if address is None: + raise ValueError("Invalid value for `address`, must not be `None`") # noqa: E501 self._address = address @@ -96,6 +96,8 @@ def geolocation(self, geolocation): :param geolocation: The geolocation of this IpInfoResultV6. # noqa: E501 :type: IPLocation """ + if geolocation is None: + raise ValueError("Invalid value for `geolocation`, must not be `None`") # noqa: E501 self._geolocation = geolocation diff --git a/fingerprint_pro_server_api_sdk/models/location_spoofing_result.py b/fingerprint_pro_server_api_sdk/models/location_spoofing_result.py index 808df4fb..ca386ac8 100644 --- a/fingerprint_pro_server_api_sdk/models/location_spoofing_result.py +++ b/fingerprint_pro_server_api_sdk/models/location_spoofing_result.py @@ -39,14 +39,13 @@ def __init__(self, result=None): # noqa: E501 """LocationSpoofingResult - a model defined in Swagger""" # noqa: E501 self._result = None self.discriminator = None - if result is not None: - self.result = result + self.result = result @property def result(self): """Gets the result of this LocationSpoofingResult. # noqa: E501 - Flag indicating whether the request came from a device with location spoofing enabled. # noqa: E501 + Flag indicating whether the request came from a mobile device with location spoofing enabled. # noqa: E501 :return: The result of this LocationSpoofingResult. # noqa: E501 :rtype: bool @@ -57,11 +56,13 @@ def result(self): def result(self, result): """Sets the result of this LocationSpoofingResult. - Flag indicating whether the request came from a device with location spoofing enabled. # noqa: E501 + Flag indicating whether the request came from a mobile device with location spoofing enabled. # noqa: E501 :param result: The result of this LocationSpoofingResult. # noqa: E501 :type: bool """ + if result is None: + raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 self._result = result 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 7459b404..1fcca218 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 @@ -28,19 +28,24 @@ class SignalResponseRawDeviceAttributes(object): and the value is json key in definition. """ swagger_types = { - 'data': 'RawDeviceAttributesResult' + 'data': 'RawDeviceAttributesResult', + 'error': 'ProductError' } attribute_map = { - 'data': 'data' + 'data': 'data', + 'error': 'error' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, error=None): # noqa: E501 """SignalResponseRawDeviceAttributes - 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): @@ -63,6 +68,27 @@ def data(self, data): self._data = data + @property + def error(self): + """Gets the error of this SignalResponseRawDeviceAttributes. # noqa: E501 + + + :return: The error of this SignalResponseRawDeviceAttributes. # noqa: E501 + :rtype: ProductError + """ + return self._error + + @error.setter + def error(self, error): + """Sets the error of this SignalResponseRawDeviceAttributes. + + + :param error: The error of this SignalResponseRawDeviceAttributes. # noqa: E501 + :type: ProductError + """ + + self._error = error + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/fingerprint_pro_server_api_sdk/models/tampering_result.py b/fingerprint_pro_server_api_sdk/models/tampering_result.py index 24d87eb7..e0b105aa 100644 --- a/fingerprint_pro_server_api_sdk/models/tampering_result.py +++ b/fingerprint_pro_server_api_sdk/models/tampering_result.py @@ -42,10 +42,8 @@ def __init__(self, result=None, anomaly_score=None): # noqa: E501 self._result = None self._anomaly_score = None self.discriminator = None - if result is not None: - self.result = result - if anomaly_score is not None: - self.anomaly_score = anomaly_score + self.result = result + self.anomaly_score = anomaly_score @property def result(self): @@ -67,6 +65,8 @@ def result(self, result): :param result: The result of this TamperingResult. # noqa: E501 :type: bool """ + if result is None: + raise ValueError("Invalid value for `result`, must not be `None`") # noqa: E501 self._result = result @@ -90,6 +90,8 @@ def anomaly_score(self, anomaly_score): :param anomaly_score: The anomaly_score of this TamperingResult. # noqa: E501 :type: float """ + if anomaly_score is None: + raise ValueError("Invalid value for `anomaly_score`, must not be `None`") # noqa: E501 self._anomaly_score = anomaly_score 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 b79fdab9..0205afc4 100644 --- a/fingerprint_pro_server_api_sdk/models/vpn_result_methods.py +++ b/fingerprint_pro_server_api_sdk/models/vpn_result_methods.py @@ -45,12 +45,9 @@ def __init__(self, timezone_mismatch=None, public_vpn=None, auxiliary_mobile=Non self._public_vpn = None self._auxiliary_mobile = None self.discriminator = None - if timezone_mismatch is not None: - self.timezone_mismatch = timezone_mismatch - if public_vpn is not None: - self.public_vpn = public_vpn - if auxiliary_mobile is not None: - self.auxiliary_mobile = auxiliary_mobile + self.timezone_mismatch = timezone_mismatch + self.public_vpn = public_vpn + self.auxiliary_mobile = auxiliary_mobile @property def timezone_mismatch(self): @@ -72,6 +69,8 @@ def timezone_mismatch(self, timezone_mismatch): :param timezone_mismatch: The timezone_mismatch of this VpnResultMethods. # noqa: E501 :type: bool """ + if timezone_mismatch is None: + raise ValueError("Invalid value for `timezone_mismatch`, must not be `None`") # noqa: E501 self._timezone_mismatch = timezone_mismatch @@ -95,6 +94,8 @@ def public_vpn(self, public_vpn): :param public_vpn: The public_vpn of this VpnResultMethods. # noqa: E501 :type: bool """ + if public_vpn is None: + raise ValueError("Invalid value for `public_vpn`, must not be `None`") # noqa: E501 self._public_vpn = public_vpn @@ -118,6 +119,8 @@ def auxiliary_mobile(self, auxiliary_mobile): :param auxiliary_mobile: The auxiliary_mobile of this VpnResultMethods. # noqa: E501 :type: bool """ + if auxiliary_mobile is None: + raise ValueError("Invalid value for `auxiliary_mobile`, must not be `None`") # noqa: E501 self._auxiliary_mobile = auxiliary_mobile