From e8a28f69d08a7969af3b1b66ef399aacd4bc14d1 Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Thu, 1 Aug 2024 16:45:24 +0200 Subject: [PATCH] fix: make `tag` field optional for webhook --- docs/Visit.md | 2 +- docs/WebhookVisit.md | 2 +- fingerprint_pro_server_api_sdk/models/visit.py | 5 ++--- fingerprint_pro_server_api_sdk/models/webhook_visit.py | 5 ++--- res/fingerprint-server-api.yaml | 6 ++---- 5 files changed, 8 insertions(+), 12 deletions(-) diff --git a/docs/Visit.md b/docs/Visit.md index fe4e708d..d382baaf 100644 --- a/docs/Visit.md +++ b/docs/Visit.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. | **time** | **datetime** | Time expressed according to ISO 8601 in UTC format. | **url** | **str** | Page URL from which the identification request was sent. | -**tag** | **dict(str, object)** | A customer-provided value or an object that was sent with identification request. | +**tag** | **dict(str, object)** | A customer-provided value or an object that was sent with identification request. | [optional] **linked_id** | **str** | A customer-provided id that was sent with identification request. | [optional] **confidence** | [**Confidence**](Confidence.md) | | [optional] **visitor_found** | **bool** | Attribute represents if a visitor had been identified before. | diff --git a/docs/WebhookVisit.md b/docs/WebhookVisit.md index f4da26f2..0e443e73 100644 --- a/docs/WebhookVisit.md +++ b/docs/WebhookVisit.md @@ -36,7 +36,7 @@ Name | Type | Description | Notes **timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. | **time** | **datetime** | Time expressed according to ISO 8601 in UTC format. | **url** | **str** | Page URL from which the identification request was sent. | -**tag** | **dict(str, object)** | A customer-provided value or an object that was sent with identification request. | +**tag** | **dict(str, object)** | A customer-provided value or an object that was sent with identification request. | [optional] **linked_id** | **str** | A customer-provided id that was sent with identification request. | [optional] **confidence** | [**Confidence**](Confidence.md) | | [optional] **visitor_found** | **bool** | Attribute represents if a visitor had been identified before. | diff --git a/fingerprint_pro_server_api_sdk/models/visit.py b/fingerprint_pro_server_api_sdk/models/visit.py index 82522752..3f63b78b 100644 --- a/fingerprint_pro_server_api_sdk/models/visit.py +++ b/fingerprint_pro_server_api_sdk/models/visit.py @@ -93,7 +93,8 @@ def __init__(self, request_id=None, browser_details=None, incognito=None, ip=Non self.timestamp = timestamp self.time = time self.url = url - self.tag = tag + if tag is not None: + self.tag = tag if linked_id is not None: self.linked_id = linked_id if confidence is not None: @@ -296,8 +297,6 @@ def tag(self, tag: Dict[str, object]): :param tag: The tag of this Visit. # noqa: E501 """ - if tag is None: - raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 self._tag = tag diff --git a/fingerprint_pro_server_api_sdk/models/webhook_visit.py b/fingerprint_pro_server_api_sdk/models/webhook_visit.py index 34774587..2b7be297 100644 --- a/fingerprint_pro_server_api_sdk/models/webhook_visit.py +++ b/fingerprint_pro_server_api_sdk/models/webhook_visit.py @@ -239,7 +239,8 @@ def __init__(self, visitor_id=None, client_referrer=None, user_agent=None, bot=N self.timestamp = timestamp self.time = time self.url = url - self.tag = tag + if tag is not None: + self.tag = tag if linked_id is not None: self.linked_id = linked_id if confidence is not None: @@ -919,8 +920,6 @@ def tag(self, tag: Dict[str, object]): :param tag: The tag of this WebhookVisit. # noqa: E501 """ - if tag is None: - raise ValueError("Invalid value for `tag`, must not be `None`") # noqa: E501 self._tag = tag diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index 8d365ec3..f6e6d701 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -670,8 +670,8 @@ components: - time - timestamp - url - - tag - visitorFound + - tag lastTimestamp: description: > ⚠️ Deprecated paging attribute, please use `paginationKey` instead. @@ -998,7 +998,6 @@ components: - time - timestamp - url - - tag - visitorFound Visit: type: object @@ -1109,7 +1108,6 @@ components: - time - timestamp - url - - tag - visitorFound title: Visit BrowserDetails: @@ -1429,9 +1427,9 @@ components: - time - timestamp - url - - tag - visitorFound - visitorId + - tag error: $ref: '#/components/schemas/IdentificationError' botd: