diff --git a/README.md b/README.md index 197331ae..812daa4b 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ const PAGINATION_KEY = "1683900801733.Ogvu1j"; // Import Fingerprint Pro Classes and Guzzle Http Client use Fingerprint\ServerAPI\Api\FingerprintApi; use Fingerprint\ServerAPI\Configuration; +use Fingerprint\ServerAPI\Model\EventUpdateRequest; use GuzzleHttp\Client; // Create a new Configuration instance with your Fingerprint Pro Server API Key and your Fingerprint Pro Server API Region. @@ -104,7 +105,7 @@ $client = new FingerprintApi( // Get an event with a given requestId try { // Fetch the event with a given requestId - $response = $client->getEvent(FPJS_REQUEST_ID); + list($model, $response) = $client->getEvent(FPJS_REQUEST_ID); echo "
" . $response->__toString() . ""; } catch (Exception $e) { echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; @@ -113,31 +114,56 @@ try { // Get a specific visitor's all visits try { // Fetch all visits with a given visitorId, with a page limit - $response = $client->getVisits(FPJS_VISITOR_ID, null, null, LIMIT); + list($model, $response) = $client->getVisits(FPJS_VISITOR_ID, null, null, LIMIT); echo "
" . $response->__toString() . ""; } catch (Exception $e) { - echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL; } // Get a specific visitor's all visits with a linkedId try { // Fetch all visits with a given visitorId, with a page limit, skipping the first visit - $response = $client->getVisits(FPJS_VISITOR_ID, null, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY); + list($model, $response) = $client->getVisits(FPJS_VISITOR_ID, null, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY); echo "
" . $response->__toString() . ""; } catch (Exception $e) { - echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL; } // Use all the parameters on getVisits try { // Fetch the visitor's all visits with a given requestId and linkedId with a page limit while skipping the first visit - $response = $client->getVisits(FPJS_VISITOR_ID, FPJS_REQUEST_ID, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY); + list($model, $response) = $client->getVisits(FPJS_VISITOR_ID, FPJS_REQUEST_ID, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY); echo "
" . $response->__toString() . ""; } catch (Exception $e) { - echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL; +} + +// Update Event +try { + $body = new EventUpdateRequest([ + 'linked_id' => 'new linked id', + 'tag' => json_encode(['new_property' => 'new value']), + 'suspect' => true, + ]); + list($model, $response) = $client->updateEvent($body, FPJS_REQUEST_ID); + echo "
" . $response->__toString() . ""; +} catch (Exception $e) { + echo 'Exception when calling FingerprintApi->updateEvent: ', $e->getMessage(), PHP_EOL; +} + +// Delete by visitor ID +try { + list($model, $response) = $client->deleteVisitorData(FPJS_VISITOR_ID); + echo "
" . $response->__toString() . ""; +} catch (Exception $e) { + echo 'Exception when calling FingerprintApi->deleteVisitorData: ', $e->getMessage(), PHP_EOL; } ``` +> ⚠️ Warning It's not possible to update events older than 10 days. + +> ⚠️ If you are interested in using `deleteVisitorData` API, please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + ## Sealed results This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results). @@ -207,8 +233,10 @@ if(!$isValidWebhookSign) { Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- -*FingerprintApi* | [**getEvent**](docs/Api/FingerprintApi.md#getevent) | **GET** /events/{request_id} | Get event by requestId -*FingerprintApi* | [**getVisits**](docs/Api/FingerprintApi.md#getvisits) | **GET** /visitors/{visitor_id} | Get visits by visitorId +*FingerprintApi* | [**deleteVisitorData**](docs/Api/FingerprintApi.md#deletevisitordata) | **DELETE** /visitors/{visitor_id} | Delete data by visitor ID +*FingerprintApi* | [**getEvent**](docs/Api/FingerprintApi.md#getevent) | **GET** /events/{request_id} | Get event by request ID +*FingerprintApi* | [**getVisits**](docs/Api/FingerprintApi.md#getvisits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID +*FingerprintApi* | [**updateEvent**](docs/Api/FingerprintApi.md#updateevent) | **PUT** /events/{request_id} | Update an event with a given request ID ## Documentation for Models @@ -217,17 +245,29 @@ Class | Method | HTTP request | Description - [BotdResult](docs/Model/BotdResult.md) - [BrowserDetails](docs/Model/BrowserDetails.md) - [ClonedAppResult](docs/Model/ClonedAppResult.md) + - [Common403ErrorResponse](docs/Model/Common403ErrorResponse.md) - [Confidence](docs/Model/Confidence.md) - [DataCenter](docs/Model/DataCenter.md) - [DeprecatedIPLocation](docs/Model/DeprecatedIPLocation.md) - [DeprecatedIPLocationCity](docs/Model/DeprecatedIPLocationCity.md) + - [DeveloperToolsResult](docs/Model/DeveloperToolsResult.md) - [EmulatorResult](docs/Model/EmulatorResult.md) - - [ErrorEvent403Response](docs/Model/ErrorEvent403Response.md) - - [ErrorEvent403ResponseError](docs/Model/ErrorEvent403ResponseError.md) + - [ErrorCommon403Response](docs/Model/ErrorCommon403Response.md) + - [ErrorCommon429Response](docs/Model/ErrorCommon429Response.md) + - [ErrorCommon429ResponseError](docs/Model/ErrorCommon429ResponseError.md) - [ErrorEvent404Response](docs/Model/ErrorEvent404Response.md) - [ErrorEvent404ResponseError](docs/Model/ErrorEvent404ResponseError.md) + - [ErrorUpdateEvent400Response](docs/Model/ErrorUpdateEvent400Response.md) + - [ErrorUpdateEvent400ResponseError](docs/Model/ErrorUpdateEvent400ResponseError.md) + - [ErrorUpdateEvent409Response](docs/Model/ErrorUpdateEvent409Response.md) + - [ErrorUpdateEvent409ResponseError](docs/Model/ErrorUpdateEvent409ResponseError.md) + - [ErrorVisitor400Response](docs/Model/ErrorVisitor400Response.md) + - [ErrorVisitor400ResponseError](docs/Model/ErrorVisitor400ResponseError.md) + - [ErrorVisitor404Response](docs/Model/ErrorVisitor404Response.md) + - [ErrorVisitor404ResponseError](docs/Model/ErrorVisitor404ResponseError.md) - [ErrorVisits403](docs/Model/ErrorVisits403.md) - [EventResponse](docs/Model/EventResponse.md) + - [EventUpdateRequest](docs/Model/EventUpdateRequest.md) - [FactoryResetResult](docs/Model/FactoryResetResult.md) - [FridaResult](docs/Model/FridaResult.md) - [HighActivityResult](docs/Model/HighActivityResult.md) @@ -243,7 +283,6 @@ Class | Method | HTTP request | Description - [JailbrokenResult](docs/Model/JailbrokenResult.md) - [Location](docs/Model/Location.md) - [LocationSpoofingResult](docs/Model/LocationSpoofingResult.md) - - [ManyRequestsResponse](docs/Model/ManyRequestsResponse.md) - [PrivacySettingsResult](docs/Model/PrivacySettingsResult.md) - [ProductError](docs/Model/ProductError.md) - [ProductsResponse](docs/Model/ProductsResponse.md) @@ -252,11 +291,13 @@ Class | Method | HTTP request | Description - [ProductsResponseIdentificationData](docs/Model/ProductsResponseIdentificationData.md) - [ProxyResult](docs/Model/ProxyResult.md) - [RawDeviceAttributesResult](docs/Model/RawDeviceAttributesResult.md) + - [RemoteControlResult](docs/Model/RemoteControlResult.md) - [Response](docs/Model/Response.md) - [ResponseVisits](docs/Model/ResponseVisits.md) - [RootAppsResult](docs/Model/RootAppsResult.md) - [SeenAt](docs/Model/SeenAt.md) - [SignalResponseClonedApp](docs/Model/SignalResponseClonedApp.md) + - [SignalResponseDeveloperTools](docs/Model/SignalResponseDeveloperTools.md) - [SignalResponseEmulator](docs/Model/SignalResponseEmulator.md) - [SignalResponseFactoryReset](docs/Model/SignalResponseFactoryReset.md) - [SignalResponseFrida](docs/Model/SignalResponseFrida.md) @@ -269,16 +310,22 @@ Class | Method | HTTP request | Description - [SignalResponsePrivacySettings](docs/Model/SignalResponsePrivacySettings.md) - [SignalResponseProxy](docs/Model/SignalResponseProxy.md) - [SignalResponseRawDeviceAttributes](docs/Model/SignalResponseRawDeviceAttributes.md) + - [SignalResponseRemoteControl](docs/Model/SignalResponseRemoteControl.md) - [SignalResponseRootApps](docs/Model/SignalResponseRootApps.md) - [SignalResponseSuspectScore](docs/Model/SignalResponseSuspectScore.md) - [SignalResponseTampering](docs/Model/SignalResponseTampering.md) - [SignalResponseTor](docs/Model/SignalResponseTor.md) + - [SignalResponseVelocity](docs/Model/SignalResponseVelocity.md) - [SignalResponseVirtualMachine](docs/Model/SignalResponseVirtualMachine.md) - [SignalResponseVpn](docs/Model/SignalResponseVpn.md) - [Subdivision](docs/Model/Subdivision.md) - [SuspectScoreResult](docs/Model/SuspectScoreResult.md) - [TamperingResult](docs/Model/TamperingResult.md) + - [TooManyRequestsResponse](docs/Model/TooManyRequestsResponse.md) - [TorResult](docs/Model/TorResult.md) + - [VelocityIntervalResult](docs/Model/VelocityIntervalResult.md) + - [VelocityIntervals](docs/Model/VelocityIntervals.md) + - [VelocityResult](docs/Model/VelocityResult.md) - [VirtualMachineResult](docs/Model/VirtualMachineResult.md) - [Visit](docs/Model/Visit.md) - [VpnResult](docs/Model/VpnResult.md) diff --git a/docs/Api/FingerprintApi.md b/docs/Api/FingerprintApi.md index 14da8e99..7f367e17 100644 --- a/docs/Api/FingerprintApi.md +++ b/docs/Api/FingerprintApi.md @@ -4,15 +4,78 @@ All URIs are relative to *https://api.fpjs.io* Method | HTTP request | Description ------------- | ------------- | ------------- -[**getEvent**](FingerprintApi.md#getEvent) | **GET** /events/{request_id} | Get event by requestId -[**getVisits**](FingerprintApi.md#getVisits) | **GET** /visitors/{visitor_id} | Get visits by visitorId +[**deleteVisitorData**](FingerprintApi.md#deleteVisitorData) | **DELETE** /visitors/{visitor_id} | Delete data by visitor ID +[**getEvent**](FingerprintApi.md#getEvent) | **GET** /events/{request_id} | Get event by request ID +[**getVisits**](FingerprintApi.md#getVisits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID +[**updateEvent**](FingerprintApi.md#updateEvent) | **PUT** /events/{request_id} | Update an event with a given request ID + +# **deleteVisitorData** +> deleteVisitorData($visitor_id) + +Delete data by visitor ID + +Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. All delete requests are queued: * Recent data (10 days or newer) belonging to the specified visitor will be deleted within 24 hours. * Data from older (11 days or more) identification events will be deleted after 90 days. If you are interested in using this API, please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + +### Example +```php +deleteVisitorData($visitor_id); +} catch (Exception $e) { + echo 'Exception when calling FingerprintApi->deleteVisitorData: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **visitor_id** | **string**| The [visitor ID](https://dev.fingerprint.com/docs/js-agent#visitorid) you want to delete. | + +### Return type + +Array: +0. null, +1. \Psr\Http\Message\ResponseInterface + + +### Authorization + +[ApiKeyHeader](../../README.md#ApiKeyHeader), [ApiKeyQuery](../../README.md#ApiKeyQuery) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +[[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) # **getEvent** > [ \Fingerprint\ServerAPI\Model\EventResponse, \Psr\Http\Message\ResponseInterface ] getEvent($request_id) -Get event by requestId +Get event by request ID -This endpoint allows you to get a detailed analysis of an individual request. **Only for Enterprise customers:** Please note that the response includes mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`. +Get a detailed analysis of an individual identification event, including Smart Signals. Please note that the response includes mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`. ### Example ```php @@ -34,7 +97,7 @@ $client = new FingerprintApi( $config ); -$request_id = "request_id_example"; // string | The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. +$request_id = "request_id_example"; // string | The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request. try { list($model, $httpResponse) = $client->getEvent($request_id); @@ -49,7 +112,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **request_id** | **string**| The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. | + **request_id** | **string**| The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request. | ### Return type @@ -72,9 +135,9 @@ Array: # **getVisits** > [ \Fingerprint\ServerAPI\Model\Response, \Psr\Http\Message\ResponseInterface ] getVisits($visitor_id, $request_id, $linked_id, $limit, $pagination_key, $before) -Get visits by visitorId +Get visits by visitor ID -This endpoint allows you to get a history of visits for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. #### Headers * `Retry-After` — Present in case of `429 Too many requests`. Indicates how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received. +Get a history of visits (identification events) for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. #### Headers * `Retry-After` — Present in case of `429 Too many requests`. Indicates how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received. ### Example ```php @@ -96,7 +159,7 @@ $client = new FingerprintApi( $config ); -$visitor_id = "visitor_id_example"; // string | Unique identifier of the visitor issued by Fingerprint Pro. +$visitor_id = "visitor_id_example"; // string | Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. $request_id = "request_id_example"; // string | Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. $linked_id = "linked_id_example"; // string | Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. $limit = 56; // int | Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. @@ -116,7 +179,7 @@ try { Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- - **visitor_id** | **string**| Unique identifier of the visitor issued by Fingerprint Pro. | + **visitor_id** | **string**| Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. | **request_id** | **string**| Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. | [optional] **linked_id** | **string**| Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. | [optional] **limit** | **int**| Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. | [optional] @@ -141,3 +204,66 @@ Array: [[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) +# **updateEvent** +> updateEvent($body, $request_id) + +Update an event with a given request ID + +Change information in existing events specified by `requestId` or *flag suspicious events*. When an event is created, it is assigned `linkedId` and `tag` submitted through the JS agent parameters. This information might not be available on the client so the Server API allows for updating the attributes after the fact. **Warning** It's not possible to update events older than 10 days. + +### Example +```php +updateEvent($body, $request_id); +} catch (Exception $e) { + echo 'Exception when calling FingerprintApi->updateEvent: ', $e->getMessage(), PHP_EOL; +} +?> +``` + +### Parameters + +Name | Type | Description | Notes +------------- | ------------- | ------------- | ------------- + **body** | [**\Fingerprint\ServerAPI\Model\EventUpdateRequest**](../Model/EventUpdateRequest.md)| | + **request_id** | **string**| The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). | + +### Return type + +Array: +0. null, +1. \Psr\Http\Message\ResponseInterface + + +### Authorization + +[ApiKeyHeader](../../README.md#ApiKeyHeader), [ApiKeyQuery](../../README.md#ApiKeyQuery) + +### HTTP request headers + +- **Content-Type**: application/json +- **Accept**: application/json + +[[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) + diff --git a/docs/Model/ErrorEvent403ResponseError.md b/docs/Model/Common403ErrorResponse.md similarity index 50% rename from docs/Model/ErrorEvent403ResponseError.md rename to docs/Model/Common403ErrorResponse.md index 5345b43e..e3addf80 100644 --- a/docs/Model/ErrorEvent403ResponseError.md +++ b/docs/Model/Common403ErrorResponse.md @@ -1,9 +1,9 @@ -# ErrorEvent403ResponseError +# Common403ErrorResponse ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **string** | Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - subscription not found for specified secret key * `SubscriptionNotActive` - subscription is not active * `WrongRegion` - server and subscription region differ | +**code** | **string** | Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty * `TokenNotFound` - No Fingerprint application found for specified secret key * `SubscriptionNotActive` - Fingerprint application is not active * `WrongRegion` - server and application region differ * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application | **message** | **string** | | [[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/docs/Model/Confidence.md b/docs/Model/Confidence.md index 4dac7913..43d3b8ba 100644 --- a/docs/Model/Confidence.md +++ b/docs/Model/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** | **string** | 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/docs/Model/DeveloperToolsResult.md b/docs/Model/DeveloperToolsResult.md new file mode 100644 index 00000000..18009671 --- /dev/null +++ b/docs/Model/DeveloperToolsResult.md @@ -0,0 +1,9 @@ +# DeveloperToolsResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | **bool** | `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. | + +[[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/docs/Model/ErrorEvent403Response.md b/docs/Model/ErrorCommon403Response.md similarity index 65% rename from docs/Model/ErrorEvent403Response.md rename to docs/Model/ErrorCommon403Response.md index b7ec39ad..77357404 100644 --- a/docs/Model/ErrorEvent403Response.md +++ b/docs/Model/ErrorCommon403Response.md @@ -1,9 +1,9 @@ -# ErrorEvent403Response +# ErrorCommon403Response ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**error** | [**\Fingerprint\ServerAPI\Model\ErrorEvent403ResponseError**](ErrorEvent403ResponseError.md) | | [optional] +**error** | [**\Fingerprint\ServerAPI\Model\Common403ErrorResponse**](Common403ErrorResponse.md) | | [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/docs/Model/ErrorCommon429Response.md b/docs/Model/ErrorCommon429Response.md new file mode 100644 index 00000000..dd294594 --- /dev/null +++ b/docs/Model/ErrorCommon429Response.md @@ -0,0 +1,9 @@ +# ErrorCommon429Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**\Fingerprint\ServerAPI\Model\ErrorCommon429ResponseError**](ErrorCommon429ResponseError.md) | | [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/docs/Model/ErrorCommon429ResponseError.md b/docs/Model/ErrorCommon429ResponseError.md new file mode 100644 index 00000000..d08585c8 --- /dev/null +++ b/docs/Model/ErrorCommon429ResponseError.md @@ -0,0 +1,10 @@ +# ErrorCommon429ResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | Error code: * `TooManyRequests` - The request is throttled. | +**message** | **string** | | + +[[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/docs/Model/ErrorEvent404ResponseError.md b/docs/Model/ErrorEvent404ResponseError.md index 63aa21af..34bb77e6 100644 --- a/docs/Model/ErrorEvent404ResponseError.md +++ b/docs/Model/ErrorEvent404ResponseError.md @@ -3,7 +3,7 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**code** | **string** | Error code: * `RequestNotFound` - request not found for specified id | +**code** | **string** | Error code: * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. | **message** | **string** | | [[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/docs/Model/ErrorUpdateEvent400Response.md b/docs/Model/ErrorUpdateEvent400Response.md new file mode 100644 index 00000000..475e5550 --- /dev/null +++ b/docs/Model/ErrorUpdateEvent400Response.md @@ -0,0 +1,9 @@ +# ErrorUpdateEvent400Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**\Fingerprint\ServerAPI\Model\ErrorUpdateEvent400ResponseError**](ErrorUpdateEvent400ResponseError.md) | | [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/docs/Model/ErrorUpdateEvent400ResponseError.md b/docs/Model/ErrorUpdateEvent400ResponseError.md new file mode 100644 index 00000000..ac9c40be --- /dev/null +++ b/docs/Model/ErrorUpdateEvent400ResponseError.md @@ -0,0 +1,10 @@ +# ErrorUpdateEvent400ResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | Error code: * `RequestCannotBeParsed` - the JSON content of the request contains some errors that prevented us from parsing it (wrong type/surpassed limits) * `Failed` - the event is more than 10 days old and cannot be updated | +**message** | **string** | Details about the underlying issue with the input payload | + +[[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/docs/Model/ErrorUpdateEvent409Response.md b/docs/Model/ErrorUpdateEvent409Response.md new file mode 100644 index 00000000..7d42bd68 --- /dev/null +++ b/docs/Model/ErrorUpdateEvent409Response.md @@ -0,0 +1,9 @@ +# ErrorUpdateEvent409Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**\Fingerprint\ServerAPI\Model\ErrorUpdateEvent409ResponseError**](ErrorUpdateEvent409ResponseError.md) | | [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/docs/Model/ErrorUpdateEvent409ResponseError.md b/docs/Model/ErrorUpdateEvent409ResponseError.md new file mode 100644 index 00000000..e5398089 --- /dev/null +++ b/docs/Model/ErrorUpdateEvent409ResponseError.md @@ -0,0 +1,10 @@ +# ErrorUpdateEvent409ResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | Error code: * `StateNotReady` - The event specified with request id is not ready for updates yet. Try again. This error happens in rare cases when update API is called immediately after receiving the request id on the client. In case you need to send information right away, we recommend using the JS agent API instead. | +**message** | **string** | | + +[[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/docs/Model/ErrorVisitor400Response.md b/docs/Model/ErrorVisitor400Response.md new file mode 100644 index 00000000..bd6a48d9 --- /dev/null +++ b/docs/Model/ErrorVisitor400Response.md @@ -0,0 +1,9 @@ +# ErrorVisitor400Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**\Fingerprint\ServerAPI\Model\ErrorVisitor400ResponseError**](ErrorVisitor400ResponseError.md) | | [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/docs/Model/ErrorVisitor400ResponseError.md b/docs/Model/ErrorVisitor400ResponseError.md new file mode 100644 index 00000000..656349f8 --- /dev/null +++ b/docs/Model/ErrorVisitor400ResponseError.md @@ -0,0 +1,10 @@ +# ErrorVisitor400ResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | Error code: * `RequestCannotBeParsed` - The visitor ID parameter is missing or in the wrong format. | +**message** | **string** | | + +[[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/docs/Model/ErrorVisitor404Response.md b/docs/Model/ErrorVisitor404Response.md new file mode 100644 index 00000000..0cf67550 --- /dev/null +++ b/docs/Model/ErrorVisitor404Response.md @@ -0,0 +1,9 @@ +# ErrorVisitor404Response + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**error** | [**\Fingerprint\ServerAPI\Model\ErrorVisitor404ResponseError**](ErrorVisitor404ResponseError.md) | | [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/docs/Model/ErrorVisitor404ResponseError.md b/docs/Model/ErrorVisitor404ResponseError.md new file mode 100644 index 00000000..95638b31 --- /dev/null +++ b/docs/Model/ErrorVisitor404ResponseError.md @@ -0,0 +1,10 @@ +# ErrorVisitor404ResponseError + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**code** | **string** | Error code: * `VisitorNotFound` - The specified visitor ID was not found. It never existed or it may have already been deleted. | +**message** | **string** | | + +[[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/docs/Model/EventUpdateRequest.md b/docs/Model/EventUpdateRequest.md new file mode 100644 index 00000000..fd2bc2ec --- /dev/null +++ b/docs/Model/EventUpdateRequest.md @@ -0,0 +1,11 @@ +# EventUpdateRequest + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**linked_id** | **string** | LinkedID value to assign to the existing event | [optional] +**tag** | **object** | Full `tag` value to be set to the existing event. Replaces any existing `tag` payload completely. | [optional] +**suspect** | **bool** | Suspect flag indicating observed suspicious or fraudulent event | [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/docs/Model/FactoryResetResult.md b/docs/Model/FactoryResetResult.md index a34b21a3..90f74510 100644 --- a/docs/Model/FactoryResetResult.md +++ b/docs/Model/FactoryResetResult.md @@ -3,8 +3,8 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**time** | [**\DateTime**](\DateTime.md) | Time in UTC when the most recent factory reset of the Android or iOS device was done. If there is no sign of factory reset or the client is not a mobile device, the field will contain the epoch time (1 January 1970) in UTC. | -**timestamp** | **int** | Same value as it's in the `time` field but represented in timestamp format. | +**time** | [**\DateTime**](\DateTime.md) | Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. | +**timestamp** | **int** | This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. | [[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/docs/Model/ProductsResponse.md b/docs/Model/ProductsResponse.md index d7e1101b..8ac08ff8 100644 --- a/docs/Model/ProductsResponse.md +++ b/docs/Model/ProductsResponse.md @@ -26,6 +26,9 @@ Name | Type | Description | Notes **location_spoofing** | [**\Fingerprint\ServerAPI\Model\SignalResponseLocationSpoofing**](SignalResponseLocationSpoofing.md) | | [optional] **suspect_score** | [**\Fingerprint\ServerAPI\Model\SignalResponseSuspectScore**](SignalResponseSuspectScore.md) | | [optional] **raw_device_attributes** | [**\Fingerprint\ServerAPI\Model\SignalResponseRawDeviceAttributes**](SignalResponseRawDeviceAttributes.md) | | [optional] +**remote_control** | [**\Fingerprint\ServerAPI\Model\SignalResponseRemoteControl**](SignalResponseRemoteControl.md) | | [optional] +**velocity** | [**\Fingerprint\ServerAPI\Model\SignalResponseVelocity**](SignalResponseVelocity.md) | | [optional] +**developer_tools** | [**\Fingerprint\ServerAPI\Model\SignalResponseDeveloperTools**](SignalResponseDeveloperTools.md) | | [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/docs/Model/RemoteControlResult.md b/docs/Model/RemoteControlResult.md new file mode 100644 index 00000000..537bffce --- /dev/null +++ b/docs/Model/RemoteControlResult.md @@ -0,0 +1,9 @@ +# RemoteControlResult + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**result** | **bool** | `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. | + +[[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/docs/Model/SignalResponseDeveloperTools.md b/docs/Model/SignalResponseDeveloperTools.md new file mode 100644 index 00000000..c293e285 --- /dev/null +++ b/docs/Model/SignalResponseDeveloperTools.md @@ -0,0 +1,10 @@ +# SignalResponseDeveloperTools + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fingerprint\ServerAPI\Model\DeveloperToolsResult**](DeveloperToolsResult.md) | | [optional] +**error** | [**\Fingerprint\ServerAPI\Model\ProductError**](ProductError.md) | | [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/docs/Model/SignalResponseIncognito.md b/docs/Model/SignalResponseIncognito.md index 5df868ed..53e226a2 100644 --- a/docs/Model/SignalResponseIncognito.md +++ b/docs/Model/SignalResponseIncognito.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**\Fingerprint\ServerAPI\Model\IncognitoResult**](IncognitoResult.md) | | [optional] -**error** | [**\Fingerprint\ServerAPI\Model\ProductError**](ProductError.md) | | [optional] +**error** | [**\Fingerprint\ServerAPI\Model\IdentificationError**](IdentificationError.md) | | [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/docs/Model/SignalResponseRawDeviceAttributes.md b/docs/Model/SignalResponseRawDeviceAttributes.md index c12d8772..479188d3 100644 --- a/docs/Model/SignalResponseRawDeviceAttributes.md +++ b/docs/Model/SignalResponseRawDeviceAttributes.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**\Fingerprint\ServerAPI\Model\RawDeviceAttributesResult**](RawDeviceAttributesResult.md) | | [optional] -**error** | [**\Fingerprint\ServerAPI\Model\ProductError**](ProductError.md) | | [optional] +**error** | [**\Fingerprint\ServerAPI\Model\IdentificationError**](IdentificationError.md) | | [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/docs/Model/SignalResponseRemoteControl.md b/docs/Model/SignalResponseRemoteControl.md new file mode 100644 index 00000000..c26787ac --- /dev/null +++ b/docs/Model/SignalResponseRemoteControl.md @@ -0,0 +1,10 @@ +# SignalResponseRemoteControl + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fingerprint\ServerAPI\Model\RemoteControlResult**](RemoteControlResult.md) | | [optional] +**error** | [**\Fingerprint\ServerAPI\Model\ProductError**](ProductError.md) | | [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/docs/Model/SignalResponseTampering.md b/docs/Model/SignalResponseTampering.md index 380db57c..c9fdb5ae 100644 --- a/docs/Model/SignalResponseTampering.md +++ b/docs/Model/SignalResponseTampering.md @@ -4,7 +4,7 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **data** | [**\Fingerprint\ServerAPI\Model\TamperingResult**](TamperingResult.md) | | [optional] -**error** | [**\Fingerprint\ServerAPI\Model\ProductError**](ProductError.md) | | [optional] +**error** | [**\Fingerprint\ServerAPI\Model\IdentificationError**](IdentificationError.md) | | [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/docs/Model/SignalResponseVelocity.md b/docs/Model/SignalResponseVelocity.md new file mode 100644 index 00000000..d86f7986 --- /dev/null +++ b/docs/Model/SignalResponseVelocity.md @@ -0,0 +1,10 @@ +# SignalResponseVelocity + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**data** | [**\Fingerprint\ServerAPI\Model\VelocityResult**](VelocityResult.md) | | [optional] +**error** | [**\Fingerprint\ServerAPI\Model\ProductError**](ProductError.md) | | [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/docs/Model/ManyRequestsResponse.md b/docs/Model/TooManyRequestsResponse.md similarity index 92% rename from docs/Model/ManyRequestsResponse.md rename to docs/Model/TooManyRequestsResponse.md index 83cceb45..ad069ea0 100644 --- a/docs/Model/ManyRequestsResponse.md +++ b/docs/Model/TooManyRequestsResponse.md @@ -1,4 +1,4 @@ -# ManyRequestsResponse +# TooManyRequestsResponse ## Properties Name | Type | Description | Notes diff --git a/docs/Model/VelocityIntervalResult.md b/docs/Model/VelocityIntervalResult.md new file mode 100644 index 00000000..fc14a4ec --- /dev/null +++ b/docs/Model/VelocityIntervalResult.md @@ -0,0 +1,13 @@ +# VelocityIntervalResult +Is absent if the velocity data could not be generated for the visitor ID. + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**_5m** | **int** | | +**_1h** | **int** | | +**_24h** | **int** | The `24h` interval of `distinctIp`, `distinctLinkedId`, and `distinctCountry` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. | [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/docs/Model/VelocityIntervals.md b/docs/Model/VelocityIntervals.md new file mode 100644 index 00000000..a68bbe0c --- /dev/null +++ b/docs/Model/VelocityIntervals.md @@ -0,0 +1,9 @@ +# VelocityIntervals + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**intervals** | [**\Fingerprint\ServerAPI\Model\VelocityIntervalResult**](VelocityIntervalResult.md) | | [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/docs/Model/VelocityResult.md b/docs/Model/VelocityResult.md new file mode 100644 index 00000000..0b45b8a3 --- /dev/null +++ b/docs/Model/VelocityResult.md @@ -0,0 +1,14 @@ +# VelocityResult +Sums key data points for a specific `visitorId` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: - Number of identification events attributed to the visitor ID - Number of distinct IP addresses associated to the visitor ID. - Number of distinct countries associated with the visitor ID. - Number of distinct `linkedId`s associated with the visitor ID. The `24h` interval of `distinctIp`, `distinctLinkedId`, and `distinctCountry` will be omitted if the number of `events` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. + + +## Properties +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**distinct_ip** | [**\Fingerprint\ServerAPI\Model\VelocityIntervals**](VelocityIntervals.md) | | +**distinct_linked_id** | [**\Fingerprint\ServerAPI\Model\VelocityIntervals**](VelocityIntervals.md) | | +**distinct_country** | [**\Fingerprint\ServerAPI\Model\VelocityIntervals**](VelocityIntervals.md) | | +**events** | [**\Fingerprint\ServerAPI\Model\VelocityIntervals**](VelocityIntervals.md) | | + +[[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/docs/Model/Visit.md b/docs/Model/Visit.md index 3c81e230..a2fe21c9 100644 --- a/docs/Model/Visit.md +++ b/docs/Model/Visit.md @@ -11,7 +11,7 @@ Name | Type | Description | Notes **timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. | **time** | [**\DateTime**](\DateTime.md) | Time expressed according to ISO 8601 in UTC format. | **url** | **string** | Page URL from which the identification request was sent. | -**tag** | **map[string,object]** | A customer-provided value or an object that was sent with identification request. | +**tag** | **map[string,object]** | A customer-provided value or an object that was sent with identification request. | [optional] **linked_id** | **string** | A customer-provided id that was sent with identification request. | [optional] **confidence** | [**\Fingerprint\ServerAPI\Model\Confidence**](Confidence.md) | | [optional] **visitor_found** | **bool** | Attribute represents if a visitor had been identified before. | diff --git a/docs/Model/VpnResultMethods.md b/docs/Model/VpnResultMethods.md index d70e5965..7762605c 100644 --- a/docs/Model/VpnResultMethods.md +++ b/docs/Model/VpnResultMethods.md @@ -3,9 +3,10 @@ ## Properties Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**timezone_mismatch** | **bool** | User's browser timezone doesn't match the timezone from which the request was originally made. | +**timezone_mismatch** | **bool** | The browser timezone doesn't match the timezone inferred from the request IP address. | **public_vpn** | **bool** | Request IP address is owned and used by a public VPN service provider. | **auxiliary_mobile** | **bool** | This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. | +**os_mismatch** | **bool** | The browser runs on a different operating system than the operating system inferred from the request network signature. | [[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/docs/Model/WebhookVisit.md b/docs/Model/WebhookVisit.md index 00652490..83351586 100644 --- a/docs/Model/WebhookVisit.md +++ b/docs/Model/WebhookVisit.md @@ -26,6 +26,9 @@ Name | Type | Description | Notes **high_activity** | [**\Fingerprint\ServerAPI\Model\HighActivityResult**](HighActivityResult.md) | | [optional] **location_spoofing** | [**\Fingerprint\ServerAPI\Model\LocationSpoofingResult**](LocationSpoofingResult.md) | | [optional] **suspect_score** | [**\Fingerprint\ServerAPI\Model\SuspectScoreResult**](SuspectScoreResult.md) | | [optional] +**remote_control** | [**\Fingerprint\ServerAPI\Model\RemoteControlResult**](RemoteControlResult.md) | | [optional] +**velocity** | [**\Fingerprint\ServerAPI\Model\VelocityResult**](VelocityResult.md) | | [optional] +**developer_tools** | [**\Fingerprint\ServerAPI\Model\DeveloperToolsResult**](DeveloperToolsResult.md) | | [optional] **request_id** | **string** | Unique identifier of the user's identification request. | **browser_details** | [**\Fingerprint\ServerAPI\Model\BrowserDetails**](BrowserDetails.md) | | **ip** | **string** | | @@ -33,7 +36,7 @@ Name | Type | Description | Notes **timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. | **time** | [**\DateTime**](\DateTime.md) | Time expressed according to ISO 8601 in UTC format. | **url** | **string** | Page URL from which the identification request was sent. | -**tag** | **map[string,object]** | A customer-provided value or an object that was sent with identification request. | +**tag** | **map[string,object]** | A customer-provided value or an object that was sent with identification request. | [optional] **linked_id** | **string** | A customer-provided id that was sent with identification request. | [optional] **confidence** | [**\Fingerprint\ServerAPI\Model\Confidence**](Confidence.md) | | [optional] **visitor_found** | **bool** | Attribute represents if a visitor had been identified before. | diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index 792ce049..f6e6d701 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -36,14 +36,13 @@ paths: tags: - Fingerprint operationId: getEvent - summary: Get event by requestId + summary: Get event by request ID description: > - This endpoint allows you to get a detailed analysis of an individual - request. + Get a detailed analysis of an individual identification event, including + Smart Signals. - **Only for Enterprise customers:** Please note that the response - includes mobile signals (e.g. `rootApps`) even if the request originated - from a non-mobile platform. + Please note that the response includes mobile signals (e.g. `rootApps`) + even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. @@ -57,7 +56,7 @@ paths: description: >- The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of - each analysis request. + each identification request. required: true schema: type: string @@ -73,21 +72,80 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ErrorEvent403Response' + $ref: '#/components/schemas/ErrorCommon403Response' '404': description: Not found content: application/json: schema: $ref: '#/components/schemas/ErrorEvent404Response' + put: + tags: + - Fingerprint + operationId: updateEvent + summary: Update an event with a given request ID + description: > + Change information in existing events specified by `requestId` or *flag + suspicious events*. + + + When an event is created, it is assigned `linkedId` and `tag` submitted + through the JS agent parameters. This information might not be available + on the client so the Server API allows for updating the attributes after + the fact. + + + **Warning** It's not possible to update events older than 10 days. + parameters: + - name: request_id + in: path + description: >- + The unique event + [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). + required: true + schema: + type: string + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EventUpdateRequest' + responses: + '200': + description: OK + '400': + description: Bad request + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorUpdateEvent400Response' + '403': + description: Forbidden + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorCommon403Response' + '404': + description: Not found + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorEvent404Response' + '409': + description: Conflict + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorUpdateEvent409Response' /visitors/{visitor_id}: get: tags: - Fingerprint operationId: getVisits - summary: Get visits by visitorId + summary: Get visits by visitor ID description: > - This endpoint allows you to get a history of visits for a specific + Get a history of visits (identification events) for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. @@ -102,7 +160,10 @@ paths: response is received. parameters: - name: visitor_id - description: Unique identifier of the visitor issued by Fingerprint Pro. + description: >- + Unique [visitor + identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) + issued by Fingerprint Pro. in: path required: true schema: @@ -210,8 +271,8 @@ paths: headers: Retry-After: description: >- - Indicates how long you should wait before attempting the next - request. + Indicates how many seconds you should wait before attempting the + next request. schema: type: integer format: int32 @@ -219,7 +280,70 @@ paths: content: application/json: schema: - $ref: '#/components/schemas/ManyRequestsResponse' + $ref: '#/components/schemas/TooManyRequestsResponse' + delete: + tags: + - Fingerprint + operationId: deleteVisitorData + summary: Delete data by visitor ID + description: > + Request deleting all data associated with the specified visitor ID. This + API is useful for compliance with privacy regulations. + + All delete requests are queued: + + + * Recent data (10 days or newer) belonging to the specified visitor will + be deleted within 24 hours. + + * Data from older (11 days or more) identification events will be + deleted after 90 days. + + + If you are interested in using this API, please [contact our support + team](https://fingerprint.com/support/) to enable it for you. Otherwise, + you will receive a 403. + parameters: + - name: visitor_id + in: path + description: >- + The [visitor + ID](https://dev.fingerprint.com/docs/js-agent#visitorid) you want to + delete. + required: true + schema: + type: string + responses: + '200': + description: OK. The visitor ID is scheduled for deletion. + '400': + description: >- + Bad request. The visitor ID parameter is missing or in the wrong + format. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorVisitor400Response' + '403': + description: Forbidden. Access to this API is denied. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorCommon403Response' + '404': + description: >- + Not found. The visitor ID cannot be found in this application's + data. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorVisitor404Response' + '429': + description: Too Many Requests. The request is throttled. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorCommon429Response' /webhook: trace: tags: @@ -346,6 +470,7 @@ paths: timezoneMismatch: false publicVPN: false auxiliaryMobile: false + osMismatch: false proxy: result: false tampering: @@ -388,6 +513,27 @@ paths: result: true suspectScore: result: 0 + remoteControl: + result: false + velocity: + distinctIp: + intervals: + 5m: 1 + 1h: 1 + 24h: 1 + distinctLinkedId: {} + distinctCountry: + intervals: + 5m: 1 + 1h: 2 + 24h: 2 + events: + intervals: + 5m: 1 + 1h: 5 + 24h: 5 + developerTools: + result: false responses: default: description: The server doesn't validate the answer. @@ -524,8 +670,8 @@ components: - time - timestamp - url - - tag - visitorFound + - tag lastTimestamp: description: > ⚠️ Deprecated paging attribute, please use `paginationKey` instead. @@ -547,28 +693,30 @@ components: description: >- Fields `lastTimestamp` and `paginationKey` added when `limit` or `before` parameter provided and there is more data to show - ErrorEvent403Response: + ErrorCommon403Response: type: object additionalProperties: false properties: error: type: object additionalProperties: false - title: ErrorEvent403ResponseError + title: Common403ErrorResponse properties: code: type: string description: | Error code: * `TokenRequired` - `Auth-API-Key` header is missing or empty - * `TokenNotFound` - subscription not found for specified secret key - * `SubscriptionNotActive` - subscription is not active - * `WrongRegion` - server and subscription region differ + * `TokenNotFound` - No Fingerprint application found for specified secret key + * `SubscriptionNotActive` - Fingerprint application is not active + * `WrongRegion` - server and application region differ + * `FeatureNotEnabled` - this feature (for example, Delete API) is not enabled for your application enum: - TokenRequired - TokenNotFound - SubscriptionNotActive - WrongRegion + - FeatureNotEnabled example: TokenRequired message: type: string @@ -576,6 +724,27 @@ components: required: - code - message + ErrorCommon429Response: + type: object + additionalProperties: false + properties: + error: + type: object + additionalProperties: false + properties: + code: + type: string + description: | + Error code: * `TooManyRequests` - The request is throttled. + enum: + - TooManyRequests + example: TooManyRequests + message: + type: string + example: request throttled + required: + - code + - message ErrorEvent404Response: type: object additionalProperties: false @@ -589,7 +758,7 @@ components: type: string description: | Error code: - * `RequestNotFound` - request not found for specified id + * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. enum: - RequestNotFound example: RequestNotFound @@ -609,7 +778,7 @@ components: example: Forbidden (HTTP 403) required: - error - ManyRequestsResponse: + TooManyRequestsResponse: type: object additionalProperties: false properties: @@ -619,6 +788,51 @@ components: example: request throttled required: - error + ErrorVisitor404Response: + type: object + additionalProperties: false + properties: + error: + type: object + additionalProperties: false + title: ErrorVisitor404ResponseError + properties: + code: + type: string + description: > + Error code: * `VisitorNotFound` - The specified visitor ID was + not found. It never existed or it may have already been deleted. + enum: + - VisitorNotFound + example: VisitorNotFound + message: + type: string + example: visitor not found + required: + - code + - message + ErrorVisitor400Response: + type: object + additionalProperties: false + properties: + error: + type: object + additionalProperties: false + properties: + code: + type: string + description: > + Error code: * `RequestCannotBeParsed` - The visitor ID parameter + is missing or in the wrong format. + enum: + - RequestCannotBeParsed + example: RequestCannotBeParsed + message: + type: string + example: invalid visitor id + required: + - code + - message WebhookVisit: type: object properties: @@ -674,6 +888,12 @@ components: $ref: '#/components/schemas/LocationSpoofingResult' suspectScore: $ref: '#/components/schemas/SuspectScoreResult' + remoteControl: + $ref: '#/components/schemas/RemoteControlResult' + velocity: + $ref: '#/components/schemas/VelocityResult' + developerTools: + $ref: '#/components/schemas/DeveloperToolsResult' requestId: description: Unique identifier of the user's identification request. type: string @@ -778,7 +998,6 @@ components: - time - timestamp - url - - tag - visitorFound Visit: type: object @@ -889,7 +1108,6 @@ components: - time - timestamp - url - - tag - visitorFound title: Visit BrowserDetails: @@ -942,6 +1160,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 @@ -1203,9 +1427,9 @@ components: - time - timestamp - url - - tag - visitorFound - visitorId + - tag error: $ref: '#/components/schemas/IdentificationError' botd: @@ -1234,7 +1458,7 @@ components: data: $ref: '#/components/schemas/IncognitoResult' error: - $ref: '#/components/schemas/ProductError' + $ref: '#/components/schemas/IdentificationError' rootApps: title: SignalResponseRootApps type: object @@ -1351,7 +1575,7 @@ components: data: $ref: '#/components/schemas/TamperingResult' error: - $ref: '#/components/schemas/ProductError' + $ref: '#/components/schemas/IdentificationError' highActivity: title: SignalResponseHighActivity type: object @@ -1386,6 +1610,33 @@ components: properties: data: $ref: '#/components/schemas/RawDeviceAttributesResult' + error: + $ref: '#/components/schemas/IdentificationError' + remoteControl: + title: SignalResponseRemoteControl + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/RemoteControlResult' + error: + $ref: '#/components/schemas/ProductError' + velocity: + title: SignalResponseVelocity + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/VelocityResult' + error: + $ref: '#/components/schemas/ProductError' + developerTools: + title: SignalResponseDeveloperTools + type: object + additionalProperties: false + properties: + data: + $ref: '#/components/schemas/DeveloperToolsResult' error: $ref: '#/components/schemas/ProductError' EventResponse: @@ -1582,8 +1833,8 @@ components: timezoneMismatch: type: boolean description: >- - User's browser timezone doesn't match the timezone from which - the request was originally made. + The browser timezone doesn't match the timezone inferred from + the request IP address. example: false publicVPN: type: boolean @@ -1597,10 +1848,17 @@ components: This method applies to mobile devices only. Indicates the result of additional methods used to detect a VPN in mobile devices. example: false + osMismatch: + type: boolean + description: >- + The browser runs on a different operating system than the + operating system inferred from the request network signature. + example: false required: - timezoneMismatch - publicVPN - auxiliaryMobile + - osMismatch required: - result - originTimezone @@ -1672,6 +1930,36 @@ components: example: 0 required: - result + VelocityResult: + type: object + description: > + Sums key data points for a specific `visitorId` at three distinct time + intervals: 5 minutes, 1 hour, and 24 hours as follows: + + - Number of identification events attributed to the visitor ID - Number + of distinct IP addresses associated to the visitor ID. - Number of + distinct countries associated with the visitor ID. - Number of distinct + `linkedId`s associated with the visitor ID. + + The `24h` interval of `distinctIp`, `distinctLinkedId`, and + `distinctCountry` will be omitted if the number of `events` for the + visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher + than 20.000. + additionalProperties: false + properties: + distinctIp: + $ref: '#/components/schemas/VelocityIntervals' + distinctLinkedId: + $ref: '#/components/schemas/VelocityIntervals' + distinctCountry: + $ref: '#/components/schemas/VelocityIntervals' + events: + $ref: '#/components/schemas/VelocityIntervals' + required: + - distinctIp + - distinctLinkedId + - distinctCountry + - events RawDeviceAttributesResult: type: object description: > @@ -1709,19 +1997,27 @@ components: additionalProperties: false properties: time: - title: Time description: > - Time in UTC when the most recent factory reset of the Android or iOS - device was done. If there is no sign of factory reset or the client - is not a mobile device, the field will contain the epoch time (1 - January 1970) in UTC. + Indicates the time (in UTC) of the most recent factory reset that + happened on the **mobile device**. + + When a factory reset cannot be detected on the mobile device or when + the request is initiated from a browser, this field will correspond + to the *epoch* time (i.e 1 Jan 1970 UTC). + + See [Factory Reset + Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) + to learn more about this Smart Signal. type: string format: date-time example: '2022-06-09T22:58:36Z' timestamp: - description: >- - Same value as it's in the `time` field but represented in timestamp - format. + description: > + This field is just another representation of the value in the `time` + field. + + The time of the most recent factory reset that happened on the + **mobile device** is expressed as Unix epoch time. type: integer format: int64 example: 1654815517198 @@ -1877,3 +2173,126 @@ components: required: - code - message + RemoteControlResult: + type: object + additionalProperties: false + properties: + result: + type: boolean + description: > + `true` if the request came from a machine being remotely controlled + (e.g. TeamViewer), `false` otherwise. + example: false + required: + - result + DeveloperToolsResult: + type: object + additionalProperties: false + properties: + result: + type: boolean + description: > + `true` if the browser is Chrome with DevTools open or Firefox with + Developer Tools open, `false` otherwise. + example: false + required: + - result + EventUpdateRequest: + type: object + properties: + linkedId: + type: string + description: LinkedID value to assign to the existing event + tag: + type: object + description: >- + Full `tag` value to be set to the existing event. Replaces any + existing `tag` payload completely. + suspect: + type: boolean + description: Suspect flag indicating observed suspicious or fraudulent event + ErrorUpdateEvent400Response: + type: object + additionalProperties: false + properties: + error: + type: object + additionalProperties: false + title: ErrorUpdateEvent400ResponseError + properties: + code: + type: string + description: > + Error code: * `RequestCannotBeParsed` - the JSON content of the + request contains some errors that prevented us from parsing it + (wrong type/surpassed limits) * `Failed` - the event is more + than 10 days old and cannot be updated + enum: + - RequestCannotBeParsed + - Failed + example: RequestCannotBeParsed + message: + type: string + description: Details about the underlying issue with the input payload + example: suspect flag must be a boolean + required: + - code + - message + ErrorUpdateEvent409Response: + type: object + additionalProperties: false + properties: + error: + type: object + additionalProperties: false + title: ErrorUpdateEvent409ResponseError + properties: + code: + type: string + description: > + Error code: * `StateNotReady` - The event specified with request + id is not ready for updates yet. Try again. + + This error happens in rare cases when update API is called + immediately after receiving the request id on the client. In + case you need to send information right away, we recommend using + the JS agent API instead. + enum: + - StateNotReady + example: StateNotReady + message: + type: string + example: resource is not mutable yet, try again + required: + - code + - message + VelocityIntervals: + type: object + additionalProperties: false + properties: + intervals: + $ref: '#/components/schemas/VelocityIntervalResult' + VelocityIntervalResult: + type: object + description: > + Is absent if the velocity data could not be generated for the visitor + ID. + additionalProperties: false + properties: + 5m: + type: integer + example: 1 + 1h: + type: integer + example: 1 + 24h: + type: integer + description: > + The `24h` interval of `distinctIp`, `distinctLinkedId`, and + `distinctCountry` will be omitted if the number of `events`` for the + visitor ID in the last 24 hours (`events.intervals.['24h']`) is + higher than 20.000. + example: 1 + required: + - 5m + - 1h diff --git a/scripts/sync.sh b/scripts/sync.sh old mode 100644 new mode 100755 index 781ed46e..ae3378c4 --- a/scripts/sync.sh +++ b/scripts/sync.sh @@ -3,18 +3,45 @@ curl -o ./res/fingerprint-server-api.yaml https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/schemas/fingerprint-server-api-compact.yaml examplesList=( + 'get_visits_200_limit_1.json' 'get_visits_200_limit_500.json' + 'get_visits_403_error.json' + 'get_visits_429_too_many_requests_error.json' + 'webhook.json' 'get_event_200.json' 'get_event_200_all_errors.json' 'get_event_200_extra_fields.json' + 'get_event_403_error.json' + 'get_event_404_error.json' + 'get_event_200_botd_failed_error.json' + 'get_event_200_botd_too_many_requests_error.json' + 'get_event_200_identification_failed_error.json' + 'get_event_200_identification_too_many_requests_error.json' + 'update_event_400_error.json' + 'update_event_403_error.json' + 'update_event_404_error.json' + 'update_event_409_error.json' +) + +sharedExamplesList=( + '400_error_empty_visitor_id.json' + '400_error_incorrect_visitor_id.json' + '403_error_feature_not_enabled.json' + '403_error_token_not_found.json' + '403_error_token_required.json' + '403_error_wrong_region.json' + '404_error_visitor_not_found.json' + '429_error_too_many_requests.json' ) for example in ${examplesList[*]}; do curl -o ./test/mocks/"$example" https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/examples/"$example" done -# PHP function names are case insensitive, so we can just ignore wrong DataCenter value from INTER-481 bug. -# this command looks between IpInfoResult and IpBlockListResult strings and deletes the line with "dataCenter:" and next one if found +for example in ${sharedExamplesList[*]}; do + curl -o ./test/mocks/"$example" https://fingerprintjs.github.io/fingerprint-pro-server-api-openapi/examples/shared/"$example" +done + sed -i '' '/IpInfoResult:/,/IpBlockListResult:/ { /dataCenter:/ { N; d; }; }' ./res/fingerprint-server-api.yaml ./scripts/generate.sh diff --git a/src/Api/FingerprintApi.php b/src/Api/FingerprintApi.php index 60ae6b72..efb46588 100644 --- a/src/Api/FingerprintApi.php +++ b/src/Api/FingerprintApi.php @@ -30,6 +30,7 @@ use Fingerprint\ServerAPI\ApiException; use Fingerprint\ServerAPI\Configuration; +use Fingerprint\ServerAPI\Model\EventUpdateRequest; use Fingerprint\ServerAPI\ObjectSerializer; use Fingerprint\ServerAPI\SerializationException; use GuzzleHttp\Client; @@ -70,18 +71,186 @@ public function getConfig(): Configuration return $this->config; } + /** + * Operation deleteVisitorData. + * + * Delete data by visitor ID + * + * @param string $visitor_id The [visitor ID](https://dev.fingerprint.com/docs/js-agent#visitorid) you want to delete. (required) + * + * @return array{ null, \Psr\Http\Message\ResponseInterface } + * + * @throws \InvalidArgumentException + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException + */ + public function deleteVisitorData(string $visitor_id): array + { + $returnType = ''; + $request = $this->deleteVisitorDataRequest($visitor_id); + + try { + $options = $this->createHttpClientOption(); + + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $apiException = new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode() + ); + $apiException->setResponseObject($e->getResponse()); + + throw $apiException; + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + $apiException = new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode + ); + $apiException->setResponseObject($response); + + throw $apiException; + } + + return [null, $response]; + } catch (ApiException $e) { + /** @var ResponseInterface $response */ + $response = $e->getResponseObject(); + + switch ($e->getCode()) { + case 400: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorVisitor400Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 403: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorCommon403Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 404: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorVisitor404Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 429: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorCommon429Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + } + + throw $e; + } + } + + /** + * Operation deleteVisitorDataAsync. + * + * Delete data by visitor ID + * + * @param string $visitor_id The [visitor ID](https://dev.fingerprint.com/docs/js-agent#visitorid) you want to delete. (required) + * + * @throws \InvalidArgumentException + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException + */ + public function deleteVisitorDataAsync(string $visitor_id): PromiseInterface + { + $returnType = ''; + $request = $this->deleteVisitorDataRequest($visitor_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($request) { + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + $apiException = new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode + ); + $apiException->setResponseObject($response); + + throw $apiException; + } + + return [null, $response]; + }, + function ($e) { + /** @var ResponseInterface $response */ + $response = $e->getResponseObject(); + + switch ($e->getCode()) { + case 400: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorVisitor400Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 403: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorCommon403Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 404: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorVisitor404Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 429: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorCommon429Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + } + + throw $e; + } + ); + } + /** * Operation getEvent. * - * Get event by requestId + * Get event by request ID * - * @param string $request_id The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. (required) + * @param string $request_id The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request. (required) * * @return array{ null|\Fingerprint\ServerAPI\Model\EventResponse, \Psr\Http\Message\ResponseInterface } * * @throws \InvalidArgumentException * @throws SerializationException * @throws GuzzleException + * @throws ApiException */ public function getEvent(string $request_id): array { @@ -135,7 +304,7 @@ public function getEvent(string $request_id): array break; case 403: - $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorEvent403Response'); + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorCommon403Response'); $e->setErrorDetails($errorDetail); $e->setResponseObject($response); @@ -163,12 +332,14 @@ public function getEvent(string $request_id): array /** * Operation getEventAsync. * - * Get event by requestId + * Get event by request ID * - * @param string $request_id The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each analysis request. (required) + * @param string $request_id The unique [identifier](https://dev.fingerprint.com/docs/js-agent#requestid) of each identification request. (required) * * @throws \InvalidArgumentException * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ public function getEventAsync(string $request_id): PromiseInterface { @@ -212,7 +383,7 @@ function ($e) { break; case 403: - $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorEvent403Response'); + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorCommon403Response'); $e->setErrorDetails($errorDetail); $e->setResponseObject($response); @@ -241,9 +412,9 @@ function ($e) { /** * Operation getVisits. * - * Get visits by visitorId + * Get visits by visitor ID * - * @param string $visitor_id Unique identifier of the visitor issued by Fingerprint Pro. (required) + * @param string $visitor_id Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. (required) * @param string $request_id Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. (optional) * @param string $linked_id Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. (optional) * @param int $limit Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. (optional) @@ -255,6 +426,7 @@ function ($e) { * @throws \InvalidArgumentException * @throws SerializationException * @throws GuzzleException + * @throws ApiException */ public function getVisits(string $visitor_id, ?string $request_id = null, ?string $linked_id = null, ?int $limit = null, ?string $pagination_key = null, ?int $before = null): array { @@ -315,7 +487,7 @@ public function getVisits(string $visitor_id, ?string $request_id = null, ?strin break; case 429: - $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ManyRequestsResponse'); + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\TooManyRequestsResponse'); $e->setErrorDetails($errorDetail); $e->setResponseObject($response); @@ -336,9 +508,9 @@ public function getVisits(string $visitor_id, ?string $request_id = null, ?strin /** * Operation getVisitsAsync. * - * Get visits by visitorId + * Get visits by visitor ID * - * @param string $visitor_id Unique identifier of the visitor issued by Fingerprint Pro. (required) + * @param string $visitor_id Unique [visitor identifier](https://dev.fingerprint.com/docs/js-agent#visitorid) issued by Fingerprint Pro. (required) * @param string $request_id Filter visits by `requestId`. Every identification request has a unique identifier associated with it called `requestId`. This identifier is returned to the client in the identification [result](https://dev.fingerprint.com/docs/js-agent#requestid). When you filter visits by `requestId`, only one visit will be returned. (optional) * @param string $linked_id Filter visits by your custom identifier. You can use [`linkedId`](https://dev.fingerprint.com/docs/js-agent#linkedid) to associate identification requests with your own identifier, for example: session ID, purchase ID, or transaction ID. You can then use this `linked_id` parameter to retrieve all events associated with your custom identifier. (optional) * @param int $limit Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. (optional) @@ -347,6 +519,8 @@ public function getVisits(string $visitor_id, ?string $request_id = null, ?strin * * @throws \InvalidArgumentException * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ public function getVisitsAsync(string $visitor_id, ?string $request_id = null, ?string $linked_id = null, ?int $limit = null, ?string $pagination_key = null, ?int $before = null): PromiseInterface { @@ -397,7 +571,7 @@ function ($e) { break; case 429: - $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ManyRequestsResponse'); + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\TooManyRequestsResponse'); $e->setErrorDetails($errorDetail); $e->setResponseObject($response); @@ -416,11 +590,249 @@ function ($e) { ); } + /** + * Operation updateEvent. + * + * Update an event with a given request ID + * + * @param EventUpdateRequest $body (required) + * @param string $request_id The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). (required) + * + * @return array{ null, \Psr\Http\Message\ResponseInterface } + * + * @throws \InvalidArgumentException + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException + */ + public function updateEvent(EventUpdateRequest $body, string $request_id): array + { + $returnType = ''; + $request = $this->updateEventRequest($body, $request_id); + + try { + $options = $this->createHttpClientOption(); + + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + $apiException = new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + $e->getCode() + ); + $apiException->setResponseObject($e->getResponse()); + + throw $apiException; + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + $apiException = new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode + ); + $apiException->setResponseObject($response); + + throw $apiException; + } + + return [null, $response]; + } catch (ApiException $e) { + /** @var ResponseInterface $response */ + $response = $e->getResponseObject(); + + switch ($e->getCode()) { + case 400: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorUpdateEvent400Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 403: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorCommon403Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 404: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorEvent404Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 409: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorUpdateEvent409Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + } + + throw $e; + } + } + + /** + * Operation updateEventAsync. + * + * Update an event with a given request ID + * + * @param EventUpdateRequest $body (required) + * @param string $request_id The unique event [identifier](https://dev.fingerprint.com/docs/js-agent#requestid). (required) + * + * @throws \InvalidArgumentException + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException + */ + public function updateEventAsync(EventUpdateRequest $body, string $request_id): PromiseInterface + { + $returnType = ''; + $request = $this->updateEventRequest($body, $request_id); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($request) { + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + $apiException = new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode + ); + $apiException->setResponseObject($response); + + throw $apiException; + } + + return [null, $response]; + }, + function ($e) { + /** @var ResponseInterface $response */ + $response = $e->getResponseObject(); + + switch ($e->getCode()) { + case 400: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorUpdateEvent400Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 403: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorCommon403Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 404: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorEvent404Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + + case 409: + $errorDetail = ObjectSerializer::deserialize($response, '\Fingerprint\ServerAPI\Model\ErrorUpdateEvent409Response'); + $e->setErrorDetails($errorDetail); + $e->setResponseObject($response); + + break; + } + + throw $e; + } + ); + } + + /** + * Create request for operation 'deleteVisitorData'. + * + * @throws \InvalidArgumentException + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException + */ + protected function deleteVisitorDataRequest(string $visitor_id): Request + { + // verify the required parameter 'visitor_id' is set + if (null === $visitor_id || (is_array($visitor_id) && 0 === count($visitor_id))) { + throw new \InvalidArgumentException( + 'Missing the required parameter $visitor_id when calling deleteVisitorData' + ); + } + + $resourcePath = '/visitors/{visitor_id}'; + $headers = []; + $queryParams = ['ii' => $this->integration_info]; + $headerParams = []; + $httpBody = ''; + + // path params + if (null !== $visitor_id) { + $resourcePath = str_replace( + '{visitor_id}', + ObjectSerializer::toPathValue($visitor_id), + $resourcePath + ); + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Auth-API-Key'); + if (null !== $apiKey) { + $headers['Auth-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_key'); + if (null !== $apiKey) { + $queryParams['api_key'] = $apiKey; + } + + $defaultHeaders = [ + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + ]; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = http_build_query($queryParams); + + return new Request( + 'DELETE', + $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Create request for operation 'getEvent'. * * @throws \InvalidArgumentException * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ protected function getEventRequest(string $request_id): Request { @@ -486,6 +898,8 @@ protected function getEventRequest(string $request_id): Request * * @throws \InvalidArgumentException * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ protected function getVisitsRequest(string $visitor_id, ?string $request_id = null, ?string $linked_id = null, ?int $limit = null, ?string $pagination_key = null, ?int $before = null): Request { @@ -567,6 +981,90 @@ protected function getVisitsRequest(string $visitor_id, ?string $request_id = nu ); } + /** + * Create request for operation 'updateEvent'. + * + * @throws \InvalidArgumentException + * @throws SerializationException + * @throws GuzzleException + * @throws ApiException + */ + protected function updateEventRequest(EventUpdateRequest $body, string $request_id): Request + { + // verify the required parameter 'body' is set + if (null === $body || (is_array($body) && 0 === count($body))) { + throw new \InvalidArgumentException( + 'Missing the required parameter $body when calling updateEvent' + ); + } + // verify the required parameter 'request_id' is set + if (null === $request_id || (is_array($request_id) && 0 === count($request_id))) { + throw new \InvalidArgumentException( + 'Missing the required parameter $request_id when calling updateEvent' + ); + } + + $resourcePath = '/events/{request_id}'; + $headers = []; + $queryParams = ['ii' => $this->integration_info]; + $headerParams = []; + $httpBody = ''; + + // path params + if (null !== $request_id) { + $resourcePath = str_replace( + '{request_id}', + ObjectSerializer::toPathValue($request_id), + $resourcePath + ); + } + + // body params + $_tempBody = null; + if (isset($body)) { + $_tempBody = $body; + } + // for model (json/xml) + if (isset($_tempBody)) { + // $_tempBody is the method argument, if present + $httpBody = json_encode($_tempBody); + } + + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('Auth-API-Key'); + if (null !== $apiKey) { + $headers['Auth-API-Key'] = $apiKey; + } + // this endpoint requires API key authentication + $apiKey = $this->config->getApiKeyWithPrefix('api_key'); + if (null !== $apiKey) { + $queryParams['api_key'] = $apiKey; + } + + $defaultHeaders = [ + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + ]; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $query = http_build_query($queryParams); + + return new Request( + 'PUT', + $this->config->getHost().$resourcePath.($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + /** * Create http client option. * diff --git a/src/Model/ErrorEvent403ResponseError.php b/src/Model/Common403ErrorResponse.php similarity index 91% rename from src/Model/ErrorEvent403ResponseError.php rename to src/Model/Common403ErrorResponse.php index 702c754c..f8e5fd06 100644 --- a/src/Model/ErrorEvent403ResponseError.php +++ b/src/Model/Common403ErrorResponse.php @@ -1,6 +1,6 @@ 'float']; + 'score' => 'float', + 'revision' => 'string']; /** * Array of property to format mappings. Used for (de)serialization. @@ -59,7 +60,8 @@ class Confidence implements ModelInterface, \ArrayAccess * @var string[] */ protected static array $swaggerFormats = [ - 'score' => 'float']; + 'score' => 'float', + 'revision' => null]; /** * Array of attributes where the key is the local name, @@ -68,7 +70,8 @@ class Confidence implements ModelInterface, \ArrayAccess * @var string[] */ protected static array $attributeMap = [ - 'score' => 'score']; + 'score' => 'score', + 'revision' => 'revision']; /** * Array of attributes to setter functions (for deserialization of responses). @@ -76,7 +79,8 @@ class Confidence implements ModelInterface, \ArrayAccess * @var string[] */ protected static array $setters = [ - 'score' => 'setScore']; + 'score' => 'setScore', + 'revision' => 'setRevision']; /** * Array of attributes to getter functions (for serialization of requests). @@ -84,7 +88,8 @@ class Confidence implements ModelInterface, \ArrayAccess * @var string[] */ protected static array $getters = [ - 'score' => 'getScore']; + 'score' => 'getScore', + 'revision' => 'getRevision']; /** * Associative array for storing property values. @@ -102,6 +107,7 @@ class Confidence implements ModelInterface, \ArrayAccess public function __construct(?array $data = null) { $this->container['score'] = isset($data['score']) ? $data['score'] : null; + $this->container['revision'] = isset($data['revision']) ? $data['revision'] : null; } /** @@ -217,6 +223,30 @@ public function setScore(float $score): self return $this; } + /** + * Gets revision. + * + * @return ?string + */ + public function getRevision(): ?string + { + return $this->container['revision']; + } + + /** + * Sets revision. + * + * @param ?string $revision 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. + * + * @return $this + */ + public function setRevision(?string $revision): self + { + $this->container['revision'] = $revision; + + return $this; + } + /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/DeveloperToolsResult.php b/src/Model/DeveloperToolsResult.php new file mode 100644 index 00000000..2047bf72 --- /dev/null +++ b/src/Model/DeveloperToolsResult.php @@ -0,0 +1,264 @@ + 'bool']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'result' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'result' => 'result']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'result' => 'setResult']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'result' => 'getResult']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['result'] = isset($data['result']) ? $data['result'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['result']) { + $invalidProperties[] = "'result' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets result. + */ + public function getResult(): bool + { + return $this->container['result']; + } + + /** + * Sets result. + * + * @param bool $result `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise + * + * @return $this + */ + public function setResult(bool $result): self + { + $this->container['result'] = $result; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorEvent403Response.php b/src/Model/ErrorCommon403Response.php similarity index 90% rename from src/Model/ErrorEvent403Response.php rename to src/Model/ErrorCommon403Response.php index b8093804..1afa5e6e 100644 --- a/src/Model/ErrorEvent403Response.php +++ b/src/Model/ErrorCommon403Response.php @@ -1,6 +1,6 @@ '\Fingerprint\ServerAPI\Model\ErrorEvent403ResponseError']; + 'error' => '\Fingerprint\ServerAPI\Model\Common403ErrorResponse']; /** * Array of property to format mappings. Used for (de)serialization. @@ -192,9 +192,9 @@ public function valid(): bool /** * Gets error. * - * @return ?\Fingerprint\ServerAPI\Model\ErrorEvent403ResponseError + * @return ?\Fingerprint\ServerAPI\Model\Common403ErrorResponse */ - public function getError(): ?ErrorEvent403ResponseError + public function getError(): ?Common403ErrorResponse { return $this->container['error']; } @@ -202,11 +202,11 @@ public function getError(): ?ErrorEvent403ResponseError /** * Sets error. * - * @param ?\Fingerprint\ServerAPI\Model\ErrorEvent403ResponseError $error error + * @param ?\Fingerprint\ServerAPI\Model\Common403ErrorResponse $error error * * @return $this */ - public function setError(?ErrorEvent403ResponseError $error): self + public function setError(?Common403ErrorResponse $error): self { $this->container['error'] = $error; diff --git a/src/Model/ErrorCommon429Response.php b/src/Model/ErrorCommon429Response.php new file mode 100644 index 00000000..d2dc070d --- /dev/null +++ b/src/Model/ErrorCommon429Response.php @@ -0,0 +1,260 @@ + '\Fingerprint\ServerAPI\Model\ErrorCommon429ResponseError']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'error' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'error' => 'error']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'error' => 'setError']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'error' => 'getError']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets error. + * + * @return ?\Fingerprint\ServerAPI\Model\ErrorCommon429ResponseError + */ + public function getError(): ?ErrorCommon429ResponseError + { + return $this->container['error']; + } + + /** + * Sets error. + * + * @param ?\Fingerprint\ServerAPI\Model\ErrorCommon429ResponseError $error error + * + * @return $this + */ + public function setError(?ErrorCommon429ResponseError $error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorCommon429ResponseError.php b/src/Model/ErrorCommon429ResponseError.php new file mode 100644 index 00000000..f214c931 --- /dev/null +++ b/src/Model/ErrorCommon429ResponseError.php @@ -0,0 +1,325 @@ + 'string', + 'message' => 'string']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'code' => null, + 'message' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'message' => 'message']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Gets allowable values of the enum. + * + * @return string[] + */ + public function getCodeAllowableValues(): array + { + return [ + self::CODE_TOO_MANY_REQUESTS, ]; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['code']) { + $invalidProperties[] = "'code' can't be null"; + } + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if (null === $this->container['message']) { + $invalidProperties[] = "'message' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets code. + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code. + * + * @param string $code error code: * `TooManyRequests` - The request is throttled + * + * @return $this + */ + public function setCode(string $code): self + { + $allowedValues = $this->getCodeAllowableValues(); + if (!in_array($code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message. + */ + public function getMessage(): string + { + return $this->container['message']; + } + + /** + * Sets message. + * + * @param string $message message + * + * @return $this + */ + public function setMessage(string $message): self + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorEvent404ResponseError.php b/src/Model/ErrorEvent404ResponseError.php index 607b1924..0337f0bd 100644 --- a/src/Model/ErrorEvent404ResponseError.php +++ b/src/Model/ErrorEvent404ResponseError.php @@ -236,7 +236,7 @@ public function getCode(): string /** * Sets code. * - * @param string $code Error code: * `RequestNotFound` - request not found for specified id + * @param string $code Error code: * `RequestNotFound` - The specified request ID was not found. It never existed, expired, or it has been deleted. * * @return $this */ diff --git a/src/Model/ErrorUpdateEvent400Response.php b/src/Model/ErrorUpdateEvent400Response.php new file mode 100644 index 00000000..06737e39 --- /dev/null +++ b/src/Model/ErrorUpdateEvent400Response.php @@ -0,0 +1,260 @@ + '\Fingerprint\ServerAPI\Model\ErrorUpdateEvent400ResponseError']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'error' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'error' => 'error']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'error' => 'setError']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'error' => 'getError']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets error. + * + * @return ?\Fingerprint\ServerAPI\Model\ErrorUpdateEvent400ResponseError + */ + public function getError(): ?ErrorUpdateEvent400ResponseError + { + return $this->container['error']; + } + + /** + * Sets error. + * + * @param ?\Fingerprint\ServerAPI\Model\ErrorUpdateEvent400ResponseError $error error + * + * @return $this + */ + public function setError(?ErrorUpdateEvent400ResponseError $error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorUpdateEvent400ResponseError.php b/src/Model/ErrorUpdateEvent400ResponseError.php new file mode 100644 index 00000000..ec5eedb8 --- /dev/null +++ b/src/Model/ErrorUpdateEvent400ResponseError.php @@ -0,0 +1,327 @@ + 'string', + 'message' => 'string']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'code' => null, + 'message' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'message' => 'message']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Gets allowable values of the enum. + * + * @return string[] + */ + public function getCodeAllowableValues(): array + { + return [ + self::CODE_REQUEST_CANNOT_BE_PARSED, + self::CODE_FAILED, ]; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['code']) { + $invalidProperties[] = "'code' can't be null"; + } + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if (null === $this->container['message']) { + $invalidProperties[] = "'message' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets code. + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code. + * + * @param string $code Error code: * `RequestCannotBeParsed` - the JSON content of the request contains some errors that prevented us from parsing it (wrong type/surpassed limits) * `Failed` - the event is more than 10 days old and cannot be updated + * + * @return $this + */ + public function setCode(string $code): self + { + $allowedValues = $this->getCodeAllowableValues(); + if (!in_array($code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message. + */ + public function getMessage(): string + { + return $this->container['message']; + } + + /** + * Sets message. + * + * @param string $message Details about the underlying issue with the input payload + * + * @return $this + */ + public function setMessage(string $message): self + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorUpdateEvent409Response.php b/src/Model/ErrorUpdateEvent409Response.php new file mode 100644 index 00000000..5e1a0590 --- /dev/null +++ b/src/Model/ErrorUpdateEvent409Response.php @@ -0,0 +1,260 @@ + '\Fingerprint\ServerAPI\Model\ErrorUpdateEvent409ResponseError']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'error' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'error' => 'error']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'error' => 'setError']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'error' => 'getError']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets error. + * + * @return ?\Fingerprint\ServerAPI\Model\ErrorUpdateEvent409ResponseError + */ + public function getError(): ?ErrorUpdateEvent409ResponseError + { + return $this->container['error']; + } + + /** + * Sets error. + * + * @param ?\Fingerprint\ServerAPI\Model\ErrorUpdateEvent409ResponseError $error error + * + * @return $this + */ + public function setError(?ErrorUpdateEvent409ResponseError $error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorUpdateEvent409ResponseError.php b/src/Model/ErrorUpdateEvent409ResponseError.php new file mode 100644 index 00000000..7104bb91 --- /dev/null +++ b/src/Model/ErrorUpdateEvent409ResponseError.php @@ -0,0 +1,325 @@ + 'string', + 'message' => 'string']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'code' => null, + 'message' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'message' => 'message']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Gets allowable values of the enum. + * + * @return string[] + */ + public function getCodeAllowableValues(): array + { + return [ + self::CODE_STATE_NOT_READY, ]; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['code']) { + $invalidProperties[] = "'code' can't be null"; + } + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if (null === $this->container['message']) { + $invalidProperties[] = "'message' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets code. + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code. + * + * @param string $code Error code: * `StateNotReady` - The event specified with request id is not ready for updates yet. Try again. This error happens in rare cases when update API is called immediately after receiving the request id on the client. In case you need to send information right away, we recommend using the JS agent API instead. + * + * @return $this + */ + public function setCode(string $code): self + { + $allowedValues = $this->getCodeAllowableValues(); + if (!in_array($code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message. + */ + public function getMessage(): string + { + return $this->container['message']; + } + + /** + * Sets message. + * + * @param string $message message + * + * @return $this + */ + public function setMessage(string $message): self + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorVisitor400Response.php b/src/Model/ErrorVisitor400Response.php new file mode 100644 index 00000000..8add5b42 --- /dev/null +++ b/src/Model/ErrorVisitor400Response.php @@ -0,0 +1,260 @@ + '\Fingerprint\ServerAPI\Model\ErrorVisitor400ResponseError']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'error' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'error' => 'error']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'error' => 'setError']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'error' => 'getError']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets error. + * + * @return ?\Fingerprint\ServerAPI\Model\ErrorVisitor400ResponseError + */ + public function getError(): ?ErrorVisitor400ResponseError + { + return $this->container['error']; + } + + /** + * Sets error. + * + * @param ?\Fingerprint\ServerAPI\Model\ErrorVisitor400ResponseError $error error + * + * @return $this + */ + public function setError(?ErrorVisitor400ResponseError $error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorVisitor400ResponseError.php b/src/Model/ErrorVisitor400ResponseError.php new file mode 100644 index 00000000..f3a7511d --- /dev/null +++ b/src/Model/ErrorVisitor400ResponseError.php @@ -0,0 +1,325 @@ + 'string', + 'message' => 'string']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'code' => null, + 'message' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'message' => 'message']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Gets allowable values of the enum. + * + * @return string[] + */ + public function getCodeAllowableValues(): array + { + return [ + self::CODE_REQUEST_CANNOT_BE_PARSED, ]; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['code']) { + $invalidProperties[] = "'code' can't be null"; + } + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if (null === $this->container['message']) { + $invalidProperties[] = "'message' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets code. + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code. + * + * @param string $code error code: * `RequestCannotBeParsed` - The visitor ID parameter is missing or in the wrong format + * + * @return $this + */ + public function setCode(string $code): self + { + $allowedValues = $this->getCodeAllowableValues(); + if (!in_array($code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message. + */ + public function getMessage(): string + { + return $this->container['message']; + } + + /** + * Sets message. + * + * @param string $message message + * + * @return $this + */ + public function setMessage(string $message): self + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorVisitor404Response.php b/src/Model/ErrorVisitor404Response.php new file mode 100644 index 00000000..d0eac080 --- /dev/null +++ b/src/Model/ErrorVisitor404Response.php @@ -0,0 +1,260 @@ + '\Fingerprint\ServerAPI\Model\ErrorVisitor404ResponseError']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'error' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'error' => 'error']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'error' => 'setError']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'error' => 'getError']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets error. + * + * @return ?\Fingerprint\ServerAPI\Model\ErrorVisitor404ResponseError + */ + public function getError(): ?ErrorVisitor404ResponseError + { + return $this->container['error']; + } + + /** + * Sets error. + * + * @param ?\Fingerprint\ServerAPI\Model\ErrorVisitor404ResponseError $error error + * + * @return $this + */ + public function setError(?ErrorVisitor404ResponseError $error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ErrorVisitor404ResponseError.php b/src/Model/ErrorVisitor404ResponseError.php new file mode 100644 index 00000000..6365d384 --- /dev/null +++ b/src/Model/ErrorVisitor404ResponseError.php @@ -0,0 +1,325 @@ + 'string', + 'message' => 'string']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'code' => null, + 'message' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'code' => 'code', + 'message' => 'message']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'code' => 'setCode', + 'message' => 'setMessage']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'code' => 'getCode', + 'message' => 'getMessage']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['code'] = isset($data['code']) ? $data['code'] : null; + $this->container['message'] = isset($data['message']) ? $data['message'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Gets allowable values of the enum. + * + * @return string[] + */ + public function getCodeAllowableValues(): array + { + return [ + self::CODE_VISITOR_NOT_FOUND, ]; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['code']) { + $invalidProperties[] = "'code' can't be null"; + } + $allowedValues = $this->getCodeAllowableValues(); + if (!is_null($this->container['code']) && !in_array($this->container['code'], $allowedValues, true)) { + $invalidProperties[] = sprintf( + "invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ); + } + + if (null === $this->container['message']) { + $invalidProperties[] = "'message' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets code. + */ + public function getCode(): string + { + return $this->container['code']; + } + + /** + * Sets code. + * + * @param string $code Error code: * `VisitorNotFound` - The specified visitor ID was not found. It never existed or it may have already been deleted. + * + * @return $this + */ + public function setCode(string $code): self + { + $allowedValues = $this->getCodeAllowableValues(); + if (!in_array($code, $allowedValues, true)) { + throw new \InvalidArgumentException( + sprintf( + "Invalid value for 'code', must be one of '%s'", + implode("', '", $allowedValues) + ) + ); + } + $this->container['code'] = $code; + + return $this; + } + + /** + * Gets message. + */ + public function getMessage(): string + { + return $this->container['message']; + } + + /** + * Sets message. + * + * @param string $message message + * + * @return $this + */ + public function setMessage(string $message): self + { + $this->container['message'] = $message; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/EventUpdateRequest.php b/src/Model/EventUpdateRequest.php new file mode 100644 index 00000000..ebcd6941 --- /dev/null +++ b/src/Model/EventUpdateRequest.php @@ -0,0 +1,320 @@ + 'string', + 'tag' => 'object', + 'suspect' => 'bool']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'linked_id' => null, + 'tag' => null, + 'suspect' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'linked_id' => 'linkedId', + 'tag' => 'tag', + 'suspect' => 'suspect']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'linked_id' => 'setLinkedId', + 'tag' => 'setTag', + 'suspect' => 'setSuspect']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'linked_id' => 'getLinkedId', + 'tag' => 'getTag', + 'suspect' => 'getSuspect']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['linked_id'] = isset($data['linked_id']) ? $data['linked_id'] : null; + $this->container['tag'] = isset($data['tag']) ? $data['tag'] : null; + $this->container['suspect'] = isset($data['suspect']) ? $data['suspect'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets linked_id. + * + * @return ?string + */ + public function getLinkedId(): ?string + { + return $this->container['linked_id']; + } + + /** + * Sets linked_id. + * + * @param ?string $linked_id LinkedID value to assign to the existing event + * + * @return $this + */ + public function setLinkedId(?string $linked_id): self + { + $this->container['linked_id'] = $linked_id; + + return $this; + } + + /** + * Gets tag. + * + * @return ?object + */ + public function getTag(): ?object + { + return $this->container['tag']; + } + + /** + * Sets tag. + * + * @param ?object $tag Full `tag` value to be set to the existing event. Replaces any existing `tag` payload completely. + * + * @return $this + */ + public function setTag(?object $tag): self + { + $this->container['tag'] = $tag; + + return $this; + } + + /** + * Gets suspect. + * + * @return ?bool + */ + public function getSuspect(): ?bool + { + return $this->container['suspect']; + } + + /** + * Sets suspect. + * + * @param ?bool $suspect Suspect flag indicating observed suspicious or fraudulent event + * + * @return $this + */ + public function setSuspect(?bool $suspect): self + { + $this->container['suspect'] = $suspect; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/FactoryResetResult.php b/src/Model/FactoryResetResult.php index fbf1834d..8d6872fa 100644 --- a/src/Model/FactoryResetResult.php +++ b/src/Model/FactoryResetResult.php @@ -215,7 +215,7 @@ public function getTime(): \DateTime /** * Sets time. * - * @param \DateTime $time Time in UTC when the most recent factory reset of the Android or iOS device was done. If there is no sign of factory reset or the client is not a mobile device, the field will contain the epoch time (1 January 1970) in UTC. + * @param \DateTime $time Indicates the time (in UTC) of the most recent factory reset that happened on the **mobile device**. When a factory reset cannot be detected on the mobile device or when the request is initiated from a browser, this field will correspond to the *epoch* time (i.e 1 Jan 1970 UTC). See [Factory Reset Detection](https://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. * * @return $this */ @@ -237,7 +237,7 @@ public function getTimestamp(): int /** * Sets timestamp. * - * @param int $timestamp same value as it's in the `time` field but represented in timestamp format + * @param int $timestamp This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. * * @return $this */ diff --git a/src/Model/ProductsResponse.php b/src/Model/ProductsResponse.php index dffaf631..16649fd8 100644 --- a/src/Model/ProductsResponse.php +++ b/src/Model/ProductsResponse.php @@ -73,7 +73,10 @@ class ProductsResponse implements ModelInterface, \ArrayAccess 'high_activity' => '\Fingerprint\ServerAPI\Model\SignalResponseHighActivity', 'location_spoofing' => '\Fingerprint\ServerAPI\Model\SignalResponseLocationSpoofing', 'suspect_score' => '\Fingerprint\ServerAPI\Model\SignalResponseSuspectScore', - 'raw_device_attributes' => '\Fingerprint\ServerAPI\Model\SignalResponseRawDeviceAttributes']; + 'raw_device_attributes' => '\Fingerprint\ServerAPI\Model\SignalResponseRawDeviceAttributes', + 'remote_control' => '\Fingerprint\ServerAPI\Model\SignalResponseRemoteControl', + 'velocity' => '\Fingerprint\ServerAPI\Model\SignalResponseVelocity', + 'developer_tools' => '\Fingerprint\ServerAPI\Model\SignalResponseDeveloperTools']; /** * Array of property to format mappings. Used for (de)serialization. @@ -101,7 +104,10 @@ class ProductsResponse implements ModelInterface, \ArrayAccess 'high_activity' => null, 'location_spoofing' => null, 'suspect_score' => null, - 'raw_device_attributes' => null]; + 'raw_device_attributes' => null, + 'remote_control' => null, + 'velocity' => null, + 'developer_tools' => null]; /** * Array of attributes where the key is the local name, @@ -130,7 +136,10 @@ class ProductsResponse implements ModelInterface, \ArrayAccess 'high_activity' => 'highActivity', 'location_spoofing' => 'locationSpoofing', 'suspect_score' => 'suspectScore', - 'raw_device_attributes' => 'rawDeviceAttributes']; + 'raw_device_attributes' => 'rawDeviceAttributes', + 'remote_control' => 'remoteControl', + 'velocity' => 'velocity', + 'developer_tools' => 'developerTools']; /** * Array of attributes to setter functions (for deserialization of responses). @@ -158,7 +167,10 @@ class ProductsResponse implements ModelInterface, \ArrayAccess 'high_activity' => 'setHighActivity', 'location_spoofing' => 'setLocationSpoofing', 'suspect_score' => 'setSuspectScore', - 'raw_device_attributes' => 'setRawDeviceAttributes']; + 'raw_device_attributes' => 'setRawDeviceAttributes', + 'remote_control' => 'setRemoteControl', + 'velocity' => 'setVelocity', + 'developer_tools' => 'setDeveloperTools']; /** * Array of attributes to getter functions (for serialization of requests). @@ -186,7 +198,10 @@ class ProductsResponse implements ModelInterface, \ArrayAccess 'high_activity' => 'getHighActivity', 'location_spoofing' => 'getLocationSpoofing', 'suspect_score' => 'getSuspectScore', - 'raw_device_attributes' => 'getRawDeviceAttributes']; + 'raw_device_attributes' => 'getRawDeviceAttributes', + 'remote_control' => 'getRemoteControl', + 'velocity' => 'getVelocity', + 'developer_tools' => 'getDeveloperTools']; /** * Associative array for storing property values. @@ -224,6 +239,9 @@ public function __construct(?array $data = null) $this->container['location_spoofing'] = isset($data['location_spoofing']) ? $data['location_spoofing'] : null; $this->container['suspect_score'] = isset($data['suspect_score']) ? $data['suspect_score'] : null; $this->container['raw_device_attributes'] = isset($data['raw_device_attributes']) ? $data['raw_device_attributes'] : null; + $this->container['remote_control'] = isset($data['remote_control']) ? $data['remote_control'] : null; + $this->container['velocity'] = isset($data['velocity']) ? $data['velocity'] : null; + $this->container['developer_tools'] = isset($data['developer_tools']) ? $data['developer_tools'] : null; } /** @@ -815,6 +833,78 @@ public function setRawDeviceAttributes(?SignalResponseRawDeviceAttributes $raw_d return $this; } + /** + * Gets remote_control. + * + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseRemoteControl + */ + public function getRemoteControl(): ?SignalResponseRemoteControl + { + return $this->container['remote_control']; + } + + /** + * Sets remote_control. + * + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseRemoteControl $remote_control remote_control + * + * @return $this + */ + public function setRemoteControl(?SignalResponseRemoteControl $remote_control): self + { + $this->container['remote_control'] = $remote_control; + + return $this; + } + + /** + * Gets velocity. + * + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseVelocity + */ + public function getVelocity(): ?SignalResponseVelocity + { + return $this->container['velocity']; + } + + /** + * Sets velocity. + * + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseVelocity $velocity velocity + * + * @return $this + */ + public function setVelocity(?SignalResponseVelocity $velocity): self + { + $this->container['velocity'] = $velocity; + + return $this; + } + + /** + * Gets developer_tools. + * + * @return ?\Fingerprint\ServerAPI\Model\SignalResponseDeveloperTools + */ + public function getDeveloperTools(): ?SignalResponseDeveloperTools + { + return $this->container['developer_tools']; + } + + /** + * Sets developer_tools. + * + * @param ?\Fingerprint\ServerAPI\Model\SignalResponseDeveloperTools $developer_tools developer_tools + * + * @return $this + */ + public function setDeveloperTools(?SignalResponseDeveloperTools $developer_tools): self + { + $this->container['developer_tools'] = $developer_tools; + + return $this; + } + /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/RemoteControlResult.php b/src/Model/RemoteControlResult.php new file mode 100644 index 00000000..125baf85 --- /dev/null +++ b/src/Model/RemoteControlResult.php @@ -0,0 +1,264 @@ + 'bool']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'result' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'result' => 'result']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'result' => 'setResult']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'result' => 'getResult']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['result'] = isset($data['result']) ? $data['result'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['result']) { + $invalidProperties[] = "'result' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets result. + */ + public function getResult(): bool + { + return $this->container['result']; + } + + /** + * Sets result. + * + * @param bool $result `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. + * + * @return $this + */ + public function setResult(bool $result): self + { + $this->container['result'] = $result; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/SignalResponseDeveloperTools.php b/src/Model/SignalResponseDeveloperTools.php new file mode 100644 index 00000000..d25d3207 --- /dev/null +++ b/src/Model/SignalResponseDeveloperTools.php @@ -0,0 +1,290 @@ + '\Fingerprint\ServerAPI\Model\DeveloperToolsResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'data' => 'data', + 'error' => 'error']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'data' => 'setData', + 'error' => 'setError']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'data' => 'getData', + 'error' => 'getError']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets data. + * + * @return ?\Fingerprint\ServerAPI\Model\DeveloperToolsResult + */ + public function getData(): ?DeveloperToolsResult + { + return $this->container['data']; + } + + /** + * Sets data. + * + * @param ?\Fingerprint\ServerAPI\Model\DeveloperToolsResult $data data + * + * @return $this + */ + public function setData(?DeveloperToolsResult $data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets error. + * + * @return ?\Fingerprint\ServerAPI\Model\ProductError + */ + public function getError(): ?ProductError + { + return $this->container['error']; + } + + /** + * Sets error. + * + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error + * + * @return $this + */ + public function setError(?ProductError $error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/SignalResponseIncognito.php b/src/Model/SignalResponseIncognito.php index 561c0eba..e8e87138 100644 --- a/src/Model/SignalResponseIncognito.php +++ b/src/Model/SignalResponseIncognito.php @@ -52,7 +52,7 @@ class SignalResponseIncognito implements ModelInterface, \ArrayAccess */ protected static array $swaggerTypes = [ 'data' => '\Fingerprint\ServerAPI\Model\IncognitoResult', - 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; + 'error' => '\Fingerprint\ServerAPI\Model\IdentificationError']; /** * Array of property to format mappings. Used for (de)serialization. @@ -222,9 +222,9 @@ public function setData(?IncognitoResult $data): self /** * Gets error. * - * @return ?\Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\IdentificationError */ - public function getError(): ?ProductError + public function getError(): ?IdentificationError { return $this->container['error']; } @@ -232,11 +232,11 @@ public function getError(): ?ProductError /** * Sets error. * - * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\IdentificationError $error error * * @return $this */ - public function setError(?ProductError $error): self + public function setError(?IdentificationError $error): self { $this->container['error'] = $error; diff --git a/src/Model/SignalResponseRawDeviceAttributes.php b/src/Model/SignalResponseRawDeviceAttributes.php index b079b123..68a20adc 100644 --- a/src/Model/SignalResponseRawDeviceAttributes.php +++ b/src/Model/SignalResponseRawDeviceAttributes.php @@ -52,7 +52,7 @@ class SignalResponseRawDeviceAttributes implements ModelInterface, \ArrayAccess */ protected static array $swaggerTypes = [ 'data' => '\Fingerprint\ServerAPI\Model\RawDeviceAttributesResult', - 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; + 'error' => '\Fingerprint\ServerAPI\Model\IdentificationError']; /** * Array of property to format mappings. Used for (de)serialization. @@ -222,9 +222,9 @@ public function setData(?array $data): self /** * Gets error. * - * @return ?\Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\IdentificationError */ - public function getError(): ?ProductError + public function getError(): ?IdentificationError { return $this->container['error']; } @@ -232,11 +232,11 @@ public function getError(): ?ProductError /** * Sets error. * - * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\IdentificationError $error error * * @return $this */ - public function setError(?ProductError $error): self + public function setError(?IdentificationError $error): self { $this->container['error'] = $error; diff --git a/src/Model/SignalResponseRemoteControl.php b/src/Model/SignalResponseRemoteControl.php new file mode 100644 index 00000000..afec1f39 --- /dev/null +++ b/src/Model/SignalResponseRemoteControl.php @@ -0,0 +1,290 @@ + '\Fingerprint\ServerAPI\Model\RemoteControlResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'data' => 'data', + 'error' => 'error']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'data' => 'setData', + 'error' => 'setError']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'data' => 'getData', + 'error' => 'getError']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets data. + * + * @return ?\Fingerprint\ServerAPI\Model\RemoteControlResult + */ + public function getData(): ?RemoteControlResult + { + return $this->container['data']; + } + + /** + * Sets data. + * + * @param ?\Fingerprint\ServerAPI\Model\RemoteControlResult $data data + * + * @return $this + */ + public function setData(?RemoteControlResult $data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets error. + * + * @return ?\Fingerprint\ServerAPI\Model\ProductError + */ + public function getError(): ?ProductError + { + return $this->container['error']; + } + + /** + * Sets error. + * + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error + * + * @return $this + */ + public function setError(?ProductError $error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/SignalResponseTampering.php b/src/Model/SignalResponseTampering.php index 4efe22d6..68c818ea 100644 --- a/src/Model/SignalResponseTampering.php +++ b/src/Model/SignalResponseTampering.php @@ -52,7 +52,7 @@ class SignalResponseTampering implements ModelInterface, \ArrayAccess */ protected static array $swaggerTypes = [ 'data' => '\Fingerprint\ServerAPI\Model\TamperingResult', - 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; + 'error' => '\Fingerprint\ServerAPI\Model\IdentificationError']; /** * Array of property to format mappings. Used for (de)serialization. @@ -222,9 +222,9 @@ public function setData(?TamperingResult $data): self /** * Gets error. * - * @return ?\Fingerprint\ServerAPI\Model\ProductError + * @return ?\Fingerprint\ServerAPI\Model\IdentificationError */ - public function getError(): ?ProductError + public function getError(): ?IdentificationError { return $this->container['error']; } @@ -232,11 +232,11 @@ public function getError(): ?ProductError /** * Sets error. * - * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error + * @param ?\Fingerprint\ServerAPI\Model\IdentificationError $error error * * @return $this */ - public function setError(?ProductError $error): self + public function setError(?IdentificationError $error): self { $this->container['error'] = $error; diff --git a/src/Model/SignalResponseVelocity.php b/src/Model/SignalResponseVelocity.php new file mode 100644 index 00000000..3ccfbdbe --- /dev/null +++ b/src/Model/SignalResponseVelocity.php @@ -0,0 +1,290 @@ + '\Fingerprint\ServerAPI\Model\VelocityResult', + 'error' => '\Fingerprint\ServerAPI\Model\ProductError']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'data' => null, + 'error' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'data' => 'data', + 'error' => 'error']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'data' => 'setData', + 'error' => 'setError']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'data' => 'getData', + 'error' => 'getError']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['data'] = isset($data['data']) ? $data['data'] : null; + $this->container['error'] = isset($data['error']) ? $data['error'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets data. + * + * @return ?\Fingerprint\ServerAPI\Model\VelocityResult + */ + public function getData(): ?VelocityResult + { + return $this->container['data']; + } + + /** + * Sets data. + * + * @param ?\Fingerprint\ServerAPI\Model\VelocityResult $data data + * + * @return $this + */ + public function setData(?VelocityResult $data): self + { + $this->container['data'] = $data; + + return $this; + } + + /** + * Gets error. + * + * @return ?\Fingerprint\ServerAPI\Model\ProductError + */ + public function getError(): ?ProductError + { + return $this->container['error']; + } + + /** + * Sets error. + * + * @param ?\Fingerprint\ServerAPI\Model\ProductError $error error + * + * @return $this + */ + public function setError(?ProductError $error): self + { + $this->container['error'] = $error; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/ManyRequestsResponse.php b/src/Model/TooManyRequestsResponse.php similarity index 96% rename from src/Model/ManyRequestsResponse.php rename to src/Model/TooManyRequestsResponse.php index f2c782c5..6034721b 100644 --- a/src/Model/ManyRequestsResponse.php +++ b/src/Model/TooManyRequestsResponse.php @@ -1,6 +1,6 @@ 'int', + '_1h' => 'int', + '_24h' => 'int']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + '_5m' => null, + '_1h' => null, + '_24h' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + '_5m' => '5m', + '_1h' => '1h', + '_24h' => '24h']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + '_5m' => 'set5m', + '_1h' => 'set1h', + '_24h' => 'set24h']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + '_5m' => 'get5m', + '_1h' => 'get1h', + '_24h' => 'get24h']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['_5m'] = isset($data['_5m']) ? $data['_5m'] : null; + $this->container['_1h'] = isset($data['_1h']) ? $data['_1h'] : null; + $this->container['_24h'] = isset($data['_24h']) ? $data['_24h'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['_5m']) { + $invalidProperties[] = "'_5m' can't be null"; + } + if (null === $this->container['_1h']) { + $invalidProperties[] = "'_1h' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets _5m. + */ + public function get5m(): int + { + return $this->container['_5m']; + } + + /** + * Sets _5m. + * + * @param int $_5m _5m + * + * @return $this + */ + public function set5m(int $_5m): self + { + $this->container['_5m'] = $_5m; + + return $this; + } + + /** + * Gets _1h. + */ + public function get1h(): int + { + return $this->container['_1h']; + } + + /** + * Sets _1h. + * + * @param int $_1h _1h + * + * @return $this + */ + public function set1h(int $_1h): self + { + $this->container['_1h'] = $_1h; + + return $this; + } + + /** + * Gets _24h. + * + * @return ?int + */ + public function get24h(): ?int + { + return $this->container['_24h']; + } + + /** + * Sets _24h. + * + * @param ?int $_24h The `24h` interval of `distinctIp`, `distinctLinkedId`, and `distinctCountry` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. + * + * @return $this + */ + public function set24h(?int $_24h): self + { + $this->container['_24h'] = $_24h; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/VelocityIntervals.php b/src/Model/VelocityIntervals.php new file mode 100644 index 00000000..f2a84395 --- /dev/null +++ b/src/Model/VelocityIntervals.php @@ -0,0 +1,260 @@ + '\Fingerprint\ServerAPI\Model\VelocityIntervalResult']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'intervals' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'intervals' => 'intervals']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'intervals' => 'setIntervals']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'intervals' => 'getIntervals']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['intervals'] = isset($data['intervals']) ? $data['intervals'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets intervals. + * + * @return ?\Fingerprint\ServerAPI\Model\VelocityIntervalResult + */ + public function getIntervals(): ?VelocityIntervalResult + { + return $this->container['intervals']; + } + + /** + * Sets intervals. + * + * @param ?\Fingerprint\ServerAPI\Model\VelocityIntervalResult $intervals intervals + * + * @return $this + */ + public function setIntervals(?VelocityIntervalResult $intervals): self + { + $this->container['intervals'] = $intervals; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/VelocityResult.php b/src/Model/VelocityResult.php new file mode 100644 index 00000000..5e2a665e --- /dev/null +++ b/src/Model/VelocityResult.php @@ -0,0 +1,359 @@ + '\Fingerprint\ServerAPI\Model\VelocityIntervals', + 'distinct_linked_id' => '\Fingerprint\ServerAPI\Model\VelocityIntervals', + 'distinct_country' => '\Fingerprint\ServerAPI\Model\VelocityIntervals', + 'events' => '\Fingerprint\ServerAPI\Model\VelocityIntervals']; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $swaggerFormats = [ + 'distinct_ip' => null, + 'distinct_linked_id' => null, + 'distinct_country' => null, + 'events' => null]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'distinct_ip' => 'distinctIp', + 'distinct_linked_id' => 'distinctLinkedId', + 'distinct_country' => 'distinctCountry', + 'events' => 'events']; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'distinct_ip' => 'setDistinctIp', + 'distinct_linked_id' => 'setDistinctLinkedId', + 'distinct_country' => 'setDistinctCountry', + 'events' => 'setEvents']; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'distinct_ip' => 'getDistinctIp', + 'distinct_linked_id' => 'getDistinctLinkedId', + 'distinct_country' => 'getDistinctCountry', + 'events' => 'getEvents']; + + /** + * Associative array for storing property values. + * + * @var mixed[] + */ + protected array $container = []; + + /** + * Constructor. + * + * @param mixed[] $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->container['distinct_ip'] = isset($data['distinct_ip']) ? $data['distinct_ip'] : null; + $this->container['distinct_linked_id'] = isset($data['distinct_linked_id']) ? $data['distinct_linked_id'] : null; + $this->container['distinct_country'] = isset($data['distinct_country']) ? $data['distinct_country'] : null; + $this->container['events'] = isset($data['events']) ? $data['events'] : null; + } + + /** + * Gets the string presentation of the object. + */ + public function __toString(): string + { + if (defined('JSON_PRETTY_PRINT')) { // use JSON pretty print + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + */ + public static function swaggerTypes(): array + { + return self::$swaggerTypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function swaggerFormats(): array + { + return self::$swaggerFormats; + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + */ + public static function attributeMap(): array + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses). + */ + public static function setters(): array + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests). + */ + public static function getters(): array + { + return self::$getters; + } + + /** + * The original name of the model. + */ + public function getModelName(): string + { + return self::$swaggerModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['distinct_ip']) { + $invalidProperties[] = "'distinct_ip' can't be null"; + } + if (null === $this->container['distinct_linked_id']) { + $invalidProperties[] = "'distinct_linked_id' can't be null"; + } + if (null === $this->container['distinct_country']) { + $invalidProperties[] = "'distinct_country' can't be null"; + } + if (null === $this->container['events']) { + $invalidProperties[] = "'events' can't be null"; + } + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets distinct_ip. + */ + public function getDistinctIp(): VelocityIntervals + { + return $this->container['distinct_ip']; + } + + /** + * Sets distinct_ip. + * + * @param VelocityIntervals $distinct_ip distinct_ip + * + * @return $this + */ + public function setDistinctIp(VelocityIntervals $distinct_ip): self + { + $this->container['distinct_ip'] = $distinct_ip; + + return $this; + } + + /** + * Gets distinct_linked_id. + */ + public function getDistinctLinkedId(): VelocityIntervals + { + return $this->container['distinct_linked_id']; + } + + /** + * Sets distinct_linked_id. + * + * @param VelocityIntervals $distinct_linked_id distinct_linked_id + * + * @return $this + */ + public function setDistinctLinkedId(VelocityIntervals $distinct_linked_id): self + { + $this->container['distinct_linked_id'] = $distinct_linked_id; + + return $this; + } + + /** + * Gets distinct_country. + */ + public function getDistinctCountry(): VelocityIntervals + { + return $this->container['distinct_country']; + } + + /** + * Sets distinct_country. + * + * @param VelocityIntervals $distinct_country distinct_country + * + * @return $this + */ + public function setDistinctCountry(VelocityIntervals $distinct_country): self + { + $this->container['distinct_country'] = $distinct_country; + + return $this; + } + + /** + * Gets events. + */ + public function getEvents(): VelocityIntervals + { + return $this->container['events']; + } + + /** + * Sets events. + * + * @param VelocityIntervals $events events + * + * @return $this + */ + public function setEvents(VelocityIntervals $events): self + { + $this->container['events'] = $events; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int $offset Offset + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int $offset Offset + */ + public function offsetGet($offset): mixed + { + return isset($this->container[$offset]) ? $this->container[$offset] : null; + } + + /** + * Sets value based on offset. + * + * @param int $offset Offset + * @param mixed $value Value to be set + */ + public function offsetSet($offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int $offset Offset + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } +} diff --git a/src/Model/Visit.php b/src/Model/Visit.php index dc2e5461..63ad75b2 100644 --- a/src/Model/Visit.php +++ b/src/Model/Visit.php @@ -276,9 +276,6 @@ public function listInvalidProperties(): array if (null === $this->container['url']) { $invalidProperties[] = "'url' can't be null"; } - if (null === $this->container['tag']) { - $invalidProperties[] = "'tag' can't be null"; - } if (null === $this->container['visitor_found']) { $invalidProperties[] = "'visitor_found' can't be null"; } @@ -484,9 +481,9 @@ public function setUrl(string $url): self /** * Gets tag. * - * @return map[string,object] + * @return ?map[string,object] */ - public function getTag(): array + public function getTag(): ?array { return $this->container['tag']; } @@ -494,11 +491,11 @@ public function getTag(): array /** * Sets tag. * - * @param map[string,object] $tag A customer-provided value or an object that was sent with identification request + * @param ?map[string,object] $tag A customer-provided value or an object that was sent with identification request * * @return $this */ - public function setTag(array $tag): self + public function setTag(?array $tag): self { $this->container['tag'] = $tag; diff --git a/src/Model/VpnResultMethods.php b/src/Model/VpnResultMethods.php index 3c4f1f36..36f39b53 100644 --- a/src/Model/VpnResultMethods.php +++ b/src/Model/VpnResultMethods.php @@ -53,7 +53,8 @@ class VpnResultMethods implements ModelInterface, \ArrayAccess protected static array $swaggerTypes = [ 'timezone_mismatch' => 'bool', 'public_vpn' => 'bool', - 'auxiliary_mobile' => 'bool']; + 'auxiliary_mobile' => 'bool', + 'os_mismatch' => 'bool']; /** * Array of property to format mappings. Used for (de)serialization. @@ -63,7 +64,8 @@ class VpnResultMethods implements ModelInterface, \ArrayAccess protected static array $swaggerFormats = [ 'timezone_mismatch' => null, 'public_vpn' => null, - 'auxiliary_mobile' => null]; + 'auxiliary_mobile' => null, + 'os_mismatch' => null]; /** * Array of attributes where the key is the local name, @@ -74,7 +76,8 @@ class VpnResultMethods implements ModelInterface, \ArrayAccess protected static array $attributeMap = [ 'timezone_mismatch' => 'timezoneMismatch', 'public_vpn' => 'publicVPN', - 'auxiliary_mobile' => 'auxiliaryMobile']; + 'auxiliary_mobile' => 'auxiliaryMobile', + 'os_mismatch' => 'osMismatch']; /** * Array of attributes to setter functions (for deserialization of responses). @@ -84,7 +87,8 @@ class VpnResultMethods implements ModelInterface, \ArrayAccess protected static array $setters = [ 'timezone_mismatch' => 'setTimezoneMismatch', 'public_vpn' => 'setPublicVpn', - 'auxiliary_mobile' => 'setAuxiliaryMobile']; + 'auxiliary_mobile' => 'setAuxiliaryMobile', + 'os_mismatch' => 'setOsMismatch']; /** * Array of attributes to getter functions (for serialization of requests). @@ -94,7 +98,8 @@ class VpnResultMethods implements ModelInterface, \ArrayAccess protected static array $getters = [ 'timezone_mismatch' => 'getTimezoneMismatch', 'public_vpn' => 'getPublicVpn', - 'auxiliary_mobile' => 'getAuxiliaryMobile']; + 'auxiliary_mobile' => 'getAuxiliaryMobile', + 'os_mismatch' => 'getOsMismatch']; /** * Associative array for storing property values. @@ -114,6 +119,7 @@ public function __construct(?array $data = null) $this->container['timezone_mismatch'] = isset($data['timezone_mismatch']) ? $data['timezone_mismatch'] : null; $this->container['public_vpn'] = isset($data['public_vpn']) ? $data['public_vpn'] : null; $this->container['auxiliary_mobile'] = isset($data['auxiliary_mobile']) ? $data['auxiliary_mobile'] : null; + $this->container['os_mismatch'] = isset($data['os_mismatch']) ? $data['os_mismatch'] : null; } /** @@ -198,6 +204,9 @@ public function listInvalidProperties(): array if (null === $this->container['auxiliary_mobile']) { $invalidProperties[] = "'auxiliary_mobile' can't be null"; } + if (null === $this->container['os_mismatch']) { + $invalidProperties[] = "'os_mismatch' can't be null"; + } return $invalidProperties; } @@ -224,7 +233,7 @@ public function getTimezoneMismatch(): bool /** * Sets timezone_mismatch. * - * @param bool $timezone_mismatch user's browser timezone doesn't match the timezone from which the request was originally made + * @param bool $timezone_mismatch the browser timezone doesn't match the timezone inferred from the request IP address * * @return $this */ @@ -279,6 +288,28 @@ public function setAuxiliaryMobile(bool $auxiliary_mobile): self return $this; } + /** + * Gets os_mismatch. + */ + public function getOsMismatch(): bool + { + return $this->container['os_mismatch']; + } + + /** + * Sets os_mismatch. + * + * @param bool $os_mismatch the browser runs on a different operating system than the operating system inferred from the request network signature + * + * @return $this + */ + public function setOsMismatch(bool $os_mismatch): self + { + $this->container['os_mismatch'] = $os_mismatch; + + return $this; + } + /** * Returns true if offset exists. False otherwise. * diff --git a/src/Model/WebhookVisit.php b/src/Model/WebhookVisit.php index a71cabf8..585c084a 100644 --- a/src/Model/WebhookVisit.php +++ b/src/Model/WebhookVisit.php @@ -74,6 +74,9 @@ class WebhookVisit implements ModelInterface, \ArrayAccess 'high_activity' => '\Fingerprint\ServerAPI\Model\HighActivityResult', 'location_spoofing' => '\Fingerprint\ServerAPI\Model\LocationSpoofingResult', 'suspect_score' => '\Fingerprint\ServerAPI\Model\SuspectScoreResult', + 'remote_control' => '\Fingerprint\ServerAPI\Model\RemoteControlResult', + 'velocity' => '\Fingerprint\ServerAPI\Model\VelocityResult', + 'developer_tools' => '\Fingerprint\ServerAPI\Model\DeveloperToolsResult', 'request_id' => 'string', 'browser_details' => '\Fingerprint\ServerAPI\Model\BrowserDetails', 'ip' => 'string', @@ -117,6 +120,9 @@ class WebhookVisit implements ModelInterface, \ArrayAccess 'high_activity' => null, 'location_spoofing' => null, 'suspect_score' => null, + 'remote_control' => null, + 'velocity' => null, + 'developer_tools' => null, 'request_id' => null, 'browser_details' => null, 'ip' => 'ipv4', @@ -161,6 +167,9 @@ class WebhookVisit implements ModelInterface, \ArrayAccess 'high_activity' => 'highActivity', 'location_spoofing' => 'locationSpoofing', 'suspect_score' => 'suspectScore', + 'remote_control' => 'remoteControl', + 'velocity' => 'velocity', + 'developer_tools' => 'developerTools', 'request_id' => 'requestId', 'browser_details' => 'browserDetails', 'ip' => 'ip', @@ -204,6 +213,9 @@ class WebhookVisit implements ModelInterface, \ArrayAccess 'high_activity' => 'setHighActivity', 'location_spoofing' => 'setLocationSpoofing', 'suspect_score' => 'setSuspectScore', + 'remote_control' => 'setRemoteControl', + 'velocity' => 'setVelocity', + 'developer_tools' => 'setDeveloperTools', 'request_id' => 'setRequestId', 'browser_details' => 'setBrowserDetails', 'ip' => 'setIp', @@ -247,6 +259,9 @@ class WebhookVisit implements ModelInterface, \ArrayAccess 'high_activity' => 'getHighActivity', 'location_spoofing' => 'getLocationSpoofing', 'suspect_score' => 'getSuspectScore', + 'remote_control' => 'getRemoteControl', + 'velocity' => 'getVelocity', + 'developer_tools' => 'getDeveloperTools', 'request_id' => 'getRequestId', 'browser_details' => 'getBrowserDetails', 'ip' => 'getIp', @@ -299,6 +314,9 @@ public function __construct(?array $data = null) $this->container['high_activity'] = isset($data['high_activity']) ? $data['high_activity'] : null; $this->container['location_spoofing'] = isset($data['location_spoofing']) ? $data['location_spoofing'] : null; $this->container['suspect_score'] = isset($data['suspect_score']) ? $data['suspect_score'] : null; + $this->container['remote_control'] = isset($data['remote_control']) ? $data['remote_control'] : null; + $this->container['velocity'] = isset($data['velocity']) ? $data['velocity'] : null; + $this->container['developer_tools'] = isset($data['developer_tools']) ? $data['developer_tools'] : null; $this->container['request_id'] = isset($data['request_id']) ? $data['request_id'] : null; $this->container['browser_details'] = isset($data['browser_details']) ? $data['browser_details'] : null; $this->container['ip'] = isset($data['ip']) ? $data['ip'] : null; @@ -411,9 +429,6 @@ public function listInvalidProperties(): array if (null === $this->container['url']) { $invalidProperties[] = "'url' can't be null"; } - if (null === $this->container['tag']) { - $invalidProperties[] = "'tag' can't be null"; - } if (null === $this->container['visitor_found']) { $invalidProperties[] = "'visitor_found' can't be null"; } @@ -986,6 +1001,78 @@ public function setSuspectScore(?SuspectScoreResult $suspect_score): self return $this; } + /** + * Gets remote_control. + * + * @return ?\Fingerprint\ServerAPI\Model\RemoteControlResult + */ + public function getRemoteControl(): ?RemoteControlResult + { + return $this->container['remote_control']; + } + + /** + * Sets remote_control. + * + * @param ?\Fingerprint\ServerAPI\Model\RemoteControlResult $remote_control remote_control + * + * @return $this + */ + public function setRemoteControl(?RemoteControlResult $remote_control): self + { + $this->container['remote_control'] = $remote_control; + + return $this; + } + + /** + * Gets velocity. + * + * @return ?\Fingerprint\ServerAPI\Model\VelocityResult + */ + public function getVelocity(): ?VelocityResult + { + return $this->container['velocity']; + } + + /** + * Sets velocity. + * + * @param ?\Fingerprint\ServerAPI\Model\VelocityResult $velocity velocity + * + * @return $this + */ + public function setVelocity(?VelocityResult $velocity): self + { + $this->container['velocity'] = $velocity; + + return $this; + } + + /** + * Gets developer_tools. + * + * @return ?\Fingerprint\ServerAPI\Model\DeveloperToolsResult + */ + public function getDeveloperTools(): ?DeveloperToolsResult + { + return $this->container['developer_tools']; + } + + /** + * Sets developer_tools. + * + * @param ?\Fingerprint\ServerAPI\Model\DeveloperToolsResult $developer_tools developer_tools + * + * @return $this + */ + public function setDeveloperTools(?DeveloperToolsResult $developer_tools): self + { + $this->container['developer_tools'] = $developer_tools; + + return $this; + } + /** * Gets request_id. */ @@ -1145,9 +1232,9 @@ public function setUrl(string $url): self /** * Gets tag. * - * @return map[string,object] + * @return ?map[string,object] */ - public function getTag(): array + public function getTag(): ?array { return $this->container['tag']; } @@ -1155,11 +1242,11 @@ public function getTag(): array /** * Sets tag. * - * @param map[string,object] $tag A customer-provided value or an object that was sent with identification request + * @param ?map[string,object] $tag A customer-provided value or an object that was sent with identification request * * @return $this */ - public function setTag(array $tag): self + public function setTag(?array $tag): self { $this->container['tag'] = $tag; diff --git a/template/README.mustache b/template/README.mustache index 3154a0e0..f4aeade8 100644 --- a/template/README.mustache +++ b/template/README.mustache @@ -94,6 +94,7 @@ const PAGINATION_KEY = "1683900801733.Ogvu1j"; // Import Fingerprint Pro Classes and Guzzle Http Client use Fingerprint\ServerAPI\Api\FingerprintApi; use Fingerprint\ServerAPI\Configuration; +use Fingerprint\ServerAPI\Model\EventUpdateRequest; use GuzzleHttp\Client; // Create a new Configuration instance with your Fingerprint Pro Server API Key and your Fingerprint Pro Server API Region. @@ -114,7 +115,7 @@ $client = new FingerprintApi( // Get an event with a given requestId try { // Fetch the event with a given requestId - $response = $client->getEvent(FPJS_REQUEST_ID); + list($model, $response) = $client->getEvent(FPJS_REQUEST_ID); echo "
" . $response->__toString() . ""; } catch (Exception $e) { echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; @@ -123,31 +124,56 @@ try { // Get a specific visitor's all visits try { // Fetch all visits with a given visitorId, with a page limit - $response = $client->getVisits(FPJS_VISITOR_ID, null, null, LIMIT); + list($model, $response) = $client->getVisits(FPJS_VISITOR_ID, null, null, LIMIT); echo "
" . $response->__toString() . ""; } catch (Exception $e) { - echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL; } // Get a specific visitor's all visits with a linkedId try { // Fetch all visits with a given visitorId, with a page limit, skipping the first visit - $response = $client->getVisits(FPJS_VISITOR_ID, null, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY); + list($model, $response) = $client->getVisits(FPJS_VISITOR_ID, null, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY); echo "
" . $response->__toString() . ""; } catch (Exception $e) { - echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL; } // Use all the parameters on getVisits try { // Fetch the visitor's all visits with a given requestId and linkedId with a page limit while skipping the first visit - $response = $client->getVisits(FPJS_VISITOR_ID, FPJS_REQUEST_ID, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY); + list($model, $response) = $client->getVisits(FPJS_VISITOR_ID, FPJS_REQUEST_ID, FPJS_LINKED_ID, LIMIT, PAGINATION_KEY); echo "
" . $response->__toString() . ""; } catch (Exception $e) { - echo 'Exception when calling FingerprintApi->getEvent: ', $e->getMessage(), PHP_EOL; + echo 'Exception when calling FingerprintApi->getVisits: ', $e->getMessage(), PHP_EOL; +} + +// Update Event +try { + $body = new EventUpdateRequest([ + 'linked_id' => 'new linked id', + 'tag' => json_encode(['new_property' => 'new value']), + 'suspect' => true, + ]); + list($model, $response) = $client->updateEvent($body, FPJS_REQUEST_ID); + echo "
" . $response->__toString() . ""; +} catch (Exception $e) { + echo 'Exception when calling FingerprintApi->updateEvent: ', $e->getMessage(), PHP_EOL; +} + +// Delete by visitor ID +try { + list($model, $response) = $client->deleteVisitorData(FPJS_VISITOR_ID); + echo "
" . $response->__toString() . ""; +} catch (Exception $e) { + echo 'Exception when calling FingerprintApi->deleteVisitorData: ', $e->getMessage(), PHP_EOL; } ``` +> ⚠️ Warning It's not possible to update events older than 10 days. + +> ⚠️ If you are interested in using `deleteVisitorData` API, please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + ## Sealed results This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results). diff --git a/template/api.mustache b/template/api.mustache index 3a3f0cde..39c03724 100644 --- a/template/api.mustache +++ b/template/api.mustache @@ -78,6 +78,7 @@ use \GuzzleHttp\Exception\GuzzleException; * @throws \InvalidArgumentException * @throws SerializationException * @throws GuzzleException + * @throws ApiException * @return array{ {{#returnType}}{{{returnType}}}|null{{/returnType}}{{^returnType}}null{{/returnType}}, \Psr\Http\Message\ResponseInterface } */ public function {{operationId}}({{#parameters}}{{dataType}} ${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/parameters}}): array @@ -163,6 +164,8 @@ use \GuzzleHttp\Exception\GuzzleException; * * @throws \InvalidArgumentException * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ public function {{operationId}}Async({{#parameters}}{{dataType}} ${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/parameters}}): \GuzzleHttp\Promise\PromiseInterface { @@ -230,6 +233,8 @@ use \GuzzleHttp\Exception\GuzzleException; * * @throws \InvalidArgumentException * @throws SerializationException + * @throws GuzzleException + * @throws ApiException */ protected function {{operationId}}Request({{#parameters}}{{dataType}}{{^required}}|null{{/required}} ${{paramName}}{{^required}} = {{#defaultValue}}'{{{.}}}'{{/defaultValue}}{{^defaultValue}}null{{/defaultValue}}{{/required}}{{#hasMore}}, {{/hasMore}}{{/parameters}}): \GuzzleHttp\Psr7\Request { diff --git a/test/FingerprintApiTest.php b/test/FingerprintApiTest.php index e498b7d7..b13e9f17 100644 --- a/test/FingerprintApiTest.php +++ b/test/FingerprintApiTest.php @@ -2,14 +2,26 @@ namespace Fingerprint\ServerAPI; -use Exception; use Fingerprint\ServerAPI\Api\FingerprintApi; -use Fingerprint\ServerAPI\Model\EventResponse; +use Fingerprint\ServerAPI\Model\ErrorCommon403Response; +use Fingerprint\ServerAPI\Model\ErrorCommon429Response; +use Fingerprint\ServerAPI\Model\ErrorEvent404Response; +use Fingerprint\ServerAPI\Model\ErrorUpdateEvent400Response; +use Fingerprint\ServerAPI\Model\ErrorUpdateEvent409Response; +use Fingerprint\ServerAPI\Model\ErrorVisitor400Response; +use Fingerprint\ServerAPI\Model\ErrorVisitor404Response; +use Fingerprint\ServerAPI\Model\ErrorVisits403; +use Fingerprint\ServerAPI\Model\EventUpdateRequest; use Fingerprint\ServerAPI\Model\IdentificationError; use Fingerprint\ServerAPI\Model\ProductError; -use Fingerprint\ServerAPI\Model\Response; +use Fingerprint\ServerAPI\Model\TooManyRequestsResponse; +use GuzzleHttp\Client; +use GuzzleHttp\ClientInterface; +use GuzzleHttp\Exception\GuzzleException; +use GuzzleHttp\Handler\MockHandler; +use GuzzleHttp\HandlerStack; +use GuzzleHttp\Psr7\Response; use PHPUnit\Framework\TestCase; -use ReflectionClass; class FingerprintApiTest extends TestCase { @@ -24,14 +36,18 @@ class FingerprintApiTest extends TestCase public const MOCK_REQUEST_EXTRA_FIELDS = 'EXTRA_FIELDS'; public const MOCK_VISITOR_ID = 'AcxioeQKffpXF8iGQK3P'; public const MOCK_VISITOR_REQUEST_ID = '1655373780901.HhjRFX'; - - protected function getMethod($method_name) - { - $class = new ReflectionClass(FingerprintApi::class); - $get_event_request_method = $class->getMethod($method_name); - $get_event_request_method->setAccessible(true); - return $get_event_request_method; - } + public const MOCK_VISITOR_ID_403_ERROR = 'VISITOR_ID_403_ERROR'; + public const MOCK_VISITOR_ID_429_ERROR = 'VISITOR_ID_429_ERROR'; + public const MOCK_EVENT_ID_403_ERROR = 'EVENT_ID_403_ERROR'; + public const MOCK_EVENT_ID_404_ERROR = 'EVENT_ID_404_ERROR'; + public const MOCK_VISITOR_ID_400_ERROR = 'VISITOR_ID_400_ERROR'; + public const MOCK_VISITOR_ID_404_ERROR = 'VISITOR_ID_404_ERROR'; + public const MOCK_EVENT_ID_409_ERROR = 'EVENT_ID_409_ERROR'; + public const MOCK_EVENT_ID = 'MOCK_EVENT_ID'; + public const MOCK_EVENT_ID_400_ERROR = 'EVENT_ID_400_ERROR'; + + protected ClientInterface $client; + protected MockHandler $mockHandler; protected function getVersion() { @@ -43,87 +59,112 @@ protected function getVersion() public function setUp(): void { - $config = new Configuration(); - $config->setHost(getenv('FP_API_HOST')); - $config->setApiKey('api_key', getenv('FP_PRIVATE_API_KEY')); - $this->fingerprint_api = $this->getMockBuilder(FingerprintApi::class) - ->getMock(); - - $this->fingerprint_api->method('getEvent')->will($this->returnCallback([$this, 'getEventWithHttpInfoMock'])); - $this->fingerprint_api->method('getVisits')->will($this->returnCallback([$this, 'getVisitsWithHttpInfoMock'])); + $this->mockHandler = new MockHandler(); + $this->client = new Client(['handler' => HandlerStack::create($this->mockHandler)]); + $this->fingerprint_api = new FingerprintApi($this->client); } - /** - * @throws \ReflectionException - * @throws SerializationException - */ - public function getEventWithHttpInfoMock($request_id): array + protected function getMockResponse(string $mockId, string $method = "GET", ?string $operationId = null): Response { - $event_request_method = $this->getMethod('getEventRequest'); - /** @var \GuzzleHttp\Psr7\Request $event_request */ - $event_request = $event_request_method->invokeArgs($this->fingerprint_api, [self::MOCK_REQUEST_ID]); - $query = $event_request->getUri()->getQuery(); - $this->assertStringContainsString("ii=" . urlencode("fingerprint-pro-server-php-sdk/" . $this->getVersion()), $query); $mock_name = ""; - switch ($request_id) { - case self::MOCK_REQUEST_ID: - $mock_name = 'get_event_200.json'; - break; - case self::MOCK_REQUEST_ALL_ERRORS: - $mock_name = 'get_event_200_all_errors.json'; - break; - case self::MOCK_REQUEST_EXTRA_FIELDS: - $mock_name = 'get_event_200_extra_fields.json'; - break; - case self::MOCK_REQUEST_ID_WITH_UNKNOWN: - $mock_name = 'get_event_200_with_unknown_field.json'; - break; - case self::MOCK_REQUEST_ID_WITH_BROKEN: - $mock_name = 'get_event_200_with_broken_format.json'; - break; + $status = 200; + + if ($method === "GET" || $method === "DELETE") { + switch ($mockId) { + case self::MOCK_REQUEST_ID: + $mock_name = 'get_event_200.json'; + break; + case self::MOCK_REQUEST_ALL_ERRORS: + $mock_name = 'get_event_200_all_errors.json'; + break; + case self::MOCK_REQUEST_EXTRA_FIELDS: + $mock_name = 'get_event_200_extra_fields.json'; + break; + case self::MOCK_REQUEST_ID_WITH_UNKNOWN: + $mock_name = 'get_event_200_with_unknown_field.json'; + break; + case self::MOCK_REQUEST_ID_WITH_BROKEN: + $mock_name = 'get_event_200_with_broken_format.json'; + break; + case self::MOCK_EVENT_ID_403_ERROR: + $mock_name = 'get_event_403_error.json'; + $status = 403; + break; + case self::MOCK_EVENT_ID_404_ERROR: + $mock_name = 'get_event_404_error.json'; + $status = 404; + break; + case self::MOCK_EVENT_ID_400_ERROR: + $mock_name = 'update_event_400_error.json'; + $status = 400; + break; + case self::MOCK_VISITOR_ID: + $mock_name = 'get_visits_200_limit_500.json'; + break; + case self::MOCK_VISITOR_REQUEST_ID: + $mock_name = "get_visits_200_limit_1.json"; + break; + case self::MOCK_VISITOR_ID_403_ERROR: + $mock_name = 'get_visits_403_error.json'; + $status = 403; + break; + case self::MOCK_VISITOR_ID_429_ERROR: + $mock_name = 'get_visits_429_too_many_requests_error.json'; + $status = 429; + break; + case self::MOCK_VISITOR_ID_400_ERROR: + $mock_name = "400_error_incorrect_visitor_id.json"; + $status = 400; + break; + case self::MOCK_VISITOR_ID_404_ERROR: + $mock_name = "404_error_visitor_not_found.json"; + $status = 404; + break; + } } - $file = file_get_contents(__DIR__ . "/mocks/$mock_name"); - $response = new \GuzzleHttp\Psr7\Response(200, [], $file); - - try { - $serialized = ObjectSerializer::deserialize($response, EventResponse::class); - } catch (Exception $exception) { - throw new SerializationException($response, $exception); + if ($method === "PUT") { + switch ($mockId) { + case self::MOCK_EVENT_ID: + default: + $mock_name = "update_event.json"; + break; + case self::MOCK_EVENT_ID_409_ERROR: + $status = 409; + $mock_name = "update_event_409_error.json"; + break; + case self::MOCK_EVENT_ID_404_ERROR: + $status = 404; + $mock_name = "update_event_404_error.json"; + break; + case self::MOCK_EVENT_ID_403_ERROR: + $status = 403; + $mock_name = "update_event_403_error.json"; + break; + case self::MOCK_EVENT_ID_400_ERROR: + $status = 400; + $mock_name = "update_event_400_error.json"; + break; + } } - return [$serialized, $response]; - } - - /** - * @throws SerializationException - */ - public function getVisitsWithHttpInfoMock($visitor_id, $request_id = null, $linked_id = null, $limit = null, $before = null): array - { - $file = file_get_contents(__DIR__ . '/mocks/get_visits_200_limit_500.json'); - $visits_mock_data = \GuzzleHttp\json_decode($file); - if ($request_id) { - $visits_mock_data->visits = array_filter($visits_mock_data->visits, function ($item) use ($request_id) { - return $item->requestId = $request_id; + $contents = file_get_contents(__DIR__ . "/mocks/$mock_name"); + if ($operationId) { + $visits_mock_data = json_decode($contents); + $visits_mock_data->visits = array_filter($visits_mock_data->visits, function ($item) use ($operationId) { + return isset($item->requestId) && $item->requestId === $operationId; }); + $contents = json_encode($visits_mock_data); } - if ($limit && is_numeric($limit)) { - $visits_mock_data->visits = array_slice($visits_mock_data->visits, 0, $limit); - } - - $response = new \GuzzleHttp\Psr7\Response(200, [], json_encode($visits_mock_data)); - try { - $serialized = ObjectSerializer::deserialize($response, Response::class); - } catch (Exception $exception) { - throw new SerializationException($response, $exception); - } - - return [$serialized, $response]; + return new Response($status, [], $contents); } public function testGetEvent() { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_REQUEST_ID)); + list($event, $response) = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_ID); $products = $event->getProducts(); $identification_product = $products->getIdentification(); @@ -164,6 +205,9 @@ public function testGetEvent() public function testGetEventWithExtraFields() { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_REQUEST_EXTRA_FIELDS)); + list($event, $response) = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_EXTRA_FIELDS); $products = $event->getProducts(); $identification_product = $products->getIdentification(); @@ -173,6 +217,9 @@ public function testGetEventWithExtraFields() public function testGetEventWithAllErrors() { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_REQUEST_ALL_ERRORS)); + list($event, $response) = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_ALL_ERRORS); $products = $event->getProducts(); $identification_error = $products->getIdentification()->getError(); @@ -217,20 +264,29 @@ public function testGetEventWithAllErrors() public function testGetVisits() { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID)); + list($visits, $response) = $this->fingerprint_api->getVisits(self::MOCK_VISITOR_ID); $this->assertEquals($visits->getVisitorId(), self::MOCK_VISITOR_ID); } public function testGetVisitsByRequestId() { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID, "GET", self::MOCK_VISITOR_REQUEST_ID)); + list($visits, $response) = $this->fingerprint_api->getVisits(self::MOCK_VISITOR_ID, self::MOCK_VISITOR_REQUEST_ID); foreach ($visits->getVisits() as $visit) { - $this->assertEquals(self::MOCK_VISITOR_REQUEST_ID, $visit->getRequestId()); + $this->assertEquals($visit->getRequestId(), self::MOCK_VISITOR_REQUEST_ID); } } public function testGetVisitsWithLimit() { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID)); + $limit = 100; list($visits, $response) = $this->fingerprint_api->getVisits(self::MOCK_VISITOR_ID, null, $limit); $count = count($visits->getVisits()); @@ -239,6 +295,9 @@ public function testGetVisitsWithLimit() public function testGetEventRawResponse() { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_REQUEST_ID)); + list($event, $response) = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_ID); $mockedResult = \GuzzleHttp\json_decode(file_get_contents(__DIR__ . "/mocks/get_event_200.json")); $this->assertEquals($mockedResult, \GuzzleHttp\json_decode($response->getBody()->getContents())); @@ -246,6 +305,9 @@ public function testGetEventRawResponse() public function testGetVisitsRawResponse() { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID)); + list($visits, $response) = $this->fingerprint_api->getVisits(self::MOCK_VISITOR_ID); $mockedResult = \GuzzleHttp\json_decode(file_get_contents(__DIR__ . "/mocks/get_visits_200_limit_500.json")); $this->assertEquals($mockedResult, \GuzzleHttp\json_decode($response->getBody()->getContents())); @@ -253,12 +315,18 @@ public function testGetVisitsRawResponse() public function testGetEventParsedModelWithUnknownField() { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_REQUEST_ID_WITH_UNKNOWN)); + list($event, $response) = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_ID_WITH_UNKNOWN); $this->assertEquals(false, $event->getProducts()->getIncognito()->getData()->getResult()); } public function testGetUnknownFieldFromEvent() { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_REQUEST_ID_WITH_UNKNOWN)); + list($event, $response) = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_ID_WITH_UNKNOWN); $responseBody = \GuzzleHttp\json_decode($response->getBody()->getContents()); $this->assertEquals("field", $responseBody->unknown); @@ -269,6 +337,9 @@ public function testGetUnknownFieldFromEvent() public function testGetBrokenFormatEvent() { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_REQUEST_ID_WITH_BROKEN)); + try { list($event, $response) = $this->fingerprint_api->getEvent(self::MOCK_REQUEST_ID_WITH_BROKEN); } catch (SerializationException $exception) { @@ -280,4 +351,217 @@ public function testGetBrokenFormatEvent() $this->assertNotNull($responseBody); $this->assertEquals("format", $responseBody->products->identification->data->linkedId->broken); } + + public function testDeleteVisitorData() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID, "DELETE")); + + list($result, $response) = $this->fingerprint_api->deleteVisitorData(self::MOCK_VISITOR_ID); + $this->assertEquals(200, $response->getStatusCode()); + } + + public function testGetVisits403Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID_403_ERROR)); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(403); + + try { + $this->fingerprint_api->getVisits(self::MOCK_VISITOR_ID_403_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorVisits403::class, get_class($e->getErrorDetails())); + throw $e; + } + } + + public function testGetVisits429Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID_429_ERROR)); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(429); + + try { + $this->fingerprint_api->getVisits(self::MOCK_VISITOR_ID_429_ERROR); + } catch (ApiException $e) { + $this->assertEquals(TooManyRequestsResponse::class, get_class($e->getErrorDetails())); + throw $e; + } + } + + public function testGetEvent403Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_EVENT_ID_403_ERROR)); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(403); + + try { + $this->fingerprint_api->getEvent(self::MOCK_EVENT_ID_403_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorCommon403Response::class, get_class($e->getErrorDetails())); + throw $e; + } + } + + public function testGetEvent404Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_EVENT_ID_404_ERROR)); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(404); + + try { + $this->fingerprint_api->getEvent(self::MOCK_EVENT_ID_404_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorEvent404Response::class, get_class($e->getErrorDetails())); + $this->assertEquals("request id is not found", $e->getErrorDetails()->getError()->getMessage()); + $this->assertEquals("RequestNotFound", $e->getErrorDetails()->getError()->getCode()); + throw $e; + } + } + + public function testDeleteVisitorData400Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID_400_ERROR, "DELETE")); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(400); + + try { + + $this->fingerprint_api->deleteVisitorData(self::MOCK_VISITOR_ID_400_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorVisitor400Response::class, get_class($e->getErrorDetails())); + $this->assertEquals("invalid visitor id", $e->getErrorDetails()->getError()->getMessage()); + $this->assertEquals("RequestCannotBeParsed", $e->getErrorDetails()->getError()->getCode()); + throw $e; + } + } + + public function testDeleteVisitorData403Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID_403_ERROR, "DELETE")); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(403); + + try { + $this->fingerprint_api->deleteVisitorData(self::MOCK_VISITOR_ID_403_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorCommon403Response::class, get_class($e->getErrorDetails())); + throw $e; + } + } + + public function testDeleteVisitorData404Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID_404_ERROR, "DELETE")); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(404); + + try { + $this->fingerprint_api->deleteVisitorData(self::MOCK_VISITOR_ID_404_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorVisitor404Response::class, get_class($e->getErrorDetails())); + $this->assertEquals("VisitorNotFound", $e->getErrorDetails()->getError()->getCode()); + + throw $e; + } + } + + public function testDeleteVisitorData429Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_VISITOR_ID_429_ERROR, "DELETE")); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(429); + + try { + $this->fingerprint_api->deleteVisitorData(self::MOCK_VISITOR_ID_429_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorCommon429Response::class, get_class($e->getErrorDetails())); + throw $e; + } + } + + public function testUpdateEvent400Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_EVENT_ID_400_ERROR, "PUT")); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(400); + + try { + $this->fingerprint_api->updateEvent(new EventUpdateRequest([]), self::MOCK_EVENT_ID_400_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorUpdateEvent400Response::class, get_class($e->getErrorDetails())); + $this->assertEquals("RequestCannotBeParsed", $e->getErrorDetails()->getError()->getCode()); + throw $e; + } + } + + public function testUpdateEvent403Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_EVENT_ID_403_ERROR, "PUT")); + + + $this->expectException(ApiException::class); + $this->expectExceptionCode(403); + + try { + $this->fingerprint_api->updateEvent(new EventUpdateRequest([]), self::MOCK_EVENT_ID_403_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorCommon403Response::class, get_class($e->getErrorDetails())); + $this->assertEquals("TokenRequired", $e->getErrorDetails()->getError()->getCode()); + throw $e; + } + } + + public function testUpdateEvent404Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_EVENT_ID_404_ERROR, "PUT")); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(404); + + try { + $this->fingerprint_api->updateEvent(new EventUpdateRequest([]), self::MOCK_EVENT_ID_404_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorEvent404Response::class, get_class($e->getErrorDetails())); + $this->assertEquals("RequestNotFound", $e->getErrorDetails()->getError()->getCode()); + throw $e; + } + } + + public function testUpdateEvent409Error() + { + $this->mockHandler->reset(); + $this->mockHandler->append($this->getMockResponse(self::MOCK_EVENT_ID_409_ERROR, "PUT")); + + $this->expectException(ApiException::class); + $this->expectExceptionCode(409); + + try { + $this->fingerprint_api->updateEvent(new EventUpdateRequest([]), self::MOCK_EVENT_ID_409_ERROR); + } catch (ApiException $e) { + $this->assertEquals(ErrorUpdateEvent409Response::class, get_class($e->getErrorDetails())); + $this->assertEquals("StateNotReady", $e->getErrorDetails()->getError()->getCode()); + throw $e; + } + } } diff --git a/test/mocks/400_error_empty_visitor_id.json b/test/mocks/400_error_empty_visitor_id.json new file mode 100644 index 00000000..6c5801a0 --- /dev/null +++ b/test/mocks/400_error_empty_visitor_id.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "RequestCannotBeParsed", + "message": "visitor id is required" + } +} diff --git a/test/mocks/400_error_incorrect_visitor_id.json b/test/mocks/400_error_incorrect_visitor_id.json new file mode 100644 index 00000000..c204c568 --- /dev/null +++ b/test/mocks/400_error_incorrect_visitor_id.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "RequestCannotBeParsed", + "message": "invalid visitor id" + } +} diff --git a/test/mocks/403_error_feature_not_enabled.json b/test/mocks/403_error_feature_not_enabled.json new file mode 100644 index 00000000..9820a568 --- /dev/null +++ b/test/mocks/403_error_feature_not_enabled.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "FeatureNotEnabled", + "message": "feature not enabled" + } +} diff --git a/test/mocks/403_error_token_not_found.json b/test/mocks/403_error_token_not_found.json new file mode 100644 index 00000000..3936b530 --- /dev/null +++ b/test/mocks/403_error_token_not_found.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "TokenNotFound", + "message": "secret key is not found" + } +} diff --git a/test/mocks/403_error_token_required.json b/test/mocks/403_error_token_required.json new file mode 100644 index 00000000..544d8714 --- /dev/null +++ b/test/mocks/403_error_token_required.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "TokenRequired", + "message": "secret key is required" + } +} diff --git a/test/mocks/403_error_wrong_region.json b/test/mocks/403_error_wrong_region.json new file mode 100644 index 00000000..8acc9e01 --- /dev/null +++ b/test/mocks/403_error_wrong_region.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "WrongRegion", + "message": "wrong region" + } +} diff --git a/test/mocks/404_error_visitor_not_found.json b/test/mocks/404_error_visitor_not_found.json new file mode 100644 index 00000000..11da4f3d --- /dev/null +++ b/test/mocks/404_error_visitor_not_found.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "VisitorNotFound", + "message": "visitor not found" + } +} diff --git a/test/mocks/429_error_too_many_requests.json b/test/mocks/429_error_too_many_requests.json new file mode 100644 index 00000000..e38639aa --- /dev/null +++ b/test/mocks/429_error_too_many_requests.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } +} diff --git a/test/mocks/get_event_200.json b/test/mocks/get_event_200.json index 06333763..6361db17 100644 --- a/test/mocks/get_event_200.json +++ b/test/mocks/get_event_200.json @@ -178,7 +178,8 @@ "methods": { "timezoneMismatch": false, "publicVPN": false, - "auxiliaryMobile": false + "auxiliaryMobile": false, + "osMismatch": false } } }, @@ -258,12 +259,7 @@ }, "cpuClass": {}, "fonts": { - "value": [ - "Arial Unicode MS", - "Gill Sans", - "Helvetica Neue", - "Menlo" - ] + "value": ["Arial Unicode MS", "Gill Sans", "Helvetica Neue", "Menlo"] } } }, @@ -276,6 +272,42 @@ "data": { "result": false } + }, + "remoteControl": { + "data": { + "result": false + } + }, + "velocity": { + "data": { + "distinctIp": { + "intervals": { + "5m": 1, + "1h": 1, + "24h": 1 + } + }, + "distinctLinkedId": {}, + "distinctCountry": { + "intervals": { + "5m": 1, + "1h": 2, + "24h": 2 + } + }, + "events": { + "intervals": { + "5m": 1, + "1h": 5, + "24h": 5 + } + } + } + }, + "developerTools": { + "data": { + "result": false + } } } } diff --git a/test/mocks/get_event_200_all_errors.json b/test/mocks/get_event_200_all_errors.json index 8245e5d2..2fe90ccb 100644 --- a/test/mocks/get_event_200_all_errors.json +++ b/test/mocks/get_event_200_all_errors.json @@ -135,6 +135,24 @@ "code": "Failed", "message": "internal server error" } + }, + "remoteControl": { + "error": { + "code": "Failed", + "message": "internal server error" + } + }, + "velocity": { + "error": { + "code": "Failed", + "message": "internal server error" + } + }, + "developerTools": { + "error": { + "code": "Failed", + "message": "internal server error" + } } } } diff --git a/test/mocks/get_event_200_botd_failed_error.json b/test/mocks/get_event_200_botd_failed_error.json new file mode 100644 index 00000000..f142f7b3 --- /dev/null +++ b/test/mocks/get_event_200_botd_failed_error.json @@ -0,0 +1,68 @@ +{ + "products": { + "identification": { + "data": { + "visitorId": "Ibk1527CUFmcnjLwIs4A9", + "requestId": "0KSh65EnVoB85JBmloQK", + "incognito": true, + "linkedId": "somelinkedId", + "time": "2019-05-21T16:40:13Z", + "tag": {}, + "timestamp": 1582299576512, + "url": "https://www.example.com/login", + "ip": "61.127.217.15", + "ipLocation": { + "accuracyRadius": 10, + "latitude": 49.982, + "longitude": 36.2566, + "postalCode": "61202", + "timezone": "Europe/Dusseldorf", + "city": { + "name": "Dusseldorf" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "country": { + "code": "DE", + "name": "Germany" + }, + "subdivisions": [ + { + "isoCode": "63", + "name": "North Rhine-Westphalia" + } + ] + }, + "browserDetails": { + "browserName": "Chrome", + "browserMajorVersion": "74", + "browserFullVersion": "74.0.3729", + "os": "Windows", + "osVersion": "7", + "device": "Other", + "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." + }, + "confidence": { + "score": 0.97 + }, + "visitorFound": true, + "firstSeenAt": { + "global": "2022-03-16T11:26:45.362Z", + "subscription": "2022-03-16T11:31:01.101Z" + }, + "lastSeenAt": { + "global": "2022-03-16T11:28:34.023Z", + "subscription": null + } + } + }, + "botd": { + "error": { + "code": "Failed", + "message": "internal server error" + } + } + } +} diff --git a/test/mocks/get_event_200_botd_too_many_requests_error.json b/test/mocks/get_event_200_botd_too_many_requests_error.json new file mode 100644 index 00000000..79288281 --- /dev/null +++ b/test/mocks/get_event_200_botd_too_many_requests_error.json @@ -0,0 +1,68 @@ +{ + "products": { + "identification": { + "data": { + "visitorId": "Ibk1527CUFmcnjLwIs4A9", + "requestId": "0KSh65EnVoB85JBmloQK", + "incognito": true, + "linkedId": "somelinkedId", + "tag": {}, + "time": "2019-05-21T16:40:13Z", + "timestamp": 1582299576512, + "url": "https://www.example.com/login", + "ip": "61.127.217.15", + "ipLocation": { + "accuracyRadius": 10, + "latitude": 49.982, + "longitude": 36.2566, + "postalCode": "61202", + "timezone": "Europe/Dusseldorf", + "city": { + "name": "Dusseldorf" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "country": { + "code": "DE", + "name": "Germany" + }, + "subdivisions": [ + { + "isoCode": "63", + "name": "North Rhine-Westphalia" + } + ] + }, + "browserDetails": { + "browserName": "Chrome", + "browserMajorVersion": "74", + "browserFullVersion": "74.0.3729", + "os": "Windows", + "osVersion": "7", + "device": "Other", + "userAgent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ...." + }, + "confidence": { + "score": 0.97 + }, + "visitorFound": true, + "firstSeenAt": { + "global": "2022-03-16T11:26:45.362Z", + "subscription": "2022-03-16T11:31:01.101Z" + }, + "lastSeenAt": { + "global": "2022-03-16T11:28:34.023Z", + "subscription": null + } + } + }, + "botd": { + "error": { + "code": "TooManyRequests", + "message": "too many requests" + } + } + } +} diff --git a/test/mocks/get_event_200_extra_fields.json b/test/mocks/get_event_200_extra_fields.json index 03e50c01..c15eb568 100644 --- a/test/mocks/get_event_200_extra_fields.json +++ b/test/mocks/get_event_200_extra_fields.json @@ -6,6 +6,7 @@ "requestId": "0KSh65EnVoB85JBmloQK", "incognito": true, "linkedId": "somelinkedId", + "tag": {}, "time": "2019-05-21T16:40:13Z", "timestamp": 1582299576512, "url": "https://www.example.com/login", @@ -44,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": { @@ -59,6 +61,8 @@ }, "botd": { "data": { + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 YaBrowser/24.1.0.0 Safari/537.36", + "requestId": "1708102555327.NLOjmg", "bot": { "result": "notDetected" }, diff --git a/test/mocks/get_event_200_identification_failed_error.json b/test/mocks/get_event_200_identification_failed_error.json new file mode 100644 index 00000000..5b42c579 --- /dev/null +++ b/test/mocks/get_event_200_identification_failed_error.json @@ -0,0 +1,23 @@ +{ + "products": { + "identification": { + "error": { + "code": "Failed", + "message": "failed" + } + }, + "botd": { + "data": { + "bot": { + "result": "bad", + "type": "headlessChrome" + }, + "url": "https://example.com/login", + "ip": "94.60.143.223", + "time": "2024-02-23T10:20:25.287Z", + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/121.0.6167.57 Safari/537.36", + "requestId": "1708683625245.tuJ4nD" + } + } + } +} diff --git a/test/mocks/get_event_200_identification_too_many_requests_error.json b/test/mocks/get_event_200_identification_too_many_requests_error.json new file mode 100644 index 00000000..deacdcad --- /dev/null +++ b/test/mocks/get_event_200_identification_too_many_requests_error.json @@ -0,0 +1,23 @@ +{ + "products": { + "identification": { + "error": { + "code": "429 Too Many Requests", + "message": "too many requests" + } + }, + "botd": { + "data": { + "bot": { + "result": "bad", + "type": "headlessChrome" + }, + "url": "https://example.com/login", + "ip": "94.60.143.223", + "time": "2024-02-23T10:20:25.287Z", + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/121.0.6167.57 Safari/537.36", + "requestId": "1708683625245.tuJ4nD" + } + } + } +} diff --git a/test/mocks/get_event_403_error.json b/test/mocks/get_event_403_error.json new file mode 100644 index 00000000..544d8714 --- /dev/null +++ b/test/mocks/get_event_403_error.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "TokenRequired", + "message": "secret key is required" + } +} diff --git a/test/mocks/get_event_404_error.json b/test/mocks/get_event_404_error.json new file mode 100644 index 00000000..389b351c --- /dev/null +++ b/test/mocks/get_event_404_error.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "RequestNotFound", + "message": "request id is not found" + } +} diff --git a/test/mocks/get_visits_200_limit_1.json b/test/mocks/get_visits_200_limit_1.json new file mode 100644 index 00000000..c5bbeedf --- /dev/null +++ b/test/mocks/get_visits_200_limit_1.json @@ -0,0 +1,62 @@ +{ + "visitorId": "AcxioeQKffpXF8iGQK3P", + "visits": [ + { + "requestId": "1655373953086.DDlfmP", + "browserDetails": { + "browserName": "Chrome", + "browserMajorVersion": "102", + "browserFullVersion": "102.0.5005", + "os": "Mac OS X", + "osVersion": "10.15.7", + "device": "Other", + "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/102.0.5005.61 Safari/537.36", + "botProbability": 0 + }, + "incognito": false, + "ip": "82.118.30.68", + "ipLocation": { + "accuracyRadius": 1000, + "latitude": 50.0805, + "longitude": 14.467, + "postalCode": "130 00", + "timezone": "Europe/Prague", + "city": { + "name": "Prague" + }, + "country": { + "code": "CZ", + "name": "Czechia" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "subdivisions": [ + { + "isoCode": "10", + "name": "Hlavni mesto Praha" + } + ] + }, + "timestamp": 1655373953094, + "time": "2022-06-16T10:05:53Z", + "url": "https://dashboard.fingerprint.com/", + "tag": {}, + "confidence": { + "score": 1 + }, + "visitorFound": true, + "firstSeenAt": { + "global": "2022-02-04T11:31:20Z", + "subscription": "2022-02-04T11:31:20Z" + }, + "lastSeenAt": { + "global": "2022-06-16T10:03:00.912Z", + "subscription": "2022-06-16T10:03:00.912Z" + } + } + ], + "lastTimestamp": 1655373953086, + "paginationKey": "1655373953086.DDlfmP" +} diff --git a/test/mocks/get_visits_403_error.json b/test/mocks/get_visits_403_error.json new file mode 100644 index 00000000..8a886d18 --- /dev/null +++ b/test/mocks/get_visits_403_error.json @@ -0,0 +1,3 @@ +{ + "error": "Forbidden (HTTP 403)" +} diff --git a/test/mocks/get_visits_429_too_many_requests_error.json b/test/mocks/get_visits_429_too_many_requests_error.json new file mode 100644 index 00000000..00d00f2e --- /dev/null +++ b/test/mocks/get_visits_429_too_many_requests_error.json @@ -0,0 +1,3 @@ +{ + "error": "too many requests" +} diff --git a/test/mocks/update_event_400_error.json b/test/mocks/update_event_400_error.json new file mode 100644 index 00000000..78568329 --- /dev/null +++ b/test/mocks/update_event_400_error.json @@ -0,0 +1,6 @@ +{ + "error": { + "code":"RequestCannotBeParsed", + "message":"request body is not valid" + } +} diff --git a/test/mocks/update_event_403_error.json b/test/mocks/update_event_403_error.json new file mode 100644 index 00000000..544d8714 --- /dev/null +++ b/test/mocks/update_event_403_error.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "TokenRequired", + "message": "secret key is required" + } +} diff --git a/test/mocks/update_event_404_error.json b/test/mocks/update_event_404_error.json new file mode 100644 index 00000000..389b351c --- /dev/null +++ b/test/mocks/update_event_404_error.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "RequestNotFound", + "message": "request id is not found" + } +} diff --git a/test/mocks/update_event_409_error.json b/test/mocks/update_event_409_error.json new file mode 100644 index 00000000..16ad29ae --- /dev/null +++ b/test/mocks/update_event_409_error.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "StateNotReady", + "message": "resource is not mutable yet, try again" + } +} diff --git a/test/mocks/webhook.json b/test/mocks/webhook.json new file mode 100644 index 00000000..15332a06 --- /dev/null +++ b/test/mocks/webhook.json @@ -0,0 +1,222 @@ +{ + "requestId": "Px6VxbRC6WBkA39yeNH3", + "tag": { + "requestType": "signup", + "yourCustomId": 45321 + }, + "linkedId": "any-string", + "visitorId": "3HNey93AkBW6CRbxV6xP", + "visitorFound": true, + "timestamp": 1554910997788, + "time": "2019-10-12T07:20:50.52Z", + "incognito": false, + "url": "https://banking.example.com/signup", + "clientReferrer": "https://google.com?search=banking+services", + "ip": "216.3.128.12", + "ipLocation": { + "accuracyRadius": 1, + "city": { + "name": "Bolingbrook" + }, + "continent": { + "code": "NA", + "name": "North America" + }, + "country": { + "code": "US", + "name": "United States" + }, + "latitude": 41.12933, + "longitude": -88.9954, + "postalCode": "60547", + "subdivisions": [ + { + "isoCode": "IL", + "name": "Illinois" + } + ], + "timezone": "America/Chicago" + }, + "browserDetails": { + "browserName": "Chrome", + "browserFullVersion": "73.0.3683.86", + "browserMajorVersion": "73", + "os": "Mac OS X", + "osVersion": "10.14.3", + "device": "Other", + "userAgent": "(Macintosh; Intel Mac OS X 10_14_3) Chrome/73.0.3683.86" + }, + "confidence": { + "score": 0.97 + }, + "firstSeenAt": { + "global": "2022-03-16T11:26:45.362Z", + "subscription": "2022-03-16T11:31:01.101Z" + }, + "lastSeenAt": { + "global": "2022-03-16T11:28:34.023Z", + "subscription": null + }, + "bot": { + "result": "bad", + "type": "selenium" + }, + "userAgent": "(Macintosh; Intel Mac OS X 10_14_3) Chrome/73.0.3683.86", + "ipInfo": { + "v4": { + "address": "94.142.239.124", + "geolocation": { + "accuracyRadius": 20, + "latitude": 50.05, + "longitude": 14.4, + "postalCode": "150 00", + "timezone": "Europe/Prague", + "city": { + "name": "Prague" + }, + "country": { + "code": "CZ", + "name": "Czechia" + }, + "continent": { + "code": "EU", + "name": "Europe" + }, + "subdivisions": [ + { + "isoCode": "10", + "name": "Hlavni mesto Praha" + } + ] + }, + "asn": { + "asn": "7922", + "name": "COMCAST-7922", + "network": "73.136.0.0/13" + }, + "datacenter": { + "result": true, + "name": "DediPath" + } + } + }, + "rootApps": { + "result": false + }, + "emulator": { + "result": false + }, + "ipBlocklist": { + "result": false, + "details": { + "emailSpam": false, + "attackSource": false + } + }, + "tor": { + "result": false + }, + "vpn": { + "result": false, + "originTimezone": "Europe/Berlin", + "originCountry": "unknown", + "methods": { + "timezoneMismatch": false, + "publicVPN": false, + "auxiliaryMobile": false, + "osMismatch": false + } + }, + "proxy": { + "result": false + }, + "tampering": { + "result": false, + "anomalyScore": 0 + }, + "clonedApp": { + "result": false + }, + "factoryReset": { + "time": "1970-01-01T00:00:00Z", + "timestamp": 0 + }, + "jailbroken": { + "result": false + }, + "frida": { + "result": false + }, + "privacySettings": { + "result": false + }, + "virtualMachine": { + "result": false + }, + "rawDeviceAttributes": { + "architecture": { + "value": 127 + }, + "audio": { + "value": 35.73832903057337 + }, + "canvas": { + "value": { + "Winding": true, + "Geometry": "4dce9d6017c3e0c052a77252f29f2b1c", + "Text": "dd2474a56ff78c1de3e7a07070ba3b7d" + } + }, + "colorDepth": { + "value": 30 + }, + "colorGamut": { + "value": "srgb" + }, + "contrast": { + "value": 0 + }, + "cookiesEnabled": { + "value": true + } + }, + "highActivity": { + "result": false + }, + "locationSpoofing": { + "result": true + }, + "suspectScore": { + "result": 0 + }, + "remoteControl": { + "result": false + }, + "velocity": { + "distinctIp": { + "intervals": { + "5m": 1, + "1h": 1, + "24h": 1 + } + }, + "distinctLinkedId": {}, + "distinctCountry": { + "intervals": { + "5m": 1, + "1h": 2, + "24h": 2 + } + }, + "events": { + "intervals": { + "5m": 1, + "1h": 5, + "24h": 5 + } + } + }, + "developerTools": { + "result": false + } +}