Skip to content

Commit

Permalink
feat: change api to return tuple instead of serialized model
Browse files Browse the repository at this point in the history
BREAKING CHANGE: API Methods returns tuple instead of models
BREAKING CHANGE: API Methods removed other than `getModel`
  • Loading branch information
Orkuncakilkaya committed Jul 24, 2024
1 parent 66d9015 commit 62e4ad3
Show file tree
Hide file tree
Showing 6 changed files with 80 additions and 415 deletions.
22 changes: 14 additions & 8 deletions docs/Api/FingerprintApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Method | HTTP request | Description
[**getVisits**](FingerprintApi.md#getVisits) | **GET** /visitors/{visitor_id} | Get visits by visitorId

# **getEvent**
> \Fingerprint\ServerAPI\Model\EventResponse getEvent($request_id)
> [ \Fingerprint\ServerAPI\Model\EventResponse, \Psr\Http\Message\ResponseInterface ] getEvent($request_id)
Get event by requestId

Expand Down Expand Up @@ -37,8 +37,8 @@ $config
$request_id = "request_id_example"; // string | The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request.

try {
$result = $client->getEvent($request_id);
echo "<pre>" . $response->__toString() . "</pre>";
list($model, $httpResponse) = $client->getEvent($request_id);
echo "<pre>" . $httpResponse->getBody()->getContents() . "</pre>";
} catch (Exception $e) {
echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL;
}
Expand All @@ -53,7 +53,10 @@ Name | Type | Description | Notes

### Return type

[**\Fingerprint\ServerAPI\Model\EventResponse**](../Model/EventResponse.md)
Array:
0. [**\Fingerprint\ServerAPI\Model\EventResponse**](../Model/EventResponse.md) | null,
1. \Psr\Http\Message\ResponseInterface


### Authorization

Expand All @@ -67,7 +70,7 @@ Name | Type | Description | Notes
[[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)

# **getVisits**
> \Fingerprint\ServerAPI\Model\Response getVisits($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before)
> [ \Fingerprint\ServerAPI\Model\Response, \Psr\Http\Message\ResponseInterface ] getVisits($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before)
Get visits by visitorId

Expand Down Expand Up @@ -101,8 +104,8 @@ $pagination_key = "pagination_key_example"; // string | Use `paginationKey` to g
$before = 789; // int | ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results.

try {
$result = $client->getVisits($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before);
echo "<pre>" . $response->__toString() . "</pre>";
list($model, $httpResponse) = $client->getVisits($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before);
echo "<pre>" . $httpResponse->getBody()->getContents() . "</pre>";
} catch (Exception $e) {
echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL;
}
Expand All @@ -122,7 +125,10 @@ Name | Type | Description | Notes

### Return type

[**\Fingerprint\ServerAPI\Model\Response**](../Model/Response.md)
Array:
0. [**\Fingerprint\ServerAPI\Model\Response**](../Model/Response.md) | null,
1. \Psr\Http\Message\ResponseInterface


### Authorization

Expand Down
8 changes: 4 additions & 4 deletions run_checks.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@
error_reporting(error_reporting() & ~E_DEPRECATED);

try {
list($result, $body) = $client->getVisitsWithHttpInfo($visitor_id);
fwrite(STDOUT, sprintf("Got visits: %s \n", $body));
list($result, $response) = $client->getVisits($visitor_id);
fwrite(STDOUT, sprintf("Got visits: %s \n", $response->getBody()->getContents()));
} catch (Exception $e) {
fwrite(STDERR, sprintf("Exception when calling FingerprintApi->getVisits: %s\n", $e->getMessage()));
exit(1);
}

try {
list($result, $body) = $client->getEventWithHttpInfo($request_id);
fwrite(STDOUT, sprintf("\n\nGot event: %s \n", $body));
list($result, $response) = $client->getEvent($request_id);
fwrite(STDOUT, sprintf("\n\nGot event: %s \n", $response->getBody()->getContents()));
} catch (Exception $e) {
fwrite(STDERR, sprintf("\n\nException when calling FingerprintApi->getVisits: %s\n", $e->getMessage()));
exit(1);
Expand Down
Loading

0 comments on commit 62e4ad3

Please sign in to comment.