From 1719ed46ec6b6aed87ec04393443cc23f8d9f5fa Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Mon, 28 Oct 2024 18:30:51 +0100 Subject: [PATCH] docs: fix documentation and examples --- README.md | 12 ++++++------ docs/FingerprintApi.md | 4 ---- template/README.mustache | 12 ++++++------ template/api_doc.mustache | 1 - update_event_example.py | 4 ++-- 5 files changed, 14 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 8c8ae66e..ab571ca5 100644 --- a/README.md +++ b/README.md @@ -152,20 +152,20 @@ except ApiException as e: Update event for requestId: ```python import fingerprint_pro_server_api_sdk -from fingerprint_pro_server_api_sdk import EventUpdateRequest +from fingerprint_pro_server_api_sdk import EventsUpdateRequest from fingerprint_pro_server_api_sdk.rest import ApiException, KnownApiException configuration = fingerprint_pro_server_api_sdk.Configuration(api_key="SECRET_API_KEY") api_instance = fingerprint_pro_server_api_sdk.FingerprintApi(configuration) request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). -body = EventUpdateRequest(linked_id='foo') # EventUpdateRequest | -# body = EventUpdateRequest(tag={'bar': 123}) -# body = EventUpdateRequest(suspect=True) -# body = EventUpdateRequest(linked_id='foo', tag={'bar': 123}, suspect=False) +body = EventsUpdateRequest(linked_id='foo') # EventsUpdateRequest | +# body = EventsUpdateRequest(tag={'bar': 123}) +# body = EventsUpdateRequest(suspect=True) +# body = EventsUpdateRequest(linked_id='foo', tag={'bar': 123}, suspect=False) try: - api_instance.update_event(request_id, body) + api_instance.update_event(body, request_id) except KnownApiException as e: structured_error = e.structured_error print("Error code: %s. Error message: %s\n" % (structured_error.error.code, structured_error.error.message)) diff --git a/docs/FingerprintApi.md b/docs/FingerprintApi.md index 89f74bda..72c85023 100644 --- a/docs/FingerprintApi.md +++ b/docs/FingerprintApi.md @@ -19,7 +19,6 @@ Request deleting all data associated with the specified visitor ID. This API is ### Example ```python import fingerprint_pro_server_api_sdk -from fingerprint_pro_server_api_sdk import Response from fingerprint_pro_server_api_sdk.rest import ApiException # Configure API key authorization and region @@ -69,7 +68,6 @@ Get a detailed analysis of an individual identification event, including Smart S ### Example ```python import fingerprint_pro_server_api_sdk -from fingerprint_pro_server_api_sdk import Response from fingerprint_pro_server_api_sdk.rest import ApiException # Configure API key authorization and region @@ -120,7 +118,6 @@ Get a history of visits (identification events) for a specific `visitorId`. Use ### Example ```python import fingerprint_pro_server_api_sdk -from fingerprint_pro_server_api_sdk import Response from fingerprint_pro_server_api_sdk.rest import ApiException # Configure API key authorization and region @@ -181,7 +178,6 @@ Change information in existing events specified by `requestId` or *flag suspicio ### Example ```python import fingerprint_pro_server_api_sdk -from fingerprint_pro_server_api_sdk import Response from fingerprint_pro_server_api_sdk.rest import ApiException # Configure API key authorization and region diff --git a/template/README.mustache b/template/README.mustache index 8a0007e7..a8edc9b7 100644 --- a/template/README.mustache +++ b/template/README.mustache @@ -158,20 +158,20 @@ except ApiException as e: Update event for requestId: ```python import {{packageName}} -from {{packageName}} import EventUpdateRequest +from {{packageName}} import EventsUpdateRequest from {{packageName}}.rest import ApiException, KnownApiException configuration = {{packageName}}.Configuration(api_key="SECRET_API_KEY") api_instance = {{packageName}}.FingerprintApi(configuration) request_id = 'request_id_example' # str | The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). -body = EventUpdateRequest(linked_id='foo') # EventUpdateRequest | -# body = EventUpdateRequest(tag={'bar': 123}) -# body = EventUpdateRequest(suspect=True) -# body = EventUpdateRequest(linked_id='foo', tag={'bar': 123}, suspect=False) +body = EventsUpdateRequest(linked_id='foo') # EventsUpdateRequest | +# body = EventsUpdateRequest(tag={'bar': 123}) +# body = EventsUpdateRequest(suspect=True) +# body = EventsUpdateRequest(linked_id='foo', tag={'bar': 123}, suspect=False) try: - api_instance.update_event(request_id, body) + api_instance.update_event(body, request_id) except KnownApiException as e: structured_error = e.structured_error print("Error code: %s. Error message: %s\n" % (structured_error.error.code, structured_error.error.message)) diff --git a/template/api_doc.mustache b/template/api_doc.mustache index 5ea305ba..f3f2a003 100644 --- a/template/api_doc.mustache +++ b/template/api_doc.mustache @@ -20,7 +20,6 @@ Method | HTTP request | Description ### Example ```python import {{{packageName}}} -from {{{packageName}}} import Response from {{{packageName}}}.rest import ApiException # Configure API key authorization and region diff --git a/update_event_example.py b/update_event_example.py index be44f535..ccf48e61 100644 --- a/update_event_example.py +++ b/update_event_example.py @@ -3,7 +3,7 @@ import fingerprint_pro_server_api_sdk from fingerprint_pro_server_api_sdk.rest import ApiException -from fingerprint_pro_server_api_sdk.models import EventUpdateRequest +from fingerprint_pro_server_api_sdk.models import EventsUpdateRequest from dotenv import load_dotenv @@ -25,7 +25,7 @@ request_id = os.environ["REQUEST_ID_TO_UPDATE"] try: - updateBody = EventUpdateRequest(**vars(args)) + updateBody = EventsUpdateRequest(**vars(args)) print(f'updateBody: {updateBody}') api_instance.update_event(updateBody, request_id) except ApiException as e: