From 9b42d6b984a0c8c65a98faeea21bd86460a51df1 Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Thu, 11 Jul 2024 21:24:23 +0200 Subject: [PATCH] feat: add `revision` field to the `confidence` signal --- docs/Confidence.md | 1 + .../models/confidence.py | 34 +++++++++++++++++-- res/fingerprint-server-api.yaml | 6 ++++ test/mocks/get_event_200_extra_fields.json | 3 +- 4 files changed, 40 insertions(+), 4 deletions(-) diff --git a/docs/Confidence.md b/docs/Confidence.md index b1ee40b6..eba9ccd6 100644 --- a/docs/Confidence.md +++ b/docs/Confidence.md @@ -4,6 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **score** | **float** | The confidence score is a floating-point number between 0 and 1 that represents the probability of accurate identification. | +**revision** | **str** | The revision name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. | [optional] [[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) diff --git a/fingerprint_pro_server_api_sdk/models/confidence.py b/fingerprint_pro_server_api_sdk/models/confidence.py index af078d21..7faa6f95 100644 --- a/fingerprint_pro_server_api_sdk/models/confidence.py +++ b/fingerprint_pro_server_api_sdk/models/confidence.py @@ -28,18 +28,23 @@ class Confidence(object): and the value is json key in definition. """ swagger_types = { - 'score': 'float' + 'score': 'float', + 'revision': 'str' } attribute_map = { - 'score': 'score' + 'score': 'score', + 'revision': 'revision' } - def __init__(self, score=None): # noqa: E501 + def __init__(self, score=None, revision=None): # noqa: E501 """Confidence - a model defined in Swagger""" # noqa: E501 self._score = None + self._revision = None self.discriminator = None self.score = score + if revision is not None: + self.revision = revision @property def score(self): @@ -66,6 +71,29 @@ def score(self, score): self._score = score + @property + def revision(self): + """Gets the revision of this Confidence. # noqa: E501 + + The revision name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. # noqa: E501 + + :return: The revision of this Confidence. # noqa: E501 + :rtype: str + """ + return self._revision + + @revision.setter + def revision(self, revision): + """Sets the revision of this Confidence. + + The revision name of the method used to calculate the Confidence score. This field is only present for customers who opted in to an alternative calculation method. # noqa: E501 + + :param revision: The revision of this Confidence. # noqa: E501 + :type: str + """ + + self._revision = revision + 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 187ae5a4..9f5bab02 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -946,6 +946,12 @@ components: format: float minimum: 0 maximum: 1 + revision: + description: >- + The revision name of the method used to calculate the Confidence + score. This field is only present for customers who opted in to an + alternative calculation method. + type: string required: - score title: Confidence diff --git a/test/mocks/get_event_200_extra_fields.json b/test/mocks/get_event_200_extra_fields.json index cef43a2c..c15eb568 100644 --- a/test/mocks/get_event_200_extra_fields.json +++ b/test/mocks/get_event_200_extra_fields.json @@ -45,7 +45,8 @@ "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." }, "confidence": { - "score": 0.97 + "score": 0.97, + "revision": "v1.1" }, "visitorFound": true, "firstSeenAt": {