From c9be3d36266e065fa606591fef6c6357f14e8556 Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Wed, 25 Jan 2023 19:17:57 +0000 Subject: [PATCH] fix: update schema --- README.md | 2 + docs/ErrorVisits403.md | 9 + docs/FingerprintApi.md | 4 +- docs/IdentificationError.md | 10 ++ docs/ProductsResponseIdentification.md | 1 + fingerprint_pro_server_api_sdk/__init__.py | 2 + .../api/fingerprint_api.py | 6 +- .../models/__init__.py | 2 + .../models/error_visits403.py | 116 +++++++++++++ .../models/identification_error.py | 149 +++++++++++++++++ .../products_response_identification.py | 32 +++- res/fingerprint-server-api.yaml | 155 +++++++++++++++--- 12 files changed, 457 insertions(+), 31 deletions(-) create mode 100644 docs/ErrorVisits403.md create mode 100644 docs/IdentificationError.md create mode 100644 fingerprint_pro_server_api_sdk/models/error_visits403.py create mode 100644 fingerprint_pro_server_api_sdk/models/identification_error.py diff --git a/README.md b/README.md index ca9d37e5..56c9d0e8 100644 --- a/README.md +++ b/README.md @@ -157,9 +157,11 @@ Class | Method | HTTP request | Description - [ErrorEvent403ResponseError](docs/ErrorEvent403ResponseError.md) - [ErrorEvent404Response](docs/ErrorEvent404Response.md) - [ErrorEvent404ResponseError](docs/ErrorEvent404ResponseError.md) + - [ErrorVisits403](docs/ErrorVisits403.md) - [EventResponse](docs/EventResponse.md) - [IPLocation](docs/IPLocation.md) - [IPLocationCity](docs/IPLocationCity.md) + - [IdentificationError](docs/IdentificationError.md) - [Location](docs/Location.md) - [ManyRequestsResponse](docs/ManyRequestsResponse.md) - [ProductsResponse](docs/ProductsResponse.md) diff --git a/docs/ErrorVisits403.md b/docs/ErrorVisits403.md new file mode 100644 index 00000000..4b69dfea --- /dev/null +++ b/docs/ErrorVisits403.md @@ -0,0 +1,9 @@ +# ErrorVisits403 + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | **str** | Error text. | + +[[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 764aad75..6970eb56 100644 --- a/docs/FingerprintApi.md +++ b/docs/FingerprintApi.md @@ -100,7 +100,7 @@ Name | Type | Description | Notes **request_id** | **str**| Filter visits by requestId | [optional] **linked_id** | **str**| Filter visits by custom identifier | [optional] **limit** | **int**| Limit scanned results | [optional] - **before** | **int**| Used to paginate results | [optional] + **before** | **int**| Timestamp (in milliseconds since epoch) used to paginate results | [optional] ### Return type @@ -113,7 +113,7 @@ Name | Type | Description | Notes ### HTTP request headers - **Content-Type**: Not defined - - **Accept**: application/json, text/html + - **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) diff --git a/docs/IdentificationError.md b/docs/IdentificationError.md new file mode 100644 index 00000000..090a3dcb --- /dev/null +++ b/docs/IdentificationError.md @@ -0,0 +1,10 @@ +# IdentificationError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **str** | Error code: * `429 Too Many Requests` - the limit on secret API key requests per second has been exceeded * `Failed` - internal server error | +**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/ProductsResponseIdentification.md b/docs/ProductsResponseIdentification.md index 73f421eb..ef9012fd 100644 --- a/docs/ProductsResponseIdentification.md +++ b/docs/ProductsResponseIdentification.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**ProductsResponseIdentificationData**](ProductsResponseIdentificationData.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/fingerprint_pro_server_api_sdk/__init__.py b/fingerprint_pro_server_api_sdk/__init__.py index 5c5b941e..12b37b80 100644 --- a/fingerprint_pro_server_api_sdk/__init__.py +++ b/fingerprint_pro_server_api_sdk/__init__.py @@ -29,9 +29,11 @@ from fingerprint_pro_server_api_sdk.models.error_event403_response_error import ErrorEvent403ResponseError 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 from fingerprint_pro_server_api_sdk.models.event_response import EventResponse from fingerprint_pro_server_api_sdk.models.ip_location import IPLocation from fingerprint_pro_server_api_sdk.models.ip_location_city import IPLocationCity +from fingerprint_pro_server_api_sdk.models.identification_error import IdentificationError from fingerprint_pro_server_api_sdk.models.location import Location from fingerprint_pro_server_api_sdk.models.many_requests_response import ManyRequestsResponse from fingerprint_pro_server_api_sdk.models.products_response import ProductsResponse diff --git a/fingerprint_pro_server_api_sdk/api/fingerprint_api.py b/fingerprint_pro_server_api_sdk/api/fingerprint_api.py index 03802ff2..a39bc317 100644 --- a/fingerprint_pro_server_api_sdk/api/fingerprint_api.py +++ b/fingerprint_pro_server_api_sdk/api/fingerprint_api.py @@ -142,7 +142,7 @@ def get_visits(self, visitor_id, **kwargs): # noqa: E501 :param str request_id: Filter visits by requestId :param str linked_id: Filter visits by custom identifier :param int limit: Limit scanned results - :param int before: Used to paginate results + :param int before: Timestamp (in milliseconds since epoch) used to paginate results :return: Response If the method is called asynchronously, returns the request thread. @@ -168,7 +168,7 @@ def get_visits_with_http_info(self, visitor_id, **kwargs): # noqa: E501 :param str request_id: Filter visits by requestId :param str linked_id: Filter visits by custom identifier :param int limit: Limit scanned results - :param int before: Used to paginate results + :param int before: Timestamp (in milliseconds since epoch) used to paginate results :return: Response If the method is called asynchronously, returns the request thread. @@ -219,7 +219,7 @@ def get_visits_with_http_info(self, visitor_id, **kwargs): # noqa: E501 body_params = None # HTTP header `Accept` header_params['Accept'] = self.api_client.select_header_accept( - ['application/json', 'text/html']) # noqa: E501 + ['application/json']) # noqa: E501 # Authentication setting auth_settings = ['ApiKeyHeader', 'ApiKeyQuery'] # noqa: E501 diff --git a/fingerprint_pro_server_api_sdk/models/__init__.py b/fingerprint_pro_server_api_sdk/models/__init__.py index 7134495d..b2478ee0 100644 --- a/fingerprint_pro_server_api_sdk/models/__init__.py +++ b/fingerprint_pro_server_api_sdk/models/__init__.py @@ -23,9 +23,11 @@ from fingerprint_pro_server_api_sdk.models.error_event403_response_error import ErrorEvent403ResponseError 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 from fingerprint_pro_server_api_sdk.models.event_response import EventResponse from fingerprint_pro_server_api_sdk.models.ip_location import IPLocation from fingerprint_pro_server_api_sdk.models.ip_location_city import IPLocationCity +from fingerprint_pro_server_api_sdk.models.identification_error import IdentificationError from fingerprint_pro_server_api_sdk.models.location import Location from fingerprint_pro_server_api_sdk.models.many_requests_response import ManyRequestsResponse from fingerprint_pro_server_api_sdk.models.products_response import ProductsResponse diff --git a/fingerprint_pro_server_api_sdk/models/error_visits403.py b/fingerprint_pro_server_api_sdk/models/error_visits403.py new file mode 100644 index 00000000..2d147667 --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/error_visits403.py @@ -0,0 +1,116 @@ +# coding: utf-8 + +""" + 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 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class ErrorVisits403(object): + """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 + """ErrorVisits403 - a model defined in Swagger""" # noqa: E501 + self._error = None + self.discriminator = None + self.error = error + + @property + def error(self): + """Gets the error of this ErrorVisits403. # noqa: E501 + + Error text. # noqa: E501 + + :return: The error of this ErrorVisits403. # noqa: E501 + :rtype: str + """ + return self._error + + @error.setter + def error(self, error): + """Sets the error of this ErrorVisits403. + + Error text. # noqa: E501 + + :param error: The error of this ErrorVisits403. # noqa: E501 + :type: str + """ + if error is None: + raise ValueError("Invalid value for `error`, must not be `None`") # noqa: E501 + + self._error = error + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + 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() + )) + else: + result[attr] = value + if issubclass(ErrorVisits403, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, ErrorVisits403): + 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, ErrorVisits403): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/identification_error.py b/fingerprint_pro_server_api_sdk/models/identification_error.py new file mode 100644 index 00000000..b2ad6eeb --- /dev/null +++ b/fingerprint_pro_server_api_sdk/models/identification_error.py @@ -0,0 +1,149 @@ +# coding: utf-8 + +""" + 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 + + OpenAPI spec version: 3 + Contact: support@fingerprint.com + Generated by: https://github.com/swagger-api/swagger-codegen.git +""" + +import pprint +import re # noqa: F401 + +import six + +class IdentificationError(object): + """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', + 'message': 'str' + } + + attribute_map = { + 'code': 'code', + 'message': 'message' + } + + def __init__(self, code=None, message=None): # noqa: E501 + """IdentificationError - 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): + """Gets the code of this IdentificationError. # noqa: E501 + + Error code: * `429 Too Many Requests` - the limit on secret API key requests per second has been exceeded * `Failed` - internal server error # noqa: E501 + + :return: The code of this IdentificationError. # noqa: E501 + :rtype: str + """ + return self._code + + @code.setter + def code(self, code): + """Sets the code of this IdentificationError. + + Error code: * `429 Too Many Requests` - the limit on secret API key requests per second has been exceeded * `Failed` - internal server error # noqa: E501 + + :param code: The code of this IdentificationError. # noqa: E501 + :type: str + """ + if code is None: + raise ValueError("Invalid value for `code`, must not be `None`") # noqa: E501 + allowed_values = ["429 Too Many Requests", "Failed"] # noqa: E501 + if (code not in allowed_values): + raise ValueError( + "Invalid value for `code` ({0}), must be one of {1}" # noqa: E501 + .format(code, allowed_values) + ) + + self._code = code + + @property + def message(self): + """Gets the message of this IdentificationError. # noqa: E501 + + + :return: The message of this IdentificationError. # noqa: E501 + :rtype: str + """ + return self._message + + @message.setter + def message(self, message): + """Sets the message of this IdentificationError. + + + :param message: The message of this IdentificationError. # noqa: E501 + :type: str + """ + if message is None: + raise ValueError("Invalid value for `message`, must not be `None`") # noqa: E501 + + self._message = message + + def to_dict(self): + """Returns the model properties as a dict""" + result = {} + + for attr, _ in six.iteritems(self.swagger_types): + 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() + )) + else: + result[attr] = value + if issubclass(IdentificationError, dict): + for key, value in self.items(): + result[key] = value + + return result + + def to_str(self): + """Returns the string representation of the model""" + return pprint.pformat(self.to_dict()) + + def __repr__(self): + """For `print` and `pprint`""" + return self.to_str() + + def __eq__(self, other): + """Returns true if both objects are equal""" + if not isinstance(other, IdentificationError): + 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, IdentificationError): + return True + + return self.to_dict() != other.to_dict() diff --git a/fingerprint_pro_server_api_sdk/models/products_response_identification.py b/fingerprint_pro_server_api_sdk/models/products_response_identification.py index 54088472..05a38527 100644 --- a/fingerprint_pro_server_api_sdk/models/products_response_identification.py +++ b/fingerprint_pro_server_api_sdk/models/products_response_identification.py @@ -28,19 +28,24 @@ class ProductsResponseIdentification(object): and the value is json key in definition. """ swagger_types = { - 'data': 'ProductsResponseIdentificationData' + 'data': 'ProductsResponseIdentificationData', + 'error': 'IdentificationError' } attribute_map = { - 'data': 'data' + 'data': 'data', + 'error': 'error' } - def __init__(self, data=None): # noqa: E501 + def __init__(self, data=None, error=None): # noqa: E501 """ProductsResponseIdentification - 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 ProductsResponseIdentification. # noqa: E501 + + + :return: The error of this ProductsResponseIdentification. # noqa: E501 + :rtype: IdentificationError + """ + return self._error + + @error.setter + def error(self, error): + """Sets the error of this ProductsResponseIdentification. + + + :param error: The error of this ProductsResponseIdentification. # noqa: E501 + :type: IdentificationError + """ + + self._error = error + def to_dict(self): """Returns the model properties as a dict""" result = {} diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index d7739798..ff8a956b 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -107,7 +107,7 @@ paths: ip: 61.127.217.15 time: '2019-05-21T16:40:13Z' withBotdError: - summary: Example response with BotD error + summary: Example error response with BotD error value: products: identification: @@ -158,6 +158,92 @@ paths: error: code: Failed message: internal server error + withBotdTooManyRequestsError: + summary: >- + Example error response with BotD error when too many + requests are sent + value: + products: + identification: + data: + visitorId: Ibk1527CUFmcnjLwIs4A9 + requestId: 0KSh65EnVoB85JBmloQK + incognito: true + linkedId: somelinkedId + 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 + 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 + botd: + error: + code: TooManyRequests + message: too many requests + withIdentificationError: + summary: Example error response with identification error + value: + products: + identification: + error: + code: Failed + message: failed + botd: + data: + url: https://example.com/login + bot: + result: notDetected + ip: 61.127.217.15 + time: '2019-05-21T16:40:13Z' + withIdentificationTooManyRequestsError: + summary: >- + Example error response with identification error when too + many requests are sent + value: + products: + identification: + error: + code: 429 Too Many Requests + message: too many requests + botd: + data: + url: https://example.com/login + bot: + result: notDetected + ip: 61.127.217.15 + time: '2019-05-21T16:40:13Z' '403': description: Forbidden content: @@ -184,21 +270,6 @@ paths: error: code: RequestNotFound message: request id is not found - '429': - description: Too Many Requests - headers: - Retry-After: - description: >- - Indicates how long the user should wait in seconds before - attempting the next request. - schema: - type: integer - format: int32 - minimum: 0 - content: - application/json: - schema: - $ref: '#/components/schemas/ManyRequestsResponse' /visitors/{visitor_id}: get: tags: @@ -235,11 +306,11 @@ paths: format: int32 minimum: 0 - name: before - description: Used to paginate results + description: Timestamp (in milliseconds since epoch) used to paginate results in: query schema: type: integer - format: int32 + format: int64 minimum: 0 responses: '200': @@ -2929,12 +3000,12 @@ paths: '403': description: Forbidden. Probably ApiKey is missed or provided the wrong one. content: - text/html: + application/json: schema: - type: string - example: > - 403 Forbidden -

