From 30b10cbbd3f8dafd33b8978875cbb6c3aa5b3275 Mon Sep 17 00:00:00 2001 From: Ilya Taratukhin Date: Tue, 26 Nov 2024 17:59:42 +0100 Subject: [PATCH] docs: fix SDK usage examples --- x-readme/events.yaml | 18 ++++++++---------- x-readme/visitors.yaml | 18 ++++++++---------- 2 files changed, 16 insertions(+), 20 deletions(-) diff --git a/x-readme/events.yaml b/x-readme/events.yaml index 860a7eee..3487d96f 100644 --- a/x-readme/events.yaml +++ b/x-readme/events.yaml @@ -42,8 +42,9 @@ // Get a specific fingerprinting event try { - $response = $client->getEvent("REQUEST_ID"); - echo "
" . $response->__toString() . "
"; + list($model, $response) = $client->getEvent("REQUEST_ID"); + echo "Status: " . $response_upd->getStatusCode(); + echo "
" . $model . "
"; } catch (Exception $e) { echo $e->getMessage(), PHP_EOL; } @@ -52,8 +53,6 @@ install: pip install fingerprint_pro_server_api_sdk code: | import fingerprint_pro_server_api_sdk - from fingerprint_pro_server_api_sdk import EventResponse - from fingerprint_pro_server_api_sdk import Response from fingerprint_pro_server_api_sdk.rest import ApiException configuration = fingerprint_pro_server_api_sdk.Configuration( @@ -64,13 +63,13 @@ # Get a specific fingerprinting event try: - event: EventResponse = api_instance.get_event("REQUEST_ID") + event = api_instance.get_event("REQUEST_ID") print(event) except ApiException as e: print("Exception when getting an event: %s\n" % e) - language: golang name: Go SDK - install: go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk + install: go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v7 code: | package main @@ -78,7 +77,7 @@ "context" "fmt" "github.com/antihax/optional" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v3/sdk" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v7/sdk" "log" ) @@ -105,8 +104,7 @@ name: Java SDK code: | import com.fingerprint.api.FingerprintApi; - import com.fingerprint.models.EventResponse; - import com.fingerprint.models.Response; + import com.fingerprint.models.EventsGetResponse; import com.fingerprint.sdk.ApiClient; import com.fingerprint.sdk.ApiException; import com.fingerprint.sdk.Configuration; @@ -122,7 +120,7 @@ // Get a specific fingerprinting event try { - EventResponse response = api.getEvent("REQUEST_ID"); + EventsGetResponse response = api.getEvent("REQUEST_ID"); System.out.println(response.getProducts().toString()); } catch (ApiException e) { System.err.println(e.getMessage()); diff --git a/x-readme/visitors.yaml b/x-readme/visitors.yaml index e75dc5c2..d5cc0435 100644 --- a/x-readme/visitors.yaml +++ b/x-readme/visitors.yaml @@ -42,8 +42,9 @@ // Get visit history of a specific visitor try { - $response = $client->getVisits("VISITOR_ID"); - echo "
" . $response->__toString() . "
"; + list($model, $response) = $client->getVisits("VISITOR_ID"); + echo "Status: " . $response_upd->getStatusCode(); + echo "
" . $model . "
"; } catch (Exception $e) { echo $e->getMessage(), PHP_EOL; } @@ -52,8 +53,6 @@ install: pip install fingerprint_pro_server_api_sdk code: | import fingerprint_pro_server_api_sdk - from fingerprint_pro_server_api_sdk import EventResponse - from fingerprint_pro_server_api_sdk import Response from fingerprint_pro_server_api_sdk.rest import ApiException configuration = fingerprint_pro_server_api_sdk.Configuration( @@ -64,13 +63,13 @@ # Get visit history of a specific visitor try: - visits: Response = api_instance.get_visits("VISITOR_ID", limit=10) + visits = api_instance.get_visits("VISITOR_ID", limit=10) print(visits) except ApiException as e: print("Exception when getting visits: %s\n" % e) - language: golang name: Go SDK - install: go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk + install: go get github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v7 code: | package main @@ -78,7 +77,7 @@ "context" "fmt" "github.com/antihax/optional" - "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v3/sdk" + "github.com/fingerprintjs/fingerprint-pro-server-api-go-sdk/v7/sdk" "log" ) @@ -108,8 +107,7 @@ name: Java SDK code: | import com.fingerprint.api.FingerprintApi; - import com.fingerprint.models.EventResponse; - import com.fingerprint.models.Response; + import com.fingerprint.models.VisitorsGetResponse; import com.fingerprint.sdk.ApiClient; import com.fingerprint.sdk.ApiException; import com.fingerprint.sdk.Configuration; @@ -125,7 +123,7 @@ // Get visit history of a specific visitor try { - Response response = api.getVisits("VISITOR_ID"); + VisitorsGetResponse response = api.getVisits("VISITOR_ID"); System.out.println(response.getVisits().toString()); } catch (ApiException e) { System.err.println(e.getMessage());