403 Forbidden

+ $ref: '#/components/schemas/ErrorVisits403' + examples: + forbidden: + value: '{"error": "Forbidden (HTTP 403)"}' '429': description: Too Many Requests headers: @@ -2950,6 +3021,12 @@ paths: application/json: schema: $ref: '#/components/schemas/ManyRequestsResponse' + examples: + example: + summary: Example too many requests error response + value: + error: + message: too many requests /webhook: trace: tags: @@ -3193,6 +3270,16 @@ components: required: - code - message + ErrorVisits403: + type: object + additionalProperties: false + properties: + error: + type: string + description: Error text. + example: Forbidden (HTTP 403) + required: + - error ManyRequestsResponse: type: object additionalProperties: false @@ -3601,6 +3688,8 @@ components: - url - visitorFound - visitorId + error: + $ref: '#/components/schemas/IdentificationError' botd: title: ProductsResponseBotd type: object @@ -3619,6 +3708,26 @@ components: properties: products: $ref: '#/components/schemas/ProductsResponse' + IdentificationError: + type: object + additionalProperties: false + properties: + code: + type: string + description: | + Error code: + * `429 Too Many Requests` - the limit on secret API key requests per second has been exceeded + * `Failed` - internal server error + enum: + - 429 Too Many Requests + - Failed + example: 429 Too Many Requests + message: + type: string + example: too many requests + required: + - code + - message BotdResult: type: object description: Contains all the information from Bot Detection product