diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index d117e72db..d61ee6030 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -8,11 +8,15 @@ docs/Model/BotInfoIdentity.md docs/Model/BotResult.md docs/Model/BrowserDetails.md docs/Model/Canvas.md +docs/Model/EdgeRequest.md +docs/Model/EdgeRequestHeadersInner.md docs/Model/Emoji.md docs/Model/Error.md docs/Model/ErrorCode.md docs/Model/ErrorResponse.md docs/Model/Event.md +docs/Model/EventDevice.md +docs/Model/EventEdge.md docs/Model/EventRuleAction.md docs/Model/EventRuleActionAllow.md docs/Model/EventRuleActionBlock.md @@ -74,11 +78,15 @@ src/Model/BotInfoIdentity.php src/Model/BotResult.php src/Model/BrowserDetails.php src/Model/Canvas.php +src/Model/EdgeRequest.php +src/Model/EdgeRequestHeadersInner.php src/Model/Emoji.php src/Model/Error.php src/Model/ErrorCode.php src/Model/ErrorResponse.php src/Model/Event.php +src/Model/EventDevice.php +src/Model/EventEdge.php src/Model/EventRuleAction.php src/Model/EventRuleActionAllow.php src/Model/EventRuleActionBlock.php diff --git a/README.md b/README.md index 5f51185d8..2bfd53199 100644 --- a/README.md +++ b/README.md @@ -239,6 +239,7 @@ if(!$isValidWebhookSign) { Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- +*FingerprintApi* | [**analyzeRequestForAutomationIntelligence**](docs/Api/FingerprintApi.md#analyzerequestforautomationintelligence) | **POST** /edge | Collect Automation Intelligence. *FingerprintApi* | [**deleteVisitorData**](docs/Api/FingerprintApi.md#deletevisitordata) | **DELETE** /visitors/{visitor_id} | Delete a visitor ID *FingerprintApi* | [**getEvent**](docs/Api/FingerprintApi.md#getevent) | **GET** /events/{event_id} | Get an event by event ID *FingerprintApi* | [**searchEvents**](docs/Api/FingerprintApi.md#searchevents) | **GET** /events | Search events @@ -254,11 +255,15 @@ Class | Method | HTTP request | Description - [BotResult](docs/Model/BotResult.md) - [BrowserDetails](docs/Model/BrowserDetails.md) - [Canvas](docs/Model/Canvas.md) + - [EdgeRequest](docs/Model/EdgeRequest.md) + - [EdgeRequestHeadersInner](docs/Model/EdgeRequestHeadersInner.md) - [Emoji](docs/Model/Emoji.md) - [Error](docs/Model/Error.md) - [ErrorCode](docs/Model/ErrorCode.md) - [ErrorResponse](docs/Model/ErrorResponse.md) - [Event](docs/Model/Event.md) + - [EventDevice](docs/Model/EventDevice.md) + - [EventEdge](docs/Model/EventEdge.md) - [EventRuleAction](docs/Model/EventRuleAction.md) - [EventRuleActionAllow](docs/Model/EventRuleActionAllow.md) - [EventRuleActionBlock](docs/Model/EventRuleActionBlock.md) diff --git a/docs/Api/FingerprintApi.md b/docs/Api/FingerprintApi.md index d53244a9d..17f1c192f 100644 --- a/docs/Api/FingerprintApi.md +++ b/docs/Api/FingerprintApi.md @@ -6,12 +6,94 @@ All URIs are relative to *https://api.fpjs.io/v4* | Method | HTTP request | Description | | ------------- | ------------- | ------------- | +| [**analyzeRequestForAutomationIntelligence()**](FingerprintApi.md#analyzeRequestForAutomationIntelligence) | **POST** /edge | Collect Automation Intelligence. | | [**deleteVisitorData()**](FingerprintApi.md#deleteVisitorData) | **DELETE** /visitors/{visitor_id} | Delete a visitor ID | | [**getEvent()**](FingerprintApi.md#getEvent) | **GET** /events/{event_id} | Get an event by event ID | | [**searchEvents()**](FingerprintApi.md#searchEvents) | **GET** /events | Search events | | [**updateEvent()**](FingerprintApi.md#updateEvent) | **PATCH** /events/{event_id} | Update an event | +# **analyzeRequestForAutomationIntelligence** +> \Fingerprint\ServerSdk\Model\EventEdge analyzeRequestForAutomationIntelligence($edge_request) + +Collect Automation Intelligence. + +The Automation Intelligence API gives you the tools to determine whether traffic is legitimate and should be accepted by your application. + +This feature is currently in a Public Preview testing phase. All feedback is welcome! If you encounter any issues, please [contact our support team](https://fingerprint.com/support/). + +The API detects automation tools like AI Agents, AI Assistants, AI Browsers, and other bots. Additionally, it provides IP intelligence like geolocation, residential proxy, VPN and data center detection. + +Automation Intelligence is derived from HTTP request metadata that reaches your server. It does not require the use of a JavaScript client-side agent or mobile SDKs to collect device context. + +The API is fast, with average response times of less than 30ms, making it a great fit for edge, pre-origin or middleware contexts. The API is platform-agnostic and can be used with different CDN providers, cloud platforms, or any server backend. + +Because this API doesn’t require the use of a client-side device collection agent, it doesn’t support device identification via `visitor_id` and a few Smart Signals derived from deep device telemetry. + +### Event Retrieval + +Events created by the Automation Intelligence API can be fetched via the [`/v4/events/{event_id}`](https://docs.fingerprint.com/reference/server-api-get-event) API using the `event_id` present in the API response. + +Fetch all Automation Intelligence API events via the [`/v4/events?source=edge`](https://docs.fingerprint.com/reference/server-api-search-events#parameter-source) API. + + +### Example + +```php +analyzeRequestForAutomationIntelligence($edge_request); + var_dump($result); +} catch (ApiException $e) { + $errorDetails = $e->getErrorDetails()->getErrorDetails(); + echo "[{$errorDetails->getCode()}] Exception when calling FingerprintApi->analyzeRequestForAutomationIntelligence: {$errorDetails->getMessage()}" . PHP_EOL; +} catch (Exception $e) { + echo 'Exception when calling FingerprintApi->analyzeRequestForAutomationIntelligence: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **edge_request** | [**\Fingerprint\ServerSdk\Model\EdgeRequest**](../Model/EdgeRequest.md) | | | + +### Return type + +[**\Fingerprint\ServerSdk\Model\EventEdge**](../Model/EventEdge.md) + +### Authorization + +[bearerAuth](../../README.md#bearerAuth) + +### HTTP request headers + +- **Content-Type**: `application/json` +- **Accept**: `application/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#documentation-for-models) +[[Back to README]](../../README.md) + # **deleteVisitorData** > deleteVisitorData($visitor_id) @@ -67,7 +149,7 @@ $apiInstance = new FingerprintApi( new GuzzleHttp\Client() ); -$visitor_id = Ibk1527CUFmcnjLwIs4A9; // string | The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. +$visitor_id = Ibk1527CUFmcnjLwIs4A9; // string | The [visitor ID](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) you want to delete. try { $apiInstance->deleteVisitorData($visitor_id); @@ -83,7 +165,7 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | -| **visitor_id** | **string** | The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. | | +| **visitor_id** | **string** | The [visitor ID](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) you want to delete. | | ### Return type @@ -107,10 +189,12 @@ void (empty response body) Get an event by event ID -Get a detailed analysis of an individual identification event, including Smart Signals. +Get a detailed analysis of an individual event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. +Returns `EventDevice` when `source` is `device`, and `EventEdge` when `source` is `edge`. + ### Example @@ -133,7 +217,7 @@ $apiInstance = new FingerprintApi( new GuzzleHttp\Client() ); -$event_id = 1708102555327.NLOjmg; // string | The unique [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) of each identification request (`requestId` can be used in its place). +$event_id = 1708102555327.NLOjmg; // string | The unique [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id) of each identification request (`requestId` can be used in its place). $ruleset_id = D6N9Kbk9HRWrIWGz; // string | The ID of the ruleset to evaluate against the event, producing the action to take for this event. The resulting action is returned in the `rule_action` attribute of the response. try { @@ -151,7 +235,7 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | -| **event_id** | **string** | The unique [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) of each identification request (`requestId` can be used in its place). | | +| **event_id** | **string** | The unique [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id) of each identification request (`requestId` can be used in its place). | | | **ruleset_id** | **string** | The ID of the ruleset to evaluate against the event, producing the action to take for this event. The resulting action is returned in the `rule_action` attribute of the response. | [optional] | ### Return type @@ -172,7 +256,7 @@ try { [[Back to README]](../../README.md) # **searchEvents** -> \Fingerprint\ServerSdk\Model\EventSearch searchEvents($limit, $pagination_key, $visitor_id, $high_recall_id, $bot, $bot_info, $bot_info_category, $bot_info_identity, $bot_info_confidence, $bot_info_provider, $bot_info_name, $ip_address, $asn, $linked_id, $url, $bundle_id, $package_name, $origin, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $developer_tools, $location_spoofing, $mitm_attack, $rare_device, $rare_device_percentile_bucket, $proxy, $sdk_version, $sdk_platform, $environment, $proximity_id, $total_hits, $tor_node, $incremental_identification_status, $simulator, $source, $active_call) +> \Fingerprint\ServerSdk\Model\EventSearch searchEvents($limit, $pagination_key, $visitor_id, $high_recall_id, $bot, $bot_info, $bot_info_category, $bot_info_identity, $bot_info_confidence, $bot_info_provider, $bot_info_name, $ip_address, $asn, $linked_id, $url, $bundle_id, $package_name, $origin, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $developer_tools, $location_spoofing, $mitm_attack, $rare_device, $rare_device_percentile_bucket, $proxy, $sdk_version, $sdk_platform, $environment, $proximity_id, $total_hits, $tor_node, $incremental_identification_status, $simulator, $active_call, $source) Search events @@ -227,7 +311,7 @@ $apiInstance = new FingerprintApi( $limit = 10; // int | Maximum number of events to return. Defaults to 10 when omitted. Results are selected from the time range (`start`, `end`), ordered by `reverse`, then truncated to provided `limit` size. So `reverse=true` returns the oldest N=`limit` events, otherwise the newest N=`limit` events. $pagination_key = S9rgMMUb4z3X5t5pr_tSgoSZlmyF0O8X7kCV2m981-iY1LmRTjraa1rTk3L-hQExnDWCi0RA-zAIjaVSTNO2AN2eqQWgzT0RjbieMxRfSdkM-HmOhdOgdQvYfPG3vqU1DJKh4Q; // string | Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The pagination key is an arbitrary string that should not be interpreted in any way and should be passed as-is. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 100 events: `GET api-base-url/events?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=S9rgMMUb4z3X5t5pr_tSgoSZlmyF0O8X7kCV2m981-iY1LmRTjraa1rTk3L-hQExnDWCi0RA-zAIjaVSTNO2AN2eqQWgzT0RjbieMxRfSdkM-HmOhdOgdQvYfPG3vqU1DJKh4Q` -$visitor_id = Ibk1527CUFmcnjLwIs4A9; // string | Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). +$visitor_id = Ibk1527CUFmcnjLwIs4A9; // string | Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). $high_recall_id = Ibk1527CUFmcnjLwIs4A9; // string | The High Recall ID is a supplementary browser identifier designed for use cases that require wider coverage over precision. Compared to the standard visitor ID, the High Recall ID strives to match incoming browsers more generously (rather than precisely) with existing browsers and thus identifies fewer browsers as new. The High Recall ID is best suited for use cases that are sensitive to browsers being identified as new and where mismatched browsers are not detrimental. Filter events by matching High Recall ID (`supplementary_id_high_recall.visitor_id` property). $bot = \Fingerprint\ServerSdk\Model\SearchEventsBot::GOOD; // \Fingerprint\ServerSdk\Model\SearchEventsBot | Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. $bot_info = new \Fingerprint\ServerSdk\Model\\Fingerprint\ServerSdk\Model\SearchEventsBotInfo(); // \Fingerprint\ServerSdk\Model\SearchEventsBotInfo | Filter events by their Bot Info result, specifically: - `all` - events where any kind of bot was detected. - `none` - events where no bot was detected, and no `bot_info` was present. @@ -238,7 +322,7 @@ $bot_info_provider = array('bot_info_provider_example'); // string[] | Filter ev $bot_info_name = array('bot_info_name_example'); // string[] | Filter events by their Bot Info Name. The name must match exactly, partial or wildcard matching is not supported. Multiple Names can be provided using the repeated keys syntax. For example, `bot_info_name=ChatGPT%20Agent&bot_info_name=Bedrock%20AgentCore`, will match events with a Bot Info Name of `ChatGPT Agent` or `Bedrock AgentCore`. Other notations like comma-separated or bracket notation are not supported. $ip_address = 61.127.217.15; // string | Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 $asn = 12876; // string | Filter events by the ASN associated with the event's IP address. This corresponds to the `ip_info.(v4|v6).asn` property in the response. -$linked_id = somelinkedId; // string | Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-v4-get-function#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. +$linked_id = somelinkedId; // string | Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-get-function#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. $url = https://example.com/login; // string | Filter events by the URL (`url` property) associated with the event. $bundle_id = com.example.app; // string | Filter events by the Bundle ID (iOS) associated with the event. $package_name = com.example.app; // string | Filter events by the Package Name (Android) associated with the event. @@ -275,11 +359,11 @@ $total_hits = 100; // int | When set, the response will include a `total_hits` p $tor_node = True; // bool | Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. $incremental_identification_status = \Fingerprint\ServerSdk\Model\SearchEventsIncrementalIdentificationStatus::COMPLETED(); // \Fingerprint\ServerSdk\Model\SearchEventsIncrementalIdentificationStatus | Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response. $simulator = True; // bool | Filter events by iOS Simulator Detection result. > Note: When using this parameter, only events with the `simulator` property set to `true` or `false` are returned. Events without a `simulator` Smart Signal result are left out of the response. -$source = array(new \Fingerprint\ServerSdk\Model\\Fingerprint\ServerSdk\Model\SearchEventsSource()); // \Fingerprint\ServerSdk\Model\SearchEventsSource[] | Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. $active_call = True; // bool | Filter events by Active Call Detection result on mobile devices. > Note: When using this parameter, only events with the `active_call` property set to `true` or `false` are returned. Events without an `active_call` Smart Signal result are left out of the response. +$source = array(new \Fingerprint\ServerSdk\Model\\Fingerprint\ServerSdk\Model\SearchEventsSource()); // \Fingerprint\ServerSdk\Model\SearchEventsSource[] | Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. try { - $result = $apiInstance->searchEvents($limit, $pagination_key, $visitor_id, $high_recall_id, $bot, $bot_info, $bot_info_category, $bot_info_identity, $bot_info_confidence, $bot_info_provider, $bot_info_name, $ip_address, $asn, $linked_id, $url, $bundle_id, $package_name, $origin, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $developer_tools, $location_spoofing, $mitm_attack, $rare_device, $rare_device_percentile_bucket, $proxy, $sdk_version, $sdk_platform, $environment, $proximity_id, $total_hits, $tor_node, $incremental_identification_status, $simulator, $source, $active_call); + $result = $apiInstance->searchEvents($limit, $pagination_key, $visitor_id, $high_recall_id, $bot, $bot_info, $bot_info_category, $bot_info_identity, $bot_info_confidence, $bot_info_provider, $bot_info_name, $ip_address, $asn, $linked_id, $url, $bundle_id, $package_name, $origin, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $developer_tools, $location_spoofing, $mitm_attack, $rare_device, $rare_device_percentile_bucket, $proxy, $sdk_version, $sdk_platform, $environment, $proximity_id, $total_hits, $tor_node, $incremental_identification_status, $simulator, $active_call, $source); var_dump($result); } catch (ApiException $e) { $errorDetails = $e->getErrorDetails()->getErrorDetails(); @@ -295,7 +379,7 @@ try { | ------------- | ------------- | ------------- | ------------- | | **limit** | **int** | Maximum number of events to return. Defaults to 10 when omitted. Results are selected from the time range (`start`, `end`), ordered by `reverse`, then truncated to provided `limit` size. So `reverse=true` returns the oldest N=`limit` events, otherwise the newest N=`limit` events. | [optional] | | **pagination_key** | **string** | Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The pagination key is an arbitrary string that should not be interpreted in any way and should be passed as-is. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 100 events: `GET api-base-url/events?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=S9rgMMUb4z3X5t5pr_tSgoSZlmyF0O8X7kCV2m981-iY1LmRTjraa1rTk3L-hQExnDWCi0RA-zAIjaVSTNO2AN2eqQWgzT0RjbieMxRfSdkM-HmOhdOgdQvYfPG3vqU1DJKh4Q` | [optional] | -| **visitor_id** | **string** | Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). | [optional] | +| **visitor_id** | **string** | Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). | [optional] | | **high_recall_id** | **string** | The High Recall ID is a supplementary browser identifier designed for use cases that require wider coverage over precision. Compared to the standard visitor ID, the High Recall ID strives to match incoming browsers more generously (rather than precisely) with existing browsers and thus identifies fewer browsers as new. The High Recall ID is best suited for use cases that are sensitive to browsers being identified as new and where mismatched browsers are not detrimental. Filter events by matching High Recall ID (`supplementary_id_high_recall.visitor_id` property). | [optional] | | **bot** | [**\Fingerprint\ServerSdk\Model\SearchEventsBot**](../Model/.md) | Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. | [optional] | | **bot_info** | [**\Fingerprint\ServerSdk\Model\SearchEventsBotInfo**](../Model/.md) | Filter events by their Bot Info result, specifically: - `all` - events where any kind of bot was detected. - `none` - events where no bot was detected, and no `bot_info` was present. | [optional] | @@ -306,7 +390,7 @@ try { | **bot_info_name** | [**string[]**](../Model/string.md) | Filter events by their Bot Info Name. The name must match exactly, partial or wildcard matching is not supported. Multiple Names can be provided using the repeated keys syntax. For example, `bot_info_name=ChatGPT%20Agent&bot_info_name=Bedrock%20AgentCore`, will match events with a Bot Info Name of `ChatGPT Agent` or `Bedrock AgentCore`. Other notations like comma-separated or bracket notation are not supported. | [optional] | | **ip_address** | **string** | Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 | [optional] | | **asn** | **string** | Filter events by the ASN associated with the event's IP address. This corresponds to the `ip_info.(v4|v6).asn` property in the response. | [optional] | -| **linked_id** | **string** | Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-v4-get-function#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] | +| **linked_id** | **string** | Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-get-function#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] | | **url** | **string** | Filter events by the URL (`url` property) associated with the event. | [optional] | | **bundle_id** | **string** | Filter events by the Bundle ID (iOS) associated with the event. | [optional] | | **package_name** | **string** | Filter events by the Package Name (Android) associated with the event. | [optional] | @@ -343,8 +427,8 @@ try { | **tor_node** | **bool** | Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. | [optional] | | **incremental_identification_status** | [**\Fingerprint\ServerSdk\Model\SearchEventsIncrementalIdentificationStatus**](../Model/.md) | Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response. | [optional] | | **simulator** | **bool** | Filter events by iOS Simulator Detection result. > Note: When using this parameter, only events with the `simulator` property set to `true` or `false` are returned. Events without a `simulator` Smart Signal result are left out of the response. | [optional] | -| **source** | [**\Fingerprint\ServerSdk\Model\SearchEventsSource[]**](../Model/\Fingerprint\ServerSdk\Model\SearchEventsSource.md) | Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. | [optional] | | **active_call** | **bool** | Filter events by Active Call Detection result on mobile devices. > Note: When using this parameter, only events with the `active_call` property set to `true` or `false` are returned. Events without an `active_call` Smart Signal result are left out of the response. | [optional] | +| **source** | [**\Fingerprint\ServerSdk\Model\SearchEventsSource[]**](../Model/\Fingerprint\ServerSdk\Model\SearchEventsSource.md) | Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. | [optional] | ### Return type @@ -400,7 +484,7 @@ $apiInstance = new FingerprintApi( new GuzzleHttp\Client() ); -$event_id = 1708102555327.NLOjmg; // string | The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). +$event_id = 1708102555327.NLOjmg; // string | The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). $event_update = new \Fingerprint\ServerSdk\Model\EventUpdate(); // \Fingerprint\ServerSdk\Model\EventUpdate try { @@ -417,7 +501,7 @@ try { | Name | Type | Description | Notes | | ------------- | ------------- | ------------- | ------------- | -| **event_id** | **string** | The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). | | +| **event_id** | **string** | The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). | | | **event_update** | [**\Fingerprint\ServerSdk\Model\EventUpdate**](../Model/EventUpdate.md) | | | ### Return type diff --git a/docs/Model/EdgeRequest.md b/docs/Model/EdgeRequest.md new file mode 100644 index 000000000..3484a397e --- /dev/null +++ b/docs/Model/EdgeRequest.md @@ -0,0 +1,18 @@ +# EdgeRequest Class + +HTTP request metadata (including the HTTP method, headers and IP address) sent by you (your server) to the Fingerprint API for IP and bot analysis. To improve accuracy, retain as much of the original semantics of the HTTP request as possible. For example, preserve the order of the request headers and their capitalization. +At least one of `ipv4_address` or `ipv6_address` must be provided; a request with neither is rejected with a `400` error. If both IPv4 and IPv6 are provided, IP intelligence will be provided for each address. If an IPv4-mapped IPv6 address is provided in the `ipv6_address` request property, the IP intelligence will be provided in the `ipv4_address` property of the response. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**headers** | [**\Fingerprint\ServerSdk\Model\EdgeRequestHeadersInner[]**](EdgeRequestHeadersInner.md) | Ordered header entries from the request made to your server. Each entry represents one header line. If one header name appears as multiple lines, send each as a separate item in the array. Headers that contain authentication or session data must still be included, but with with their value set to an empty string. This includes headers like `Authorization` and `Cookie`, but may contain more depending on your specific project, for instance `Proxy-Authenticate` or `X-Api-Key`. Omitting the headers entirely changes the shape of the request and can affect detection. Never forward the real secret values. Whenever possible, we recommend preserving header order and capitalization to provide the best accuracy, however it’s not a strict requirement if your runtime does not maintain http header order or canonicalizes header names. | +**method** | **string** | The original HTTP method of the request. If supported in your runtime, preserve the original casing. | +**url** | **string** | Absolute URL of the request, without a \\#fragment suffix. Only HTTP and HTTPS schemes are supported. | +**ipv4_address** | **string** | Client IPv4 address observed by your server. | [optional] +**ipv6_address** | **string** | Client IPv6 address observed by your server. | [optional] +**linked_id** | **string** | A customer-provided id that was sent with the request. | [optional] +**tags** | **array** | A customer-provided value or an object that was sent with the identification request or updated later. | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) \ No newline at end of file diff --git a/docs/Model/EdgeRequestHeadersInner.md b/docs/Model/EdgeRequestHeadersInner.md new file mode 100644 index 000000000..7cd7217c1 --- /dev/null +++ b/docs/Model/EdgeRequestHeadersInner.md @@ -0,0 +1,10 @@ +# EdgeRequestHeadersInner Class + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | Header name as forwarded by your server. Headers must be valid according to RFC 7230 and will be canonicalized according to RFC 9112. | +**value** | **string** | Value of a single forwarded header entry. Be careful to preserve the original encoding and escaping. For example, do not double escape quotes. | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) \ No newline at end of file diff --git a/docs/Model/Event.md b/docs/Model/Event.md index a64b4f6d2..6bb29a979 100644 --- a/docs/Model/Event.md +++ b/docs/Model/Event.md @@ -1,6 +1,11 @@ # Event Class -Contains results from Fingerprint Identification and all active Smart Signals. Some Smart Signals are only supported for certain device types, these fields will be omitted for events not generated from the supported devices. Consult the [Smart Signals reference](https://docs.fingerprint.com/docs/smart-signals-reference) for more details. +An identification event (`source: device`) or an Automation Intelligence event (`source: edge`). + +Use `source` to tell them apart. Device events include Identification and device-derived Smart Signals. Edge events do not. + +Consult the [Smart Signals reference](https://docs.fingerprint.com/docs/smart-signals-reference) for more details. + ## Properties @@ -8,17 +13,25 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **event_id** | **string** | Unique identifier of the user's request. The first portion of the event_id is a unix epoch milliseconds timestamp. | **timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. | -**source** | [**\Fingerprint\ServerSdk\Model\EventSource**](EventSource.md) | | [optional] -**incremental_identification_status** | [**\Fingerprint\ServerSdk\Model\IncrementalIdentificationStatus**](IncrementalIdentificationStatus.md) | | [optional] **linked_id** | **string** | A customer-provided id that was sent with the request. | [optional] +**tags** | **array** | A customer-provided value or an object that was sent with the identification request or updated later. | [optional] +**url** | **string** | Page URL from which the request was sent. | [optional] +**bot_info** | [**\Fingerprint\ServerSdk\Model\BotInfo**](BotInfo.md) | | [optional] +**ip_info** | [**\Fingerprint\ServerSdk\Model\IPInfo**](IPInfo.md) | | +**proxy** | **bool** | IP address was used by a public proxy provider or belonged to a known recent residential proxy | [optional] +**proxy_confidence** | [**\Fingerprint\ServerSdk\Model\ProxyConfidence**](ProxyConfidence.md) | | [optional] +**proxy_details** | [**\Fingerprint\ServerSdk\Model\ProxyDetails**](ProxyDetails.md) | | [optional] +**vpn** | **bool** | VPN or other anonymizing service has been used when sending the request. | [optional] +**vpn_confidence** | [**\Fingerprint\ServerSdk\Model\VpnConfidence**](VpnConfidence.md) | | [optional] +**vpn_methods** | [**\Fingerprint\ServerSdk\Model\VpnMethods**](VpnMethods.md) | | [optional] +**source** | [**\Fingerprint\ServerSdk\Model\EventSource**](EventSource.md) | | +**incremental_identification_status** | [**\Fingerprint\ServerSdk\Model\IncrementalIdentificationStatus**](IncrementalIdentificationStatus.md) | | [optional] **environment_id** | **string** | Environment Id of the event. | [optional] -**suspect** | **bool** | Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://docs.fingerprint.com/reference/server-api-v4-update-event). | [optional] +**suspect** | **bool** | Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://docs.fingerprint.com/reference/server-api-update-event). | [optional] **sdk** | [**\Fingerprint\ServerSdk\Model\SDK**](SDK.md) | | [optional] **replayed** | **bool** | `true` if we determined that this payload was replayed, `false` otherwise. | [optional] **identification** | [**\Fingerprint\ServerSdk\Model\Identification**](Identification.md) | | [optional] **supplementary_id_high_recall** | [**\Fingerprint\ServerSdk\Model\SupplementaryIDHighRecall**](SupplementaryIDHighRecall.md) | | [optional] -**tags** | **array** | A customer-provided value or an object that was sent with the identification request or updated later. | [optional] -**url** | **string** | Page URL from which the request was sent. | [optional] **bundle_id** | **string** | Bundle Id of the iOS application integrated with the Fingerprint SDK for the event. | [optional] **package_name** | **string** | Package name of the Android application integrated with the Fingerprint SDK for the event. | [optional] **ip_address** | **string** | IP address of the requesting browser or bot. | [optional] @@ -32,17 +45,12 @@ Name | Type | Description | Notes **active_call** | **bool** | Indicates whether the mobile device had an active call (cellular or VoIP) at the time of the request. Available from SDK 2.16.0+ on iOS and Android. | [optional] **bot** | [**\Fingerprint\ServerSdk\Model\BotResult**](BotResult.md) | | [optional] **bot_type** | **string** | Additional classification of the bot type if detected. | [optional] -**bot_info** | [**\Fingerprint\ServerSdk\Model\BotInfo**](BotInfo.md) | | [optional] **cloned_app** | **bool** | Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. | [optional] **developer_tools** | **bool** | `true` if the browser has DevTools open (Chrome, Firefox) or the Android/iOS device has Developer Tools enabled, `false` otherwise. | [optional] **emulator** | **bool** | Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. | [optional] **factory_reset_timestamp** | **int** | The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. 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) as a value of 0. See [Factory Reset Detection](https://docs.fingerprint.com/docs/smart-signals-reference#factory-reset-detection) to learn more about this Smart Signal. | [optional] **frida** | **bool** | [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. | [optional] **ip_blocklist** | [**\Fingerprint\ServerSdk\Model\IPBlockList**](IPBlockList.md) | | [optional] -**ip_info** | [**\Fingerprint\ServerSdk\Model\IPInfo**](IPInfo.md) | | [optional] -**proxy** | **bool** | IP address was used by a public proxy provider or belonged to a known recent residential proxy | [optional] -**proxy_confidence** | [**\Fingerprint\ServerSdk\Model\ProxyConfidence**](ProxyConfidence.md) | | [optional] -**proxy_details** | [**\Fingerprint\ServerSdk\Model\ProxyDetails**](ProxyDetails.md) | | [optional] **proxy_ml_score** | **float** | Machine learning–based proxy score, represented as a floating-point value between 0 and 1 (inclusive), with up to three decimal places of precision. A higher score means a higher confidence in the positive `proxy` detection result. This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). | [optional] **incognito** | **bool** | `true` if we detected incognito mode used in the browser, `false` otherwise. | [optional] **jailbroken** | **bool** | iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. | [optional] @@ -60,12 +68,9 @@ Name | Type | Description | Notes **velocity** | [**\Fingerprint\ServerSdk\Model\Velocity**](Velocity.md) | | [optional] **virtual_machine** | **bool** | `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. | [optional] **virtual_machine_ml_score** | **float** | Machine learning–based virtual machine score, represented as a floating-point value between 0 and 1 (inclusive), with up to three decimal places of precision. A higher score means a higher confidence in the positive `virtual_machine` detection result. This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). | [optional] -**vpn** | **bool** | VPN or other anonymizing service has been used when sending the request. | [optional] -**vpn_confidence** | [**\Fingerprint\ServerSdk\Model\VpnConfidence**](VpnConfidence.md) | | [optional] **vpn_ml_score** | **float** | Machine learning–based VPN score, represented as a floating-point value between 0 and 1 (inclusive), with up to three decimal places of precision. A higher score means a higher confidence in the positive `vpn` detection result. This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). | [optional] **vpn_origin_timezone** | **string** | Local timezone which is used in timezone_mismatch method. | [optional] **vpn_origin_country** | **string** | Country of the request (Android SDK version >= 2.4.0, iOS SDK version >= 2.9.0, JS agent >= 3.12.9 / 4.0.2), ISO 3166 format or unknown. | [optional] -**vpn_methods** | [**\Fingerprint\ServerSdk\Model\VpnMethods**](VpnMethods.md) | | [optional] **high_activity_device** | **bool** | Flag indicating if the request came from a high-activity visitor. | [optional] **rare_device** | **bool** | `true` if the device is considered rare based on its combination of hardware and software attributes. A device is classified as rare if it falls within the top 99.9 percentile (lowest-frequency segment) of observed traffic, or if its configuration has not been previously seen (`not_seen`). > This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). | [optional] **rare_device_percentile_bucket** | [**\Fingerprint\ServerSdk\Model\RareDevicePercentileBucket**](RareDevicePercentileBucket.md) | | [optional] diff --git a/docs/Model/EventDevice.md b/docs/Model/EventDevice.md new file mode 100644 index 000000000..05792efc8 --- /dev/null +++ b/docs/Model/EventDevice.md @@ -0,0 +1,76 @@ +# EventDevice Class + +Contains results from Fingerprint Identification and Smart Signals derived from client-side device telemetry. Consult the [Smart Signals reference](https://docs.fingerprint.com/docs/smart-signals-reference) for more details. + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**event_id** | **string** | Unique identifier of the user's request. The first portion of the event_id is a unix epoch milliseconds timestamp. | +**timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. | +**linked_id** | **string** | A customer-provided id that was sent with the request. | [optional] +**tags** | **array** | A customer-provided value or an object that was sent with the identification request or updated later. | [optional] +**url** | **string** | Page URL from which the request was sent. | [optional] +**bot_info** | [**\Fingerprint\ServerSdk\Model\BotInfo**](BotInfo.md) | | [optional] +**ip_info** | [**\Fingerprint\ServerSdk\Model\IPInfo**](IPInfo.md) | | [optional] +**proxy** | **bool** | IP address was used by a public proxy provider or belonged to a known recent residential proxy | [optional] +**proxy_confidence** | [**\Fingerprint\ServerSdk\Model\ProxyConfidence**](ProxyConfidence.md) | | [optional] +**proxy_details** | [**\Fingerprint\ServerSdk\Model\ProxyDetails**](ProxyDetails.md) | | [optional] +**vpn** | **bool** | VPN or other anonymizing service has been used when sending the request. | [optional] +**vpn_confidence** | [**\Fingerprint\ServerSdk\Model\VpnConfidence**](VpnConfidence.md) | | [optional] +**vpn_methods** | [**\Fingerprint\ServerSdk\Model\VpnMethods**](VpnMethods.md) | | [optional] +**source** | [**\Fingerprint\ServerSdk\Model\EventSource**](EventSource.md) | | +**incremental_identification_status** | [**\Fingerprint\ServerSdk\Model\IncrementalIdentificationStatus**](IncrementalIdentificationStatus.md) | | [optional] +**environment_id** | **string** | Environment Id of the event. | [optional] +**suspect** | **bool** | Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://docs.fingerprint.com/reference/server-api-update-event). | [optional] +**sdk** | [**\Fingerprint\ServerSdk\Model\SDK**](SDK.md) | | [optional] +**replayed** | **bool** | `true` if we determined that this payload was replayed, `false` otherwise. | [optional] +**identification** | [**\Fingerprint\ServerSdk\Model\Identification**](Identification.md) | | [optional] +**supplementary_id_high_recall** | [**\Fingerprint\ServerSdk\Model\SupplementaryIDHighRecall**](SupplementaryIDHighRecall.md) | | [optional] +**bundle_id** | **string** | Bundle Id of the iOS application integrated with the Fingerprint SDK for the event. | [optional] +**package_name** | **string** | Package name of the Android application integrated with the Fingerprint SDK for the event. | [optional] +**ip_address** | **string** | IP address of the requesting browser or bot. | [optional] +**user_agent** | **string** | User Agent of the client. | [optional] +**device** | **string** | Device model or family extracted from the user agent string. On web, this field is also present inside `browser_details`. | [optional] +**os** | **string** | Operating system family extracted from the user agent string. On web, this field is also present inside `browser_details`. | [optional] +**os_version** | **string** | Operating system version string extracted from the user agent string. On web, this field is also present inside `browser_details`. | [optional] +**client_referrer** | **string** | Client Referrer field corresponds to the `document.referrer` field gathered during an identification request. The value is an empty string if the user navigated to the page directly (not through a link, but, for example, by using a bookmark). | [optional] +**browser_details** | [**\Fingerprint\ServerSdk\Model\BrowserDetails**](BrowserDetails.md) | | [optional] +**proximity** | [**\Fingerprint\ServerSdk\Model\Proximity**](Proximity.md) | | [optional] +**active_call** | **bool** | Indicates whether the mobile device had an active call (cellular or VoIP) at the time of the request. Available from SDK 2.16.0+ on iOS and Android. | [optional] +**bot** | [**\Fingerprint\ServerSdk\Model\BotResult**](BotResult.md) | | [optional] +**bot_type** | **string** | Additional classification of the bot type if detected. | [optional] +**cloned_app** | **bool** | Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. | [optional] +**developer_tools** | **bool** | `true` if the browser has DevTools open (Chrome, Firefox) or the Android/iOS device has Developer Tools enabled, `false` otherwise. | [optional] +**emulator** | **bool** | Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. | [optional] +**factory_reset_timestamp** | **int** | The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. 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) as a value of 0. See [Factory Reset Detection](https://docs.fingerprint.com/docs/smart-signals-reference#factory-reset-detection) to learn more about this Smart Signal. | [optional] +**frida** | **bool** | [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. | [optional] +**ip_blocklist** | [**\Fingerprint\ServerSdk\Model\IPBlockList**](IPBlockList.md) | | [optional] +**proxy_ml_score** | **float** | Machine learning–based proxy score, represented as a floating-point value between 0 and 1 (inclusive), with up to three decimal places of precision. A higher score means a higher confidence in the positive `proxy` detection result. This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). | [optional] +**incognito** | **bool** | `true` if we detected incognito mode used in the browser, `false` otherwise. | [optional] +**jailbroken** | **bool** | iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. | [optional] +**location_spoofing** | **bool** | Flag indicating whether the request came from a mobile device with location spoofing enabled. | [optional] +**mitm_attack** | **bool** | * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://docs.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. | [optional] +**privacy_settings** | **bool** | `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. | [optional] +**root_apps** | **bool** | Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. | [optional] +**rule_action** | [**\Fingerprint\ServerSdk\Model\EventRuleAction**](EventRuleAction.md) | | [optional] +**simulator** | **bool** | iOS specific simulator detection. There are 2 values: * `true` - Simulator environment detected. * `false` - No signs of simulator or the client is not iOS. | [optional] +**suspect_score** | **int** | Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://docs.fingerprint.com/docs/suspect-score | [optional] +**tampering** | **bool** | The field can be used as a standalone flag for tampering detection. Alternatively, the more granular fields documented below can be used for workflows that require more context. * `true` if tampering is detected through an anomalous browser signature, anti-detect browser detection, or other tampering-related methods * `false` if none of the tampering checks return a positive result | [optional] +**tampering_confidence** | [**\Fingerprint\ServerSdk\Model\TamperingConfidence**](TamperingConfidence.md) | | [optional] +**tampering_ml_score** | **float** | The output of this model is captured as tampering_ml_score, a number indicating how likely an event is coming from an anti detect browser. Values close to 1 signify higher confidence and we consider anything above the threshold of 0.8 to be actionable (the result and anti_detect_browser fields conveniently captures that fact) | [optional] +**tampering_details** | [**\Fingerprint\ServerSdk\Model\TamperingDetails**](TamperingDetails.md) | | [optional] +**velocity** | [**\Fingerprint\ServerSdk\Model\Velocity**](Velocity.md) | | [optional] +**virtual_machine** | **bool** | `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. | [optional] +**virtual_machine_ml_score** | **float** | Machine learning–based virtual machine score, represented as a floating-point value between 0 and 1 (inclusive), with up to three decimal places of precision. A higher score means a higher confidence in the positive `virtual_machine` detection result. This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). | [optional] +**vpn_ml_score** | **float** | Machine learning–based VPN score, represented as a floating-point value between 0 and 1 (inclusive), with up to three decimal places of precision. A higher score means a higher confidence in the positive `vpn` detection result. This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). | [optional] +**vpn_origin_timezone** | **string** | Local timezone which is used in timezone_mismatch method. | [optional] +**vpn_origin_country** | **string** | Country of the request (Android SDK version >= 2.4.0, iOS SDK version >= 2.9.0, JS agent >= 3.12.9 / 4.0.2), ISO 3166 format or unknown. | [optional] +**high_activity_device** | **bool** | Flag indicating if the request came from a high-activity visitor. | [optional] +**rare_device** | **bool** | `true` if the device is considered rare based on its combination of hardware and software attributes. A device is classified as rare if it falls within the top 99.9 percentile (lowest-frequency segment) of observed traffic, or if its configuration has not been previously seen (`not_seen`). > This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). | [optional] +**rare_device_percentile_bucket** | [**\Fingerprint\ServerSdk\Model\RareDevicePercentileBucket**](RareDevicePercentileBucket.md) | | [optional] +**raw_device_attributes** | [**\Fingerprint\ServerSdk\Model\RawDeviceAttributes**](RawDeviceAttributes.md) | | [optional] +**labels** | [**\Fingerprint\ServerSdk\Model\LabelsInner[]**](LabelsInner.md) | Each label returns a prediction (true or false) for a specific use case (label field) based on a machine learning score. The machine learning score is determined by a model trained on customer data for that use case. This field is in the beta phase and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). | [optional] + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) \ No newline at end of file diff --git a/docs/Model/EventEdge.md b/docs/Model/EventEdge.md new file mode 100644 index 000000000..6e4984d58 --- /dev/null +++ b/docs/Model/EventEdge.md @@ -0,0 +1,25 @@ +# EventEdge Class + +IP and bot analysis for an event generated by the Automation Intelligence API (`/edge` endpoint). No client-side collection agent is involved, so Identification (`visitor_id`) and device-telemetry-derived Smart Signals are not available. + + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**event_id** | **string** | Unique identifier of the user's request. The first portion of the event_id is a unix epoch milliseconds timestamp. | +**timestamp** | **int** | Timestamp of the event with millisecond precision in Unix time. | +**linked_id** | **string** | A customer-provided id that was sent with the request. | [optional] +**tags** | **array** | A customer-provided value or an object that was sent with the identification request or updated later. | [optional] +**url** | **string** | Page URL from which the request was sent. | [optional] +**bot_info** | [**\Fingerprint\ServerSdk\Model\BotInfo**](BotInfo.md) | | [optional] +**ip_info** | [**\Fingerprint\ServerSdk\Model\IPInfo**](IPInfo.md) | | +**proxy** | **bool** | IP address was used by a public proxy provider or belonged to a known recent residential proxy | [optional] +**proxy_confidence** | [**\Fingerprint\ServerSdk\Model\ProxyConfidence**](ProxyConfidence.md) | | [optional] +**proxy_details** | [**\Fingerprint\ServerSdk\Model\ProxyDetails**](ProxyDetails.md) | | [optional] +**vpn** | **bool** | VPN or other anonymizing service has been used when sending the request. | [optional] +**vpn_confidence** | [**\Fingerprint\ServerSdk\Model\VpnConfidence**](VpnConfidence.md) | | [optional] +**vpn_methods** | [**\Fingerprint\ServerSdk\Model\VpnMethods**](VpnMethods.md) | | [optional] +**source** | [**\Fingerprint\ServerSdk\Model\EventSource**](EventSource.md) | | + +[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) \ No newline at end of file diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index 5e7a37ba8..88835dd74 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -37,6 +37,97 @@ servers: security: - bearerAuth: [] paths: + /edge: + post: + tags: + - Fingerprint + operationId: analyzeRequestForAutomationIntelligence + summary: Collect Automation Intelligence. + description: > + The Automation Intelligence API gives you the tools to determine whether + traffic is legitimate and should be accepted by your application. + + + This feature is currently in a Public Preview testing phase. All + feedback is welcome! If you encounter any issues, please [contact our + support team](https://fingerprint.com/support/). + + + The API detects automation tools like AI Agents, AI Assistants, AI + Browsers, and other bots. Additionally, it provides IP intelligence like + geolocation, residential proxy, VPN and data center detection. + + + Automation Intelligence is derived from HTTP request metadata that + reaches your server. It does not require the use of a JavaScript + client-side agent or mobile SDKs to collect device context. + + + The API is fast, with average response times of less than 30ms, making + it a great fit for edge, pre-origin or middleware contexts. The API is + platform-agnostic and can be used with different CDN providers, cloud + platforms, or any server backend. + + + Because this API doesn’t require the use of a client-side device + collection agent, it doesn’t support device identification via + `visitor_id` and a few Smart Signals derived from deep device telemetry. + + + ### Event Retrieval + + + Events created by the Automation Intelligence API can be fetched via the + [`/v4/events/{event_id}`](https://docs.fingerprint.com/reference/server-api-get-event) + API using the `event_id` present in the API response. + + + Fetch all Automation Intelligence API events via the + [`/v4/events?source=edge`](https://docs.fingerprint.com/reference/server-api-search-events#parameter-source) + API. + requestBody: + required: true + content: + application/json: + schema: + $ref: '#/components/schemas/EdgeRequest' + responses: + '200': + description: OK. + content: + application/json: + schema: + $ref: '#/components/schemas/EventEdge' + '400': + description: Bad request. The request payload is not valid. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: Forbidden. Access to this API is denied. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '413': + description: Bad request. The request payload is too large. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '429': + description: Too Many Requests. The request is throttled. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '500': + description: Workspace error. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' /events/{event_id}: get: tags: @@ -44,12 +135,15 @@ paths: operationId: getEvent summary: Get an event by event ID description: > - Get a detailed analysis of an individual identification event, including - Smart Signals. + Get a detailed analysis of an individual event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. + + + Returns `EventDevice` when `source` is `device`, and `EventEdge` when + `source` is `edge`. parameters: - name: event_id in: path @@ -61,7 +155,7 @@ paths: example: 1708102555327.NLOjmg description: >- The unique - [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) + [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id) of each identification request (`requestId` can be used in its place). - name: ruleset_id @@ -165,7 +259,7 @@ paths: example: 1708102555327.NLOjmg description: >- The unique event - [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). + [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). requestBody: required: true content: @@ -317,7 +411,7 @@ paths: example: Ibk1527CUFmcnjLwIs4A9 description: > Unique [visitor - identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) + identifier](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. @@ -492,7 +586,7 @@ paths: You can use [linked - Ids](https://docs.fingerprint.com/reference/js-agent-v4-get-function#linkedid) + Ids](https://docs.fingerprint.com/reference/js-agent-get-function#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 @@ -940,6 +1034,18 @@ paths: > Note: When using this parameter, only events with the `simulator` property set to `true` or `false` are returned. Events without a `simulator` Smart Signal result are left out of the response. + - name: active_call + in: query + schema: + type: boolean + description: > + Filter events by Active Call Detection result on mobile devices. + + + > Note: When using this parameter, only events with the + `active_call` property set to `true` or `false` are returned. Events + without an `active_call` Smart Signal result are left out of the + response. - name: source in: query required: false @@ -963,18 +1069,6 @@ paths: > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. - - name: active_call - in: query - schema: - type: boolean - description: > - Filter events by Active Call Detection result on mobile devices. - - - > Note: When using this parameter, only events with the - `active_call` property set to `true` or `false` are returned. Events - without an `active_call` Smart Signal result are left out of the - response. responses: '200': description: Events matching the filter(s). @@ -1110,7 +1204,7 @@ paths: example: Ibk1527CUFmcnjLwIs4A9 description: >- The [visitor - ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) + ID](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) you want to delete. responses: '200': @@ -1163,6 +1257,127 @@ components: identification request or updated later. additionalProperties: true required: [] + EdgeRequest: + type: object + description: >- + HTTP request metadata (including the HTTP method, headers and IP + address) sent by you (your server) to the Fingerprint API for IP and bot + analysis. To improve accuracy, retain as much of the original semantics + of the HTTP request as possible. For example, preserve the order of the + request headers and their capitalization. + + At least one of `ipv4_address` or `ipv6_address` must be provided; a + request with neither is rejected with a `400` error. If both IPv4 and + IPv6 are provided, IP intelligence will be provided for each address. If + an IPv4-mapped IPv6 address is provided in the `ipv6_address` request + property, the IP intelligence will be provided in the `ipv4_address` + property of the response. + required: + - headers + - method + - url + properties: + headers: + type: array + description: > + Ordered header entries from the request made to your server. Each + entry represents one header line. If one header name appears as + multiple lines, send each as a separate item in the array. + + + Headers that contain authentication or session data must still be + included, but with with their value set to an empty string. This + includes headers like `Authorization` and `Cookie`, but may contain + more depending on your specific project, for instance + `Proxy-Authenticate` or `X-Api-Key`. Omitting the headers entirely + changes the shape of the request and can affect detection. Never + forward the real secret values. + + + Whenever possible, we recommend preserving header order and + capitalization to provide the best accuracy, however it’s not a + strict requirement if your runtime does not maintain http header + order or canonicalizes header names. + minItems: 1 + items: + type: object + required: + - name + - value + properties: + name: + type: string + examples: + - User-Agent + description: >- + Header name as forwarded by your server. Headers must be valid + according to RFC 7230 and will be canonicalized according to + RFC 9112. + value: + type: string + examples: + - Mozilla/5.0 + description: >- + Value of a single forwarded header entry. Be careful to + preserve the original encoding and escaping. For example, do + not double escape quotes. + examples: + - - name: Host + value: example.com + - name: User-Agent + value: Mozilla/5.0 + - name: Accept-Language + value: en-US,en;q=0.9 + - - name: Host + value: example.com + - name: User-Agent + value: Mozilla/5.0 + - name: Accept-Encoding + value: gzip + - name: Accept-Encoding + value: deflate + method: + type: string + description: >- + The original HTTP method of the request. If supported in your + runtime, preserve the original casing. + examples: + - GET + - POST + - PUT + - PATCH + - DELETE + url: + type: string + description: >- + Absolute URL of the request, without a \#fragment suffix. Only HTTP + and HTTPS schemes are supported. + format: uri + examples: + - http://example.com + - https://example.com/checkout?method=card + ipv4_address: + type: string + description: Client IPv4 address observed by your server. + format: ipv4 + examples: + - 34.162.244.71 + - 3.208.0.3 + - 173.56.0.4 + ipv6_address: + type: string + description: Client IPv6 address observed by your server. + format: ipv6 + examples: + - 2001:4860:4801:10::1 + - 2600:1f42:abcd:5678:9876:fedc:1357:2468 + - 2001:4868:85f:1a2b:3c4d:5e6f:7890:abcd + - ::ffff:22a2:f447 + - ::ffff:34.162.244.71 + linked_id: + $ref: '#/components/schemas/LinkedId' + tags: + $ref: '#/components/schemas/Tags' EventId: type: string examples: @@ -1176,19 +1391,6 @@ components: format: int64 examples: - 1708102555327 - EventSource: - type: string - description: > - Identifies how the event was generated. - - - `device` - the event was generated by the JS agent or a mobile SDK - running on an end-user device. - - - `edge` - the event was generated by the Automation Intelligence API - (`/edge` endpoint), analyzing a request intercepted at the edge. - enum: - - device - - edge Url: type: string examples: @@ -1596,6 +1798,109 @@ components: description: > `true` if the request came from a device running a VPN, `false` otherwise. + EventSource: + type: string + description: > + Identifies how the event was generated. + + - `device` - the event was generated by the JS agent or a mobile SDK + running on an end-user device. + + - `edge` - the event was generated by the Automation Intelligence API + (`/edge` endpoint), analyzing a request intercepted at the edge. + enum: + - device + - edge + EventEdge: + type: object + description: > + IP and bot analysis for an event generated by the Automation + Intelligence API (`/edge` endpoint). No client-side collection agent is + involved, so Identification (`visitor_id`) and device-telemetry-derived + Smart Signals are not available. + properties: + event_id: + $ref: '#/components/schemas/EventId' + x-platforms: + - android + - ios + - browser + timestamp: + $ref: '#/components/schemas/Timestamp' + x-platforms: + - android + - ios + - browser + linked_id: + $ref: '#/components/schemas/LinkedId' + x-platforms: + - android + - ios + - browser + tags: + $ref: '#/components/schemas/Tags' + x-platforms: + - android + - ios + - browser + url: + $ref: '#/components/schemas/Url' + x-platforms: + - browser + bot_info: + $ref: '#/components/schemas/BotInfo' + x-platforms: + - browser + ip_info: + $ref: '#/components/schemas/IPInfo' + x-platforms: + - android + - ios + - browser + proxy: + $ref: '#/components/schemas/Proxy' + x-platforms: + - android + - ios + - browser + proxy_confidence: + $ref: '#/components/schemas/ProxyConfidence' + x-platforms: + - android + - ios + - browser + proxy_details: + $ref: '#/components/schemas/ProxyDetails' + x-platforms: + - android + - ios + - browser + vpn: + $ref: '#/components/schemas/Vpn' + x-platforms: + - android + - ios + - browser + vpn_confidence: + $ref: '#/components/schemas/VpnConfidence' + x-platforms: + - android + - ios + - browser + vpn_methods: + $ref: '#/components/schemas/VpnMethods' + x-platforms: + - android + - ios + - browser + source: + $ref: '#/components/schemas/EventSource' + const: edge + required: + - event_id + - timestamp + - source + - ip_info ErrorCode: type: string enum: @@ -1715,7 +2020,7 @@ components: description: >- Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event - endpoint](https://docs.fingerprint.com/reference/server-api-v4-update-event). + endpoint](https://docs.fingerprint.com/reference/server-api-update-event). Integration: type: object required: [] @@ -3082,18 +3387,13 @@ components: case. This field is in the beta phase and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). - Event: + EventDevice: type: object - description: >- - Contains results from Fingerprint Identification and all active Smart - Signals. Some Smart Signals are only supported for certain device types, - these fields will be omitted for events not generated from the supported - devices. Consult the [Smart Signals + description: > + Contains results from Fingerprint Identification and Smart Signals + derived from client-side device telemetry. Consult the [Smart Signals reference](https://docs.fingerprint.com/docs/smart-signals-reference) for more details. - required: - - event_id - - timestamp properties: event_id: $ref: '#/components/schemas/EventId' @@ -3107,22 +3407,79 @@ components: - android - ios - browser - source: - $ref: '#/components/schemas/EventSource' + linked_id: + $ref: '#/components/schemas/LinkedId' x-platforms: - android - ios - browser - incremental_identification_status: - $ref: '#/components/schemas/IncrementalIdentificationStatus' + tags: + $ref: '#/components/schemas/Tags' x-platforms: + - android + - ios - browser - linked_id: - $ref: '#/components/schemas/LinkedId' + url: + $ref: '#/components/schemas/Url' + x-platforms: + - browser + bot_info: + $ref: '#/components/schemas/BotInfo' + x-platforms: + - browser + ip_info: + $ref: '#/components/schemas/IPInfo' + x-platforms: + - android + - ios + - browser + proxy: + $ref: '#/components/schemas/Proxy' + x-platforms: + - android + - ios + - browser + proxy_confidence: + $ref: '#/components/schemas/ProxyConfidence' + x-platforms: + - android + - ios + - browser + proxy_details: + $ref: '#/components/schemas/ProxyDetails' + x-platforms: + - android + - ios + - browser + vpn: + $ref: '#/components/schemas/Vpn' x-platforms: - android - ios - browser + vpn_confidence: + $ref: '#/components/schemas/VpnConfidence' + x-platforms: + - android + - ios + - browser + vpn_methods: + $ref: '#/components/schemas/VpnMethods' + x-platforms: + - android + - ios + - browser + source: + $ref: '#/components/schemas/EventSource' + const: device + x-platforms: + - android + - ios + - browser + incremental_identification_status: + $ref: '#/components/schemas/IncrementalIdentificationStatus' + x-platforms: + - browser environment_id: $ref: '#/components/schemas/EnvironmentId' x-platforms: @@ -3159,16 +3516,6 @@ components: - android - ios - browser - tags: - $ref: '#/components/schemas/Tags' - x-platforms: - - android - - ios - - browser - url: - $ref: '#/components/schemas/Url' - x-platforms: - - browser bundle_id: $ref: '#/components/schemas/BundleId' x-platforms: @@ -3234,10 +3581,6 @@ components: $ref: '#/components/schemas/BotType' x-platforms: - browser - bot_info: - $ref: '#/components/schemas/BotInfo' - x-platforms: - - browser cloned_app: $ref: '#/components/schemas/ClonedApp' x-platforms: @@ -3268,30 +3611,6 @@ components: - android - ios - browser - ip_info: - $ref: '#/components/schemas/IPInfo' - x-platforms: - - android - - ios - - browser - proxy: - $ref: '#/components/schemas/Proxy' - x-platforms: - - android - - ios - - browser - proxy_confidence: - $ref: '#/components/schemas/ProxyConfidence' - x-platforms: - - android - - ios - - browser - proxy_details: - $ref: '#/components/schemas/ProxyDetails' - x-platforms: - - android - - ios - - browser proxy_ml_score: $ref: '#/components/schemas/ProxyMLScore' x-platforms: @@ -3372,18 +3691,6 @@ components: $ref: '#/components/schemas/VirtualMachineMLScore' x-platforms: - browser - vpn: - $ref: '#/components/schemas/Vpn' - x-platforms: - - android - - ios - - browser - vpn_confidence: - $ref: '#/components/schemas/VpnConfidence' - x-platforms: - - android - - ios - - browser vpn_ml_score: $ref: '#/components/schemas/VpnMLScore' x-platforms: @@ -3399,12 +3706,6 @@ components: x-platforms: - android - ios - vpn_methods: - $ref: '#/components/schemas/VpnMethods' - x-platforms: - - android - - ios - - browser high_activity_device: $ref: '#/components/schemas/HighActivity' x-platforms: @@ -3431,6 +3732,32 @@ components: - browser - ios - android + required: + - event_id + - timestamp + - source + Event: + type: object + description: > + An identification event (`source: device`) or an Automation Intelligence + event (`source: edge`). + + + Use `source` to tell them apart. Device events include Identification + and device-derived Smart Signals. Edge events do not. + + + Consult the [Smart Signals + reference](https://docs.fingerprint.com/docs/smart-signals-reference) + for more details. + oneOf: + - $ref: '#/components/schemas/EventDevice' + - $ref: '#/components/schemas/EventEdge' + discriminator: + propertyName: source + mapping: + device: '#/components/schemas/EventDevice' + edge: '#/components/schemas/EventEdge' EventUpdate: type: object required: [] diff --git a/scripts/generate.sh b/scripts/generate.sh index b92fdf452..1469d5ed2 100755 --- a/scripts/generate.sh +++ b/scripts/generate.sh @@ -84,6 +84,30 @@ sed_in_place "s|new ${NS}${NS}SearchEventsVpnConfidence()|${NS}SearchEventsVpnCo API_FILE="src/Api/FingerprintApi.php" sed_in_place 's/@param int|null \$limit/@param int \$limit/' "$API_FILE" +# Event constructor: hydrate omit/empty source; do not write the model name into source. +EVENT_FILE="src/Model/Event.php" +python3 - <<'PY' +from pathlib import Path +p = Path("src/Model/Event.php") +text = p.read_text() +old = """ public function __construct(?array $data = null) + { +""" +new = """ public function __construct(?array $data = null) + { + $data = ObjectSerializer::hydrateEmptyEventSource($data); +""" +if old not in text: + raise SystemExit("Event constructor not found") +text = text.replace(old, new, 1) +text = text.replace( + " // Initialize discriminator property with the model name.\n $this->container['source'] = static::$openAPIModelName;\n", + "", + 1, +) +p.write_text(text) +PY + # Format generated code "$(dirname "${BASH_SOURCE[0]}")/php-cs-fixer.sh" diff --git a/src/Api/FingerprintApi.php b/src/Api/FingerprintApi.php index 45c127c04..b7b250416 100644 --- a/src/Api/FingerprintApi.php +++ b/src/Api/FingerprintApi.php @@ -34,7 +34,9 @@ use Fingerprint\ServerSdk\Model\BotInfoCategory; use Fingerprint\ServerSdk\Model\BotInfoConfidence; use Fingerprint\ServerSdk\Model\BotInfoIdentity; +use Fingerprint\ServerSdk\Model\EdgeRequest; use Fingerprint\ServerSdk\Model\Event; +use Fingerprint\ServerSdk\Model\EventEdge; use Fingerprint\ServerSdk\Model\EventSearch; use Fingerprint\ServerSdk\Model\EventUpdate; use Fingerprint\ServerSdk\Model\SearchEventsBot; @@ -105,12 +107,219 @@ public function getConfig(): Configuration return $this->config; } + /** + * Operation analyzeRequestForAutomationIntelligence. + * + * Collect Automation Intelligence. + * + * @param EdgeRequest $edge_request edge_request (required) + * + * @noinspection GrazieInspection + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @throws GuzzleException + * @throws \DateMalformedStringException + */ + public function analyzeRequestForAutomationIntelligence(EdgeRequest $edge_request): EventEdge + { + list($response) = $this->analyzeRequestForAutomationIntelligenceWithHttpInfo($edge_request); + + return $response; + } + + /** + * Operation analyzeRequestForAutomationIntelligenceWithHttpInfo. + * + * Collect Automation Intelligence. + * + * @param EdgeRequest $edge_request (required) + * + * @noinspection GrazieInspection + * + * @return array{ EventEdge|null, ResponseInterface } + * + * @throws ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @throws GuzzleException + * @throws \DateMalformedStringException + */ + public function analyzeRequestForAutomationIntelligenceWithHttpInfo(EdgeRequest $edge_request): array + { + $request = $this->analyzeRequestForAutomationIntelligenceRequest($edge_request); + + try { + $options = $this->createHttpClientOption(); + + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse(), + $e + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + $e + ); + } + + $statusCode = $response->getStatusCode(); + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $request->getUri() + ), + $statusCode, + $response + ); + } + + return $this->handleResponseWithDataType( + '\Fingerprint\ServerSdk\Model\EventEdge', + $request, + $response + ); + } catch (ApiException $e) { + $this->handleAnalyzeRequestForAutomationIntelligenceError($e); + } + } + + /** + * Operation analyzeRequestForAutomationIntelligenceAsync. + * + * Collect Automation Intelligence. + * + * @param EdgeRequest $edge_request (required) + * + * @noinspection GrazieInspection + * + * @return PromiseInterface promise resolving to the deserialized response + * + * @throws \InvalidArgumentException + */ + public function analyzeRequestForAutomationIntelligenceAsync(EdgeRequest $edge_request): PromiseInterface + { + return $this->analyzeRequestForAutomationIntelligenceAsyncWithHttpInfo($edge_request) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation analyzeRequestForAutomationIntelligenceAsyncWithHttpInfo. + * + * Collect Automation Intelligence. + * + * @param EdgeRequest $edge_request (required) + * + * @noinspection GrazieInspection + * + * @return PromiseInterface promise resolving to an array of deserialized data and the HTTP response + * + * @throws \InvalidArgumentException + */ + public function analyzeRequestForAutomationIntelligenceAsyncWithHttpInfo(EdgeRequest $edge_request): PromiseInterface + { + $request = $this->analyzeRequestForAutomationIntelligenceRequest($edge_request); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) { + $content = (string) $response->getBody(); + $response->getBody()->rewind(); + + return [ + ObjectSerializer::deserialize($content, '\Fingerprint\ServerSdk\Model\EventEdge'), + $response, + ]; + }, + function ($e) { + if ($e instanceof RequestException) { + $e = new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse(), + $e + ); + } elseif ($e instanceof ConnectException) { + $e = new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + $e + ); + } elseif (!$e instanceof ApiException) { + $e = new ApiException( + $e->getMessage(), + (int) $e->getCode(), + null, + $e + ); + } + $this->handleAnalyzeRequestForAutomationIntelligenceError($e); + } + ); + } + + /** + * Create request for operation 'analyzeRequestForAutomationIntelligence'. + * + * @param EdgeRequest $edge_request (required) + * + * @noinspection GrazieInspection + * + * @return Request the prepared HTTP request + * + * @throws \InvalidArgumentException + */ + public function analyzeRequestForAutomationIntelligenceRequest(EdgeRequest $edge_request): Request + { + $resourcePath = '/edge'; + $headers = [ + 'Authorization' => 'Bearer '.$this->config->getApiKey(), + ]; + $queryParams = ['ii' => $this->integration_info]; + $headerParams = []; + + $httpBody = Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($edge_request)); + + if ($this->config->getUserAgent()) { + $headers['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $headerParams, + $headers + ); + + $query = ObjectSerializer::buildQuery($queryParams); + + return new Request( + 'POST', + $this->config->getHost().$resourcePath.($query ? "?$query" : ''), + $headers, + $httpBody + ); + } + /** * Operation deleteVisitorData. * * Delete a visitor ID * - * @param string $visitor_id The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. (required) + * @param string $visitor_id The [visitor ID](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) you want to delete. (required) * * @noinspection GrazieInspection * @@ -129,7 +338,7 @@ public function deleteVisitorData(string $visitor_id): void * * Delete a visitor ID * - * @param string $visitor_id The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. (required) + * @param string $visitor_id The [visitor ID](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) you want to delete. (required) * * @noinspection GrazieInspection * @@ -190,7 +399,7 @@ public function deleteVisitorDataWithHttpInfo(string $visitor_id): array * * Delete a visitor ID * - * @param string $visitor_id The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. (required) + * @param string $visitor_id The [visitor ID](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) you want to delete. (required) * * @noinspection GrazieInspection * @@ -213,7 +422,7 @@ function ($response) { * * Delete a visitor ID * - * @param string $visitor_id The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. (required) + * @param string $visitor_id The [visitor ID](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) you want to delete. (required) * * @noinspection GrazieInspection * @@ -262,7 +471,7 @@ function ($e) { /** * Create request for operation 'deleteVisitorData'. * - * @param string $visitor_id The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. (required) + * @param string $visitor_id The [visitor ID](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) you want to delete. (required) * * @noinspection GrazieInspection * @@ -309,7 +518,7 @@ public function deleteVisitorDataRequest(string $visitor_id): Request * * Get an event by event ID * - * @param string $event_id The unique [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) of each identification request (`requestId` can be used in its place). (required) + * @param string $event_id The unique [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id) of each identification request (`requestId` can be used in its place). (required) * @param string|null $ruleset_id The ID of the ruleset to evaluate against the event, producing the action to take for this event. The resulting action is returned in the `rule_action` attribute of the response. (optional) * * @noinspection GrazieInspection @@ -321,6 +530,8 @@ public function deleteVisitorDataRequest(string $visitor_id): Request */ public function getEvent(string $event_id, ?string $ruleset_id = null): Event { + // SPIKE INTER-2457 — Return type is still the flat Event class. + // `$api->getEvent($id)->getIdentification()` keeps working (discriminator is inert). list($response) = $this->getEventWithHttpInfo($event_id, $ruleset_id); return $response; @@ -331,7 +542,7 @@ public function getEvent(string $event_id, ?string $ruleset_id = null): Event * * Get an event by event ID * - * @param string $event_id The unique [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) of each identification request (`requestId` can be used in its place). (required) + * @param string $event_id The unique [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id) of each identification request (`requestId` can be used in its place). (required) * @param string|null $ruleset_id The ID of the ruleset to evaluate against the event, producing the action to take for this event. The resulting action is returned in the `rule_action` attribute of the response. (optional) * * @noinspection GrazieInspection @@ -397,7 +608,7 @@ public function getEventWithHttpInfo(string $event_id, ?string $ruleset_id = nul * * Get an event by event ID * - * @param string $event_id The unique [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) of each identification request (`requestId` can be used in its place). (required) + * @param string $event_id The unique [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id) of each identification request (`requestId` can be used in its place). (required) * @param string|null $ruleset_id The ID of the ruleset to evaluate against the event, producing the action to take for this event. The resulting action is returned in the `rule_action` attribute of the response. (optional) * * @noinspection GrazieInspection @@ -421,7 +632,7 @@ function ($response) { * * Get an event by event ID * - * @param string $event_id The unique [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) of each identification request (`requestId` can be used in its place). (required) + * @param string $event_id The unique [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id) of each identification request (`requestId` can be used in its place). (required) * @param string|null $ruleset_id The ID of the ruleset to evaluate against the event, producing the action to take for this event. The resulting action is returned in the `rule_action` attribute of the response. (optional) * * @noinspection GrazieInspection @@ -477,7 +688,7 @@ function ($e) { /** * Create request for operation 'getEvent'. * - * @param string $event_id The unique [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) of each identification request (`requestId` can be used in its place). (required) + * @param string $event_id The unique [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id) of each identification request (`requestId` can be used in its place). (required) * @param string|null $ruleset_id The ID of the ruleset to evaluate against the event, producing the action to take for this event. The resulting action is returned in the `rule_action` attribute of the response. (optional) * * @noinspection GrazieInspection @@ -537,7 +748,7 @@ public function getEventRequest(string $event_id, ?string $ruleset_id = null): R * * @param int $limit Maximum number of events to return. Defaults to 10 when omitted. Results are selected from the time range (`start`, `end`), ordered by `reverse`, then truncated to provided `limit` size. So `reverse=true` returns the oldest N=`limit` events, otherwise the newest N=`limit` events. (optional) * @param string|null $pagination_key Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The pagination key is an arbitrary string that should not be interpreted in any way and should be passed as-is. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 100 events: `GET api-base-url/events?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=S9rgMMUb4z3X5t5pr_tSgoSZlmyF0O8X7kCV2m981-iY1LmRTjraa1rTk3L-hQExnDWCi0RA-zAIjaVSTNO2AN2eqQWgzT0RjbieMxRfSdkM-HmOhdOgdQvYfPG3vqU1DJKh4Q` (optional) - * @param string|null $visitor_id Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). (optional) + * @param string|null $visitor_id Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). (optional) * @param string|null $high_recall_id The High Recall ID is a supplementary browser identifier designed for use cases that require wider coverage over precision. Compared to the standard visitor ID, the High Recall ID strives to match incoming browsers more generously (rather than precisely) with existing browsers and thus identifies fewer browsers as new. The High Recall ID is best suited for use cases that are sensitive to browsers being identified as new and where mismatched browsers are not detrimental. Filter events by matching High Recall ID (`supplementary_id_high_recall.visitor_id` property). (optional) * @param SearchEventsBot|null $bot Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. (optional) * @param SearchEventsBotInfo|null $bot_info Filter events by their Bot Info result, specifically: - `all` - events where any kind of bot was detected. - `none` - events where no bot was detected, and no `bot_info` was present. (optional) @@ -548,7 +759,7 @@ public function getEventRequest(string $event_id, ?string $ruleset_id = null): R * @param string[]|null $bot_info_name Filter events by their Bot Info Name. The name must match exactly, partial or wildcard matching is not supported. Multiple Names can be provided using the repeated keys syntax. For example, `bot_info_name=ChatGPT%20Agent&bot_info_name=Bedrock%20AgentCore`, will match events with a Bot Info Name of `ChatGPT Agent` or `Bedrock AgentCore`. Other notations like comma-separated or bracket notation are not supported. (optional) * @param string|null $ip_address Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 (optional) * @param string|null $asn Filter events by the ASN associated with the event's IP address. This corresponds to the `ip_info.(v4|v6).asn` property in the response. (optional) - * @param string|null $linked_id Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-v4-get-function#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 string|null $linked_id Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-get-function#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 string|null $url Filter events by the URL (`url` property) associated with the event. (optional) * @param string|null $bundle_id Filter events by the Bundle ID (iOS) associated with the event. (optional) * @param string|null $package_name Filter events by the Package Name (Android) associated with the event. (optional) @@ -585,8 +796,8 @@ public function getEventRequest(string $event_id, ?string $ruleset_id = null): R * @param bool|null $tor_node Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. (optional) * @param SearchEventsIncrementalIdentificationStatus|null $incremental_identification_status Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response. (optional) * @param bool|null $simulator Filter events by iOS Simulator Detection result. > Note: When using this parameter, only events with the `simulator` property set to `true` or `false` are returned. Events without a `simulator` Smart Signal result are left out of the response. (optional) - * @param SearchEventsSource[]|null $source Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. (optional) * @param bool|null $active_call Filter events by Active Call Detection result on mobile devices. > Note: When using this parameter, only events with the `active_call` property set to `true` or `false` are returned. Events without an `active_call` Smart Signal result are left out of the response. (optional) + * @param SearchEventsSource[]|null $source Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. (optional) * * @noinspection GrazieInspection * @@ -595,9 +806,9 @@ public function getEventRequest(string $event_id, ?string $ruleset_id = null): R * @throws GuzzleException * @throws \DateMalformedStringException */ - public function searchEvents(?int $limit = null, ?string $pagination_key = null, ?string $visitor_id = null, ?string $high_recall_id = null, ?SearchEventsBot $bot = null, ?SearchEventsBotInfo $bot_info = null, ?array $bot_info_category = null, ?array $bot_info_identity = null, ?array $bot_info_confidence = null, ?array $bot_info_provider = null, ?array $bot_info_name = null, ?string $ip_address = null, ?string $asn = null, ?string $linked_id = null, ?string $url = null, ?string $bundle_id = null, ?string $package_name = null, ?string $origin = null, \DateTime|int|null $start = null, \DateTime|int|null $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?SearchEventsVpnConfidence $vpn_confidence = null, ?float $min_suspect_score = null, ?bool $developer_tools = null, ?bool $location_spoofing = null, ?bool $mitm_attack = null, ?bool $rare_device = null, ?SearchEventsRareDevicePercentileBucket $rare_device_percentile_bucket = null, ?bool $proxy = null, ?string $sdk_version = null, ?SearchEventsSdkPlatform $sdk_platform = null, ?array $environment = null, ?string $proximity_id = null, ?int $total_hits = null, ?bool $tor_node = null, ?SearchEventsIncrementalIdentificationStatus $incremental_identification_status = null, ?bool $simulator = null, ?array $source = null, ?bool $active_call = null): EventSearch + public function searchEvents(?int $limit = null, ?string $pagination_key = null, ?string $visitor_id = null, ?string $high_recall_id = null, ?SearchEventsBot $bot = null, ?SearchEventsBotInfo $bot_info = null, ?array $bot_info_category = null, ?array $bot_info_identity = null, ?array $bot_info_confidence = null, ?array $bot_info_provider = null, ?array $bot_info_name = null, ?string $ip_address = null, ?string $asn = null, ?string $linked_id = null, ?string $url = null, ?string $bundle_id = null, ?string $package_name = null, ?string $origin = null, \DateTime|int|null $start = null, \DateTime|int|null $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?SearchEventsVpnConfidence $vpn_confidence = null, ?float $min_suspect_score = null, ?bool $developer_tools = null, ?bool $location_spoofing = null, ?bool $mitm_attack = null, ?bool $rare_device = null, ?SearchEventsRareDevicePercentileBucket $rare_device_percentile_bucket = null, ?bool $proxy = null, ?string $sdk_version = null, ?SearchEventsSdkPlatform $sdk_platform = null, ?array $environment = null, ?string $proximity_id = null, ?int $total_hits = null, ?bool $tor_node = null, ?SearchEventsIncrementalIdentificationStatus $incremental_identification_status = null, ?bool $simulator = null, ?bool $active_call = null, ?array $source = null): EventSearch { - list($response) = $this->searchEventsWithHttpInfo($limit, $pagination_key, $visitor_id, $high_recall_id, $bot, $bot_info, $bot_info_category, $bot_info_identity, $bot_info_confidence, $bot_info_provider, $bot_info_name, $ip_address, $asn, $linked_id, $url, $bundle_id, $package_name, $origin, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $developer_tools, $location_spoofing, $mitm_attack, $rare_device, $rare_device_percentile_bucket, $proxy, $sdk_version, $sdk_platform, $environment, $proximity_id, $total_hits, $tor_node, $incremental_identification_status, $simulator, $source, $active_call); + list($response) = $this->searchEventsWithHttpInfo($limit, $pagination_key, $visitor_id, $high_recall_id, $bot, $bot_info, $bot_info_category, $bot_info_identity, $bot_info_confidence, $bot_info_provider, $bot_info_name, $ip_address, $asn, $linked_id, $url, $bundle_id, $package_name, $origin, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $developer_tools, $location_spoofing, $mitm_attack, $rare_device, $rare_device_percentile_bucket, $proxy, $sdk_version, $sdk_platform, $environment, $proximity_id, $total_hits, $tor_node, $incremental_identification_status, $simulator, $active_call, $source); return $response; } @@ -609,7 +820,7 @@ public function searchEvents(?int $limit = null, ?string $pagination_key = null, * * @param int $limit Maximum number of events to return. Defaults to 10 when omitted. Results are selected from the time range (`start`, `end`), ordered by `reverse`, then truncated to provided `limit` size. So `reverse=true` returns the oldest N=`limit` events, otherwise the newest N=`limit` events. (optional) * @param string|null $pagination_key Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The pagination key is an arbitrary string that should not be interpreted in any way and should be passed as-is. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 100 events: `GET api-base-url/events?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=S9rgMMUb4z3X5t5pr_tSgoSZlmyF0O8X7kCV2m981-iY1LmRTjraa1rTk3L-hQExnDWCi0RA-zAIjaVSTNO2AN2eqQWgzT0RjbieMxRfSdkM-HmOhdOgdQvYfPG3vqU1DJKh4Q` (optional) - * @param string|null $visitor_id Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). (optional) + * @param string|null $visitor_id Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). (optional) * @param string|null $high_recall_id The High Recall ID is a supplementary browser identifier designed for use cases that require wider coverage over precision. Compared to the standard visitor ID, the High Recall ID strives to match incoming browsers more generously (rather than precisely) with existing browsers and thus identifies fewer browsers as new. The High Recall ID is best suited for use cases that are sensitive to browsers being identified as new and where mismatched browsers are not detrimental. Filter events by matching High Recall ID (`supplementary_id_high_recall.visitor_id` property). (optional) * @param SearchEventsBot|null $bot Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. (optional) * @param SearchEventsBotInfo|null $bot_info Filter events by their Bot Info result, specifically: - `all` - events where any kind of bot was detected. - `none` - events where no bot was detected, and no `bot_info` was present. (optional) @@ -620,7 +831,7 @@ public function searchEvents(?int $limit = null, ?string $pagination_key = null, * @param string[]|null $bot_info_name Filter events by their Bot Info Name. The name must match exactly, partial or wildcard matching is not supported. Multiple Names can be provided using the repeated keys syntax. For example, `bot_info_name=ChatGPT%20Agent&bot_info_name=Bedrock%20AgentCore`, will match events with a Bot Info Name of `ChatGPT Agent` or `Bedrock AgentCore`. Other notations like comma-separated or bracket notation are not supported. (optional) * @param string|null $ip_address Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 (optional) * @param string|null $asn Filter events by the ASN associated with the event's IP address. This corresponds to the `ip_info.(v4|v6).asn` property in the response. (optional) - * @param string|null $linked_id Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-v4-get-function#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 string|null $linked_id Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-get-function#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 string|null $url Filter events by the URL (`url` property) associated with the event. (optional) * @param string|null $bundle_id Filter events by the Bundle ID (iOS) associated with the event. (optional) * @param string|null $package_name Filter events by the Package Name (Android) associated with the event. (optional) @@ -657,8 +868,8 @@ public function searchEvents(?int $limit = null, ?string $pagination_key = null, * @param bool|null $tor_node Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. (optional) * @param SearchEventsIncrementalIdentificationStatus|null $incremental_identification_status Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response. (optional) * @param bool|null $simulator Filter events by iOS Simulator Detection result. > Note: When using this parameter, only events with the `simulator` property set to `true` or `false` are returned. Events without a `simulator` Smart Signal result are left out of the response. (optional) - * @param SearchEventsSource[]|null $source Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. (optional) * @param bool|null $active_call Filter events by Active Call Detection result on mobile devices. > Note: When using this parameter, only events with the `active_call` property set to `true` or `false` are returned. Events without an `active_call` Smart Signal result are left out of the response. (optional) + * @param SearchEventsSource[]|null $source Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. (optional) * * @noinspection GrazieInspection * @@ -669,9 +880,9 @@ public function searchEvents(?int $limit = null, ?string $pagination_key = null, * @throws GuzzleException * @throws \DateMalformedStringException */ - public function searchEventsWithHttpInfo(?int $limit = null, ?string $pagination_key = null, ?string $visitor_id = null, ?string $high_recall_id = null, ?SearchEventsBot $bot = null, ?SearchEventsBotInfo $bot_info = null, ?array $bot_info_category = null, ?array $bot_info_identity = null, ?array $bot_info_confidence = null, ?array $bot_info_provider = null, ?array $bot_info_name = null, ?string $ip_address = null, ?string $asn = null, ?string $linked_id = null, ?string $url = null, ?string $bundle_id = null, ?string $package_name = null, ?string $origin = null, \DateTime|int|null $start = null, \DateTime|int|null $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?SearchEventsVpnConfidence $vpn_confidence = null, ?float $min_suspect_score = null, ?bool $developer_tools = null, ?bool $location_spoofing = null, ?bool $mitm_attack = null, ?bool $rare_device = null, ?SearchEventsRareDevicePercentileBucket $rare_device_percentile_bucket = null, ?bool $proxy = null, ?string $sdk_version = null, ?SearchEventsSdkPlatform $sdk_platform = null, ?array $environment = null, ?string $proximity_id = null, ?int $total_hits = null, ?bool $tor_node = null, ?SearchEventsIncrementalIdentificationStatus $incremental_identification_status = null, ?bool $simulator = null, ?array $source = null, ?bool $active_call = null): array + public function searchEventsWithHttpInfo(?int $limit = null, ?string $pagination_key = null, ?string $visitor_id = null, ?string $high_recall_id = null, ?SearchEventsBot $bot = null, ?SearchEventsBotInfo $bot_info = null, ?array $bot_info_category = null, ?array $bot_info_identity = null, ?array $bot_info_confidence = null, ?array $bot_info_provider = null, ?array $bot_info_name = null, ?string $ip_address = null, ?string $asn = null, ?string $linked_id = null, ?string $url = null, ?string $bundle_id = null, ?string $package_name = null, ?string $origin = null, \DateTime|int|null $start = null, \DateTime|int|null $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?SearchEventsVpnConfidence $vpn_confidence = null, ?float $min_suspect_score = null, ?bool $developer_tools = null, ?bool $location_spoofing = null, ?bool $mitm_attack = null, ?bool $rare_device = null, ?SearchEventsRareDevicePercentileBucket $rare_device_percentile_bucket = null, ?bool $proxy = null, ?string $sdk_version = null, ?SearchEventsSdkPlatform $sdk_platform = null, ?array $environment = null, ?string $proximity_id = null, ?int $total_hits = null, ?bool $tor_node = null, ?SearchEventsIncrementalIdentificationStatus $incremental_identification_status = null, ?bool $simulator = null, ?bool $active_call = null, ?array $source = null): array { - $request = $this->searchEventsRequest($limit, $pagination_key, $visitor_id, $high_recall_id, $bot, $bot_info, $bot_info_category, $bot_info_identity, $bot_info_confidence, $bot_info_provider, $bot_info_name, $ip_address, $asn, $linked_id, $url, $bundle_id, $package_name, $origin, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $developer_tools, $location_spoofing, $mitm_attack, $rare_device, $rare_device_percentile_bucket, $proxy, $sdk_version, $sdk_platform, $environment, $proximity_id, $total_hits, $tor_node, $incremental_identification_status, $simulator, $source, $active_call); + $request = $this->searchEventsRequest($limit, $pagination_key, $visitor_id, $high_recall_id, $bot, $bot_info, $bot_info_category, $bot_info_identity, $bot_info_confidence, $bot_info_provider, $bot_info_name, $ip_address, $asn, $linked_id, $url, $bundle_id, $package_name, $origin, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $developer_tools, $location_spoofing, $mitm_attack, $rare_device, $rare_device_percentile_bucket, $proxy, $sdk_version, $sdk_platform, $environment, $proximity_id, $total_hits, $tor_node, $incremental_identification_status, $simulator, $active_call, $source); try { $options = $this->createHttpClientOption(); @@ -725,7 +936,7 @@ public function searchEventsWithHttpInfo(?int $limit = null, ?string $pagination * * @param int $limit Maximum number of events to return. Defaults to 10 when omitted. Results are selected from the time range (`start`, `end`), ordered by `reverse`, then truncated to provided `limit` size. So `reverse=true` returns the oldest N=`limit` events, otherwise the newest N=`limit` events. (optional) * @param string|null $pagination_key Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The pagination key is an arbitrary string that should not be interpreted in any way and should be passed as-is. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 100 events: `GET api-base-url/events?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=S9rgMMUb4z3X5t5pr_tSgoSZlmyF0O8X7kCV2m981-iY1LmRTjraa1rTk3L-hQExnDWCi0RA-zAIjaVSTNO2AN2eqQWgzT0RjbieMxRfSdkM-HmOhdOgdQvYfPG3vqU1DJKh4Q` (optional) - * @param string|null $visitor_id Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). (optional) + * @param string|null $visitor_id Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). (optional) * @param string|null $high_recall_id The High Recall ID is a supplementary browser identifier designed for use cases that require wider coverage over precision. Compared to the standard visitor ID, the High Recall ID strives to match incoming browsers more generously (rather than precisely) with existing browsers and thus identifies fewer browsers as new. The High Recall ID is best suited for use cases that are sensitive to browsers being identified as new and where mismatched browsers are not detrimental. Filter events by matching High Recall ID (`supplementary_id_high_recall.visitor_id` property). (optional) * @param SearchEventsBot|null $bot Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. (optional) * @param SearchEventsBotInfo|null $bot_info Filter events by their Bot Info result, specifically: - `all` - events where any kind of bot was detected. - `none` - events where no bot was detected, and no `bot_info` was present. (optional) @@ -736,7 +947,7 @@ public function searchEventsWithHttpInfo(?int $limit = null, ?string $pagination * @param string[]|null $bot_info_name Filter events by their Bot Info Name. The name must match exactly, partial or wildcard matching is not supported. Multiple Names can be provided using the repeated keys syntax. For example, `bot_info_name=ChatGPT%20Agent&bot_info_name=Bedrock%20AgentCore`, will match events with a Bot Info Name of `ChatGPT Agent` or `Bedrock AgentCore`. Other notations like comma-separated or bracket notation are not supported. (optional) * @param string|null $ip_address Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 (optional) * @param string|null $asn Filter events by the ASN associated with the event's IP address. This corresponds to the `ip_info.(v4|v6).asn` property in the response. (optional) - * @param string|null $linked_id Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-v4-get-function#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 string|null $linked_id Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-get-function#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 string|null $url Filter events by the URL (`url` property) associated with the event. (optional) * @param string|null $bundle_id Filter events by the Bundle ID (iOS) associated with the event. (optional) * @param string|null $package_name Filter events by the Package Name (Android) associated with the event. (optional) @@ -773,8 +984,8 @@ public function searchEventsWithHttpInfo(?int $limit = null, ?string $pagination * @param bool|null $tor_node Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. (optional) * @param SearchEventsIncrementalIdentificationStatus|null $incremental_identification_status Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response. (optional) * @param bool|null $simulator Filter events by iOS Simulator Detection result. > Note: When using this parameter, only events with the `simulator` property set to `true` or `false` are returned. Events without a `simulator` Smart Signal result are left out of the response. (optional) - * @param SearchEventsSource[]|null $source Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. (optional) * @param bool|null $active_call Filter events by Active Call Detection result on mobile devices. > Note: When using this parameter, only events with the `active_call` property set to `true` or `false` are returned. Events without an `active_call` Smart Signal result are left out of the response. (optional) + * @param SearchEventsSource[]|null $source Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. (optional) * * @noinspection GrazieInspection * @@ -782,9 +993,9 @@ public function searchEventsWithHttpInfo(?int $limit = null, ?string $pagination * * @throws \InvalidArgumentException */ - public function searchEventsAsync(?int $limit = null, ?string $pagination_key = null, ?string $visitor_id = null, ?string $high_recall_id = null, ?SearchEventsBot $bot = null, ?SearchEventsBotInfo $bot_info = null, ?array $bot_info_category = null, ?array $bot_info_identity = null, ?array $bot_info_confidence = null, ?array $bot_info_provider = null, ?array $bot_info_name = null, ?string $ip_address = null, ?string $asn = null, ?string $linked_id = null, ?string $url = null, ?string $bundle_id = null, ?string $package_name = null, ?string $origin = null, \DateTime|int|null $start = null, \DateTime|int|null $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?SearchEventsVpnConfidence $vpn_confidence = null, ?float $min_suspect_score = null, ?bool $developer_tools = null, ?bool $location_spoofing = null, ?bool $mitm_attack = null, ?bool $rare_device = null, ?SearchEventsRareDevicePercentileBucket $rare_device_percentile_bucket = null, ?bool $proxy = null, ?string $sdk_version = null, ?SearchEventsSdkPlatform $sdk_platform = null, ?array $environment = null, ?string $proximity_id = null, ?int $total_hits = null, ?bool $tor_node = null, ?SearchEventsIncrementalIdentificationStatus $incremental_identification_status = null, ?bool $simulator = null, ?array $source = null, ?bool $active_call = null): PromiseInterface + public function searchEventsAsync(?int $limit = null, ?string $pagination_key = null, ?string $visitor_id = null, ?string $high_recall_id = null, ?SearchEventsBot $bot = null, ?SearchEventsBotInfo $bot_info = null, ?array $bot_info_category = null, ?array $bot_info_identity = null, ?array $bot_info_confidence = null, ?array $bot_info_provider = null, ?array $bot_info_name = null, ?string $ip_address = null, ?string $asn = null, ?string $linked_id = null, ?string $url = null, ?string $bundle_id = null, ?string $package_name = null, ?string $origin = null, \DateTime|int|null $start = null, \DateTime|int|null $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?SearchEventsVpnConfidence $vpn_confidence = null, ?float $min_suspect_score = null, ?bool $developer_tools = null, ?bool $location_spoofing = null, ?bool $mitm_attack = null, ?bool $rare_device = null, ?SearchEventsRareDevicePercentileBucket $rare_device_percentile_bucket = null, ?bool $proxy = null, ?string $sdk_version = null, ?SearchEventsSdkPlatform $sdk_platform = null, ?array $environment = null, ?string $proximity_id = null, ?int $total_hits = null, ?bool $tor_node = null, ?SearchEventsIncrementalIdentificationStatus $incremental_identification_status = null, ?bool $simulator = null, ?bool $active_call = null, ?array $source = null): PromiseInterface { - return $this->searchEventsAsyncWithHttpInfo($limit, $pagination_key, $visitor_id, $high_recall_id, $bot, $bot_info, $bot_info_category, $bot_info_identity, $bot_info_confidence, $bot_info_provider, $bot_info_name, $ip_address, $asn, $linked_id, $url, $bundle_id, $package_name, $origin, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $developer_tools, $location_spoofing, $mitm_attack, $rare_device, $rare_device_percentile_bucket, $proxy, $sdk_version, $sdk_platform, $environment, $proximity_id, $total_hits, $tor_node, $incremental_identification_status, $simulator, $source, $active_call) + return $this->searchEventsAsyncWithHttpInfo($limit, $pagination_key, $visitor_id, $high_recall_id, $bot, $bot_info, $bot_info_category, $bot_info_identity, $bot_info_confidence, $bot_info_provider, $bot_info_name, $ip_address, $asn, $linked_id, $url, $bundle_id, $package_name, $origin, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $developer_tools, $location_spoofing, $mitm_attack, $rare_device, $rare_device_percentile_bucket, $proxy, $sdk_version, $sdk_platform, $environment, $proximity_id, $total_hits, $tor_node, $incremental_identification_status, $simulator, $active_call, $source) ->then( function ($response) { return $response[0]; @@ -799,7 +1010,7 @@ function ($response) { * * @param int $limit Maximum number of events to return. Defaults to 10 when omitted. Results are selected from the time range (`start`, `end`), ordered by `reverse`, then truncated to provided `limit` size. So `reverse=true` returns the oldest N=`limit` events, otherwise the newest N=`limit` events. (optional) * @param string|null $pagination_key Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The pagination key is an arbitrary string that should not be interpreted in any way and should be passed as-is. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 100 events: `GET api-base-url/events?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=S9rgMMUb4z3X5t5pr_tSgoSZlmyF0O8X7kCV2m981-iY1LmRTjraa1rTk3L-hQExnDWCi0RA-zAIjaVSTNO2AN2eqQWgzT0RjbieMxRfSdkM-HmOhdOgdQvYfPG3vqU1DJKh4Q` (optional) - * @param string|null $visitor_id Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). (optional) + * @param string|null $visitor_id Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). (optional) * @param string|null $high_recall_id The High Recall ID is a supplementary browser identifier designed for use cases that require wider coverage over precision. Compared to the standard visitor ID, the High Recall ID strives to match incoming browsers more generously (rather than precisely) with existing browsers and thus identifies fewer browsers as new. The High Recall ID is best suited for use cases that are sensitive to browsers being identified as new and where mismatched browsers are not detrimental. Filter events by matching High Recall ID (`supplementary_id_high_recall.visitor_id` property). (optional) * @param SearchEventsBot|null $bot Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. (optional) * @param SearchEventsBotInfo|null $bot_info Filter events by their Bot Info result, specifically: - `all` - events where any kind of bot was detected. - `none` - events where no bot was detected, and no `bot_info` was present. (optional) @@ -810,7 +1021,7 @@ function ($response) { * @param string[]|null $bot_info_name Filter events by their Bot Info Name. The name must match exactly, partial or wildcard matching is not supported. Multiple Names can be provided using the repeated keys syntax. For example, `bot_info_name=ChatGPT%20Agent&bot_info_name=Bedrock%20AgentCore`, will match events with a Bot Info Name of `ChatGPT Agent` or `Bedrock AgentCore`. Other notations like comma-separated or bracket notation are not supported. (optional) * @param string|null $ip_address Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 (optional) * @param string|null $asn Filter events by the ASN associated with the event's IP address. This corresponds to the `ip_info.(v4|v6).asn` property in the response. (optional) - * @param string|null $linked_id Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-v4-get-function#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 string|null $linked_id Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-get-function#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 string|null $url Filter events by the URL (`url` property) associated with the event. (optional) * @param string|null $bundle_id Filter events by the Bundle ID (iOS) associated with the event. (optional) * @param string|null $package_name Filter events by the Package Name (Android) associated with the event. (optional) @@ -847,8 +1058,8 @@ function ($response) { * @param bool|null $tor_node Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. (optional) * @param SearchEventsIncrementalIdentificationStatus|null $incremental_identification_status Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response. (optional) * @param bool|null $simulator Filter events by iOS Simulator Detection result. > Note: When using this parameter, only events with the `simulator` property set to `true` or `false` are returned. Events without a `simulator` Smart Signal result are left out of the response. (optional) - * @param SearchEventsSource[]|null $source Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. (optional) * @param bool|null $active_call Filter events by Active Call Detection result on mobile devices. > Note: When using this parameter, only events with the `active_call` property set to `true` or `false` are returned. Events without an `active_call` Smart Signal result are left out of the response. (optional) + * @param SearchEventsSource[]|null $source Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. (optional) * * @noinspection GrazieInspection * @@ -856,9 +1067,9 @@ function ($response) { * * @throws \InvalidArgumentException */ - public function searchEventsAsyncWithHttpInfo(?int $limit = null, ?string $pagination_key = null, ?string $visitor_id = null, ?string $high_recall_id = null, ?SearchEventsBot $bot = null, ?SearchEventsBotInfo $bot_info = null, ?array $bot_info_category = null, ?array $bot_info_identity = null, ?array $bot_info_confidence = null, ?array $bot_info_provider = null, ?array $bot_info_name = null, ?string $ip_address = null, ?string $asn = null, ?string $linked_id = null, ?string $url = null, ?string $bundle_id = null, ?string $package_name = null, ?string $origin = null, \DateTime|int|null $start = null, \DateTime|int|null $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?SearchEventsVpnConfidence $vpn_confidence = null, ?float $min_suspect_score = null, ?bool $developer_tools = null, ?bool $location_spoofing = null, ?bool $mitm_attack = null, ?bool $rare_device = null, ?SearchEventsRareDevicePercentileBucket $rare_device_percentile_bucket = null, ?bool $proxy = null, ?string $sdk_version = null, ?SearchEventsSdkPlatform $sdk_platform = null, ?array $environment = null, ?string $proximity_id = null, ?int $total_hits = null, ?bool $tor_node = null, ?SearchEventsIncrementalIdentificationStatus $incremental_identification_status = null, ?bool $simulator = null, ?array $source = null, ?bool $active_call = null): PromiseInterface + public function searchEventsAsyncWithHttpInfo(?int $limit = null, ?string $pagination_key = null, ?string $visitor_id = null, ?string $high_recall_id = null, ?SearchEventsBot $bot = null, ?SearchEventsBotInfo $bot_info = null, ?array $bot_info_category = null, ?array $bot_info_identity = null, ?array $bot_info_confidence = null, ?array $bot_info_provider = null, ?array $bot_info_name = null, ?string $ip_address = null, ?string $asn = null, ?string $linked_id = null, ?string $url = null, ?string $bundle_id = null, ?string $package_name = null, ?string $origin = null, \DateTime|int|null $start = null, \DateTime|int|null $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?SearchEventsVpnConfidence $vpn_confidence = null, ?float $min_suspect_score = null, ?bool $developer_tools = null, ?bool $location_spoofing = null, ?bool $mitm_attack = null, ?bool $rare_device = null, ?SearchEventsRareDevicePercentileBucket $rare_device_percentile_bucket = null, ?bool $proxy = null, ?string $sdk_version = null, ?SearchEventsSdkPlatform $sdk_platform = null, ?array $environment = null, ?string $proximity_id = null, ?int $total_hits = null, ?bool $tor_node = null, ?SearchEventsIncrementalIdentificationStatus $incremental_identification_status = null, ?bool $simulator = null, ?bool $active_call = null, ?array $source = null): PromiseInterface { - $request = $this->searchEventsRequest($limit, $pagination_key, $visitor_id, $high_recall_id, $bot, $bot_info, $bot_info_category, $bot_info_identity, $bot_info_confidence, $bot_info_provider, $bot_info_name, $ip_address, $asn, $linked_id, $url, $bundle_id, $package_name, $origin, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $developer_tools, $location_spoofing, $mitm_attack, $rare_device, $rare_device_percentile_bucket, $proxy, $sdk_version, $sdk_platform, $environment, $proximity_id, $total_hits, $tor_node, $incremental_identification_status, $simulator, $source, $active_call); + $request = $this->searchEventsRequest($limit, $pagination_key, $visitor_id, $high_recall_id, $bot, $bot_info, $bot_info_category, $bot_info_identity, $bot_info_confidence, $bot_info_provider, $bot_info_name, $ip_address, $asn, $linked_id, $url, $bundle_id, $package_name, $origin, $start, $end, $reverse, $suspect, $vpn, $virtual_machine, $tampering, $anti_detect_browser, $incognito, $privacy_settings, $jailbroken, $frida, $factory_reset, $cloned_app, $emulator, $root_apps, $vpn_confidence, $min_suspect_score, $developer_tools, $location_spoofing, $mitm_attack, $rare_device, $rare_device_percentile_bucket, $proxy, $sdk_version, $sdk_platform, $environment, $proximity_id, $total_hits, $tor_node, $incremental_identification_status, $simulator, $active_call, $source); return $this->client ->sendAsync($request, $this->createHttpClientOption()) @@ -905,7 +1116,7 @@ function ($e) { * * @param int $limit Maximum number of events to return. Defaults to 10 when omitted. Results are selected from the time range (`start`, `end`), ordered by `reverse`, then truncated to provided `limit` size. So `reverse=true` returns the oldest N=`limit` events, otherwise the newest N=`limit` events. (optional) * @param string|null $pagination_key Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 100 results for your query using `limit`, but there are more than 100 events total matching your request), the `pagination_key` field is added to the response. The pagination key is an arbitrary string that should not be interpreted in any way and should be passed as-is. In the following request, use that value in the `pagination_key` parameter to get the next page of results: 1. First request, returning most recent 100 events: `GET api-base-url/events?limit=100` 2. Use `response.pagination_key` to get the next page of results: `GET api-base-url/events?limit=100&pagination_key=S9rgMMUb4z3X5t5pr_tSgoSZlmyF0O8X7kCV2m981-iY1LmRTjraa1rTk3L-hQExnDWCi0RA-zAIjaVSTNO2AN2eqQWgzT0RjbieMxRfSdkM-HmOhdOgdQvYfPG3vqU1DJKh4Q` (optional) - * @param string|null $visitor_id Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). (optional) + * @param string|null $visitor_id Unique [visitor identifier](https://docs.fingerprint.com/reference/js-agent-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter events by matching Visitor ID (`identification.visitor_id` property). (optional) * @param string|null $high_recall_id The High Recall ID is a supplementary browser identifier designed for use cases that require wider coverage over precision. Compared to the standard visitor ID, the High Recall ID strives to match incoming browsers more generously (rather than precisely) with existing browsers and thus identifies fewer browsers as new. The High Recall ID is best suited for use cases that are sensitive to browsers being identified as new and where mismatched browsers are not detrimental. Filter events by matching High Recall ID (`supplementary_id_high_recall.visitor_id` property). (optional) * @param SearchEventsBot|null $bot Filter events by the Bot Detection result, specifically: `all` - events where any kind of bot was detected. `good` - events where a good bot was detected. `bad` - events where a bad bot was detected. `none` - events where no bot was detected. > Note: When using this parameter, only events with the `bot` property set to a valid value are returned. Events without a `bot` Smart Signal result are left out of the response. (optional) * @param SearchEventsBotInfo|null $bot_info Filter events by their Bot Info result, specifically: - `all` - events where any kind of bot was detected. - `none` - events where no bot was detected, and no `bot_info` was present. (optional) @@ -916,7 +1127,7 @@ function ($e) { * @param string[]|null $bot_info_name Filter events by their Bot Info Name. The name must match exactly, partial or wildcard matching is not supported. Multiple Names can be provided using the repeated keys syntax. For example, `bot_info_name=ChatGPT%20Agent&bot_info_name=Bedrock%20AgentCore`, will match events with a Bot Info Name of `ChatGPT Agent` or `Bedrock AgentCore`. Other notations like comma-separated or bracket notation are not supported. (optional) * @param string|null $ip_address Filter events by IP address or IP range (if CIDR notation is used). If CIDR notation is not used, a /32 for IPv4 or /128 for IPv6 is assumed. Examples of range based queries: 10.0.0.0/24, 192.168.0.1/32 (optional) * @param string|null $asn Filter events by the ASN associated with the event's IP address. This corresponds to the `ip_info.(v4|v6).asn` property in the response. (optional) - * @param string|null $linked_id Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-v4-get-function#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 string|null $linked_id Filter events by your custom identifier. You can use [linked Ids](https://docs.fingerprint.com/reference/js-agent-get-function#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 string|null $url Filter events by the URL (`url` property) associated with the event. (optional) * @param string|null $bundle_id Filter events by the Bundle ID (iOS) associated with the event. (optional) * @param string|null $package_name Filter events by the Package Name (Android) associated with the event. (optional) @@ -953,8 +1164,8 @@ function ($e) { * @param bool|null $tor_node Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. (optional) * @param SearchEventsIncrementalIdentificationStatus|null $incremental_identification_status Filter events by their incremental identification status (`incremental_identification_status` property). Non incremental identification events are left out of the response. (optional) * @param bool|null $simulator Filter events by iOS Simulator Detection result. > Note: When using this parameter, only events with the `simulator` property set to `true` or `false` are returned. Events without a `simulator` Smart Signal result are left out of the response. (optional) - * @param SearchEventsSource[]|null $source Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. (optional) * @param bool|null $active_call Filter events by Active Call Detection result on mobile devices. > Note: When using this parameter, only events with the `active_call` property set to `true` or `false` are returned. Events without an `active_call` Smart Signal result are left out of the response. (optional) + * @param SearchEventsSource[]|null $source Selects the source of events to search. When omitted, only traditional identification events generated from devices are returned (the default behavior). When set to `edge`, only Automation Intelligence (Edge) events are returned. To retrieve all events regardless of source, you must make two requests. One with the `source` parameter set to `edge`, and another with the `source` parameter omitted. > Note: The Automation Intelligence API is in public preview testing phase. If you encounter any issues, please [contact](https://fingerprint.com/support/) our support team. (optional) * * @noinspection GrazieInspection * @@ -962,7 +1173,7 @@ function ($e) { * * @throws \InvalidArgumentException */ - public function searchEventsRequest(?int $limit = null, ?string $pagination_key = null, ?string $visitor_id = null, ?string $high_recall_id = null, ?SearchEventsBot $bot = null, ?SearchEventsBotInfo $bot_info = null, ?array $bot_info_category = null, ?array $bot_info_identity = null, ?array $bot_info_confidence = null, ?array $bot_info_provider = null, ?array $bot_info_name = null, ?string $ip_address = null, ?string $asn = null, ?string $linked_id = null, ?string $url = null, ?string $bundle_id = null, ?string $package_name = null, ?string $origin = null, \DateTime|int|null $start = null, \DateTime|int|null $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?SearchEventsVpnConfidence $vpn_confidence = null, ?float $min_suspect_score = null, ?bool $developer_tools = null, ?bool $location_spoofing = null, ?bool $mitm_attack = null, ?bool $rare_device = null, ?SearchEventsRareDevicePercentileBucket $rare_device_percentile_bucket = null, ?bool $proxy = null, ?string $sdk_version = null, ?SearchEventsSdkPlatform $sdk_platform = null, ?array $environment = null, ?string $proximity_id = null, ?int $total_hits = null, ?bool $tor_node = null, ?SearchEventsIncrementalIdentificationStatus $incremental_identification_status = null, ?bool $simulator = null, ?array $source = null, ?bool $active_call = null): Request + public function searchEventsRequest(?int $limit = null, ?string $pagination_key = null, ?string $visitor_id = null, ?string $high_recall_id = null, ?SearchEventsBot $bot = null, ?SearchEventsBotInfo $bot_info = null, ?array $bot_info_category = null, ?array $bot_info_identity = null, ?array $bot_info_confidence = null, ?array $bot_info_provider = null, ?array $bot_info_name = null, ?string $ip_address = null, ?string $asn = null, ?string $linked_id = null, ?string $url = null, ?string $bundle_id = null, ?string $package_name = null, ?string $origin = null, \DateTime|int|null $start = null, \DateTime|int|null $end = null, ?bool $reverse = null, ?bool $suspect = null, ?bool $vpn = null, ?bool $virtual_machine = null, ?bool $tampering = null, ?bool $anti_detect_browser = null, ?bool $incognito = null, ?bool $privacy_settings = null, ?bool $jailbroken = null, ?bool $frida = null, ?bool $factory_reset = null, ?bool $cloned_app = null, ?bool $emulator = null, ?bool $root_apps = null, ?SearchEventsVpnConfidence $vpn_confidence = null, ?float $min_suspect_score = null, ?bool $developer_tools = null, ?bool $location_spoofing = null, ?bool $mitm_attack = null, ?bool $rare_device = null, ?SearchEventsRareDevicePercentileBucket $rare_device_percentile_bucket = null, ?bool $proxy = null, ?string $sdk_version = null, ?SearchEventsSdkPlatform $sdk_platform = null, ?array $environment = null, ?string $proximity_id = null, ?int $total_hits = null, ?bool $tor_node = null, ?SearchEventsIncrementalIdentificationStatus $incremental_identification_status = null, ?bool $simulator = null, ?bool $active_call = null, ?array $source = null): Request { if (null !== $limit && $limit > 100) { throw new \InvalidArgumentException('invalid value for "$limit" when calling FingerprintApi.searchEvents, must be smaller than or equal to 100.'); @@ -1439,18 +1650,18 @@ public function searchEventsRequest(?int $limit = null, ?string $pagination_key ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $source, - 'source', - 'array', + $active_call, + 'active_call', + 'boolean', 'form', true, false ) ?? []); // query params $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( - $active_call, - 'active_call', - 'boolean', + $source, + 'source', + 'array', 'form', true, false @@ -1479,7 +1690,7 @@ public function searchEventsRequest(?int $limit = null, ?string $pagination_key * * Update an event * - * @param string $event_id The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). (required) + * @param string $event_id The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). (required) * @param EventUpdate $event_update event_update (required) * * @noinspection GrazieInspection @@ -1499,7 +1710,7 @@ public function updateEvent(string $event_id, EventUpdate $event_update): void * * Update an event * - * @param string $event_id The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). (required) + * @param string $event_id The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). (required) * @param EventUpdate $event_update (required) * * @noinspection GrazieInspection @@ -1561,7 +1772,7 @@ public function updateEventWithHttpInfo(string $event_id, EventUpdate $event_upd * * Update an event * - * @param string $event_id The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). (required) + * @param string $event_id The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). (required) * @param EventUpdate $event_update (required) * * @noinspection GrazieInspection @@ -1585,7 +1796,7 @@ function ($response) { * * Update an event * - * @param string $event_id The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). (required) + * @param string $event_id The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). (required) * @param EventUpdate $event_update (required) * * @noinspection GrazieInspection @@ -1635,7 +1846,7 @@ function ($e) { /** * Create request for operation 'updateEvent'. * - * @param string $event_id The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). (required) + * @param string $event_id The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-get-function#event_id). (required) * @param EventUpdate $event_update (required) * * @noinspection GrazieInspection @@ -1709,6 +1920,87 @@ protected function createHttpClientOption(): array return $options; } + /** + * Handle error responses for operation 'analyzeRequestForAutomationIntelligence'. + * + * @param ApiException $e the API exception to handle + * + * @throws ApiException always rethrown after setting error details + * @throws \DateMalformedStringException + * + * @noinspection PhpDuplicateSwitchCaseBodyInspection + * @noinspection RedundantSuppression + */ + private function handleAnalyzeRequestForAutomationIntelligenceError(ApiException $e): never + { + $response = $e->getResponseObject(); + + if (null !== $response) { + $errorCode = $e->getCode(); + + $content = (string) $response->getBody(); + $response->getBody()->rewind(); + + switch ($errorCode) { + case 200: + $data = ObjectSerializer::deserialize( + $content, + '\Fingerprint\ServerSdk\Model\EventEdge' + ); + $e->setErrorDetails($data); + + throw $e; + + case 400: + $data = ObjectSerializer::deserialize( + $content, + '\Fingerprint\ServerSdk\Model\ErrorResponse' + ); + $e->setErrorDetails($data); + + throw $e; + + case 403: + $data = ObjectSerializer::deserialize( + $content, + '\Fingerprint\ServerSdk\Model\ErrorResponse' + ); + $e->setErrorDetails($data); + + throw $e; + + case 413: + $data = ObjectSerializer::deserialize( + $content, + '\Fingerprint\ServerSdk\Model\ErrorResponse' + ); + $e->setErrorDetails($data); + + throw $e; + + case 429: + $data = ObjectSerializer::deserialize( + $content, + '\Fingerprint\ServerSdk\Model\ErrorResponse' + ); + $e->setErrorDetails($data); + + throw $e; + + case 500: + $data = ObjectSerializer::deserialize( + $content, + '\Fingerprint\ServerSdk\Model\ErrorResponse' + ); + $e->setErrorDetails($data); + + throw $e; + } + } + + throw $e; + } + /** * Handle error responses for operation 'deleteVisitorData'. * diff --git a/src/Model/EdgeRequest.php b/src/Model/EdgeRequest.php new file mode 100644 index 000000000..15b6ac7ff --- /dev/null +++ b/src/Model/EdgeRequest.php @@ -0,0 +1,586 @@ + + * + * @noinspection GrazieInspection + * @noinspection RedundantSuppression + */ +class EdgeRequest implements ModelInterface, \ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + */ + protected static string $openAPIModelName = 'EdgeRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $openAPITypes = [ + 'headers' => '\Fingerprint\ServerSdk\Model\EdgeRequestHeadersInner[]', + 'method' => 'string', + 'url' => 'string', + 'ipv4_address' => 'string', + 'ipv6_address' => 'string', + 'linked_id' => 'string', + 'tags' => 'array', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + * + * @phpstan-var array + * + * @psalm-var array + */ + protected static array $openAPIFormats = [ + 'headers' => null, + 'method' => null, + 'url' => 'uri', + 'ipv4_address' => 'ipv4', + 'ipv6_address' => 'ipv6', + 'linked_id' => null, + 'tags' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization. + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'headers' => false, + 'method' => false, + 'url' => false, + 'ipv4_address' => false, + 'ipv6_address' => false, + 'linked_id' => false, + 'tags' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here. + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'headers' => 'headers', + 'method' => 'method', + 'url' => 'url', + 'ipv4_address' => 'ipv4_address', + 'ipv6_address' => 'ipv6_address', + 'linked_id' => 'linked_id', + 'tags' => 'tags', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'headers' => 'setHeaders', + 'method' => 'setMethod', + 'url' => 'setUrl', + 'ipv4_address' => 'setIpv4Address', + 'ipv6_address' => 'setIpv6Address', + 'linked_id' => 'setLinkedId', + 'tags' => 'setTags', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'headers' => 'getHeaders', + 'method' => 'getMethod', + 'url' => 'getUrl', + 'ipv4_address' => 'getIpv4Address', + 'ipv6_address' => 'getIpv6Address', + 'linked_id' => 'getLinkedId', + 'tags' => 'getTags', + ]; + + /** + * Associative array for storing property values. + */ + protected array $container = []; + + /** + * Constructor. + * + * @param array|null $data Associated array of property values + * initializing the model + * + * @noinspection DuplicatedCode + */ + public function __construct(?array $data = null) + { + $this->setIfExists('headers', $data ?? [], null); + $this->setIfExists('method', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('ipv4_address', $data ?? [], null); + $this->setIfExists('ipv6_address', $data ?? [], null); + $this->setIfExists('linked_id', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + } + + /** + * Gets the string presentation of the object. + * + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + * + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Checks if a property is nullable. + * + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * 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::$openAPIModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['headers']) { + $invalidProperties[] = "'headers' can't be null"; + } + if (count($this->container['headers']) < 1) { + $invalidProperties[] = "invalid value for 'headers', number of items must be greater than or equal to 1."; + } + + if (null === $this->container['method']) { + $invalidProperties[] = "'method' can't be null"; + } + if (null === $this->container['url']) { + $invalidProperties[] = "'url' 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 headers. + * + * @return EdgeRequestHeadersInner[]|null + */ + public function getHeaders(): ?array + { + return $this->container['headers']; + } + + /** + * Sets headers. + * + * @param EdgeRequestHeadersInner[] $headers Ordered header entries from the request made to your server. Each entry represents one header line. If one header name appears as multiple lines, send each as a separate item in the array. Headers that contain authentication or session data must still be included, but with with their value set to an empty string. This includes headers like `Authorization` and `Cookie`, but may contain more depending on your specific project, for instance `Proxy-Authenticate` or `X-Api-Key`. Omitting the headers entirely changes the shape of the request and can affect detection. Never forward the real secret values. Whenever possible, we recommend preserving header order and capitalization to provide the best accuracy, however it’s not a strict requirement if your runtime does not maintain http header order or canonicalizes header names. + * + */ + public function setHeaders(array $headers): self + { + if (count($headers) < 1) { + throw new \InvalidArgumentException('invalid length for $headers when calling EdgeRequest., number of items must be greater than or equal to 1.'); + } + $this->container['headers'] = $headers; + + return $this; + } + + /** + * Gets method. + * + */ + public function getMethod(): ?string + { + return $this->container['method']; + } + + /** + * Sets method. + * + * @param string $method The original HTTP method of the request. If supported in your runtime, preserve the original casing. + * + */ + public function setMethod(string $method): self + { + $this->container['method'] = $method; + + return $this; + } + + /** + * Gets url. + * + */ + public function getUrl(): ?string + { + return $this->container['url']; + } + + /** + * Sets url. + * + * @param string $url Absolute URL of the request, without a \\#fragment suffix. Only HTTP and HTTPS schemes are supported. + * + */ + public function setUrl(string $url): self + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets ipv4_address. + * + */ + public function getIpv4Address(): ?string + { + return $this->container['ipv4_address']; + } + + /** + * Sets ipv4_address. + * + * @param string $ipv4_address client IPv4 address observed by your server + * + */ + public function setIpv4Address(string $ipv4_address): self + { + $this->container['ipv4_address'] = $ipv4_address; + + return $this; + } + + /** + * Gets ipv6_address. + * + */ + public function getIpv6Address(): ?string + { + return $this->container['ipv6_address']; + } + + /** + * Sets ipv6_address. + * + * @param string $ipv6_address client IPv6 address observed by your server + * + */ + public function setIpv6Address(string $ipv6_address): self + { + $this->container['ipv6_address'] = $ipv6_address; + + return $this; + } + + /** + * Gets linked_id. + * + */ + public function getLinkedId(): ?string + { + return $this->container['linked_id']; + } + + /** + * Sets linked_id. + * + * @param string $linked_id a customer-provided id that was sent with the request + * + */ + public function setLinkedId(string $linked_id): self + { + $this->container['linked_id'] = $linked_id; + + return $this; + } + + /** + * Gets tags. + * + * @return array|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags. + * + * @param array $tags a customer-provided value or an object that was sent with the identification request or updated later + * + */ + public function setTags(array $tags): self + { + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int|string $offset Offset + * + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int|string $offset Offset + * + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[\ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets a header-safe presentation of the object. + * + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of nullable properties. + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null. + * + * @return bool[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null. + * + * @param bool[] $openAPINullablesSetToNull + * + * @codeCoverageIgnore + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array. + * + * @noinspection PhpSameParameterValueInspection + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; // @codeCoverageIgnore + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } +} diff --git a/src/Model/EdgeRequestHeadersInner.php b/src/Model/EdgeRequestHeadersInner.php new file mode 100644 index 000000000..88dc705d9 --- /dev/null +++ b/src/Model/EdgeRequestHeadersInner.php @@ -0,0 +1,426 @@ + + * + * @noinspection GrazieInspection + * @noinspection RedundantSuppression + */ +class EdgeRequestHeadersInner implements ModelInterface, \ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + */ + protected static string $openAPIModelName = 'EdgeRequest_headers_inner'; + + /** + * Array of property to type mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $openAPITypes = [ + 'name' => 'string', + 'value' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + * + * @phpstan-var array + * + * @psalm-var array + */ + protected static array $openAPIFormats = [ + 'name' => null, + 'value' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization. + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'name' => false, + 'value' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here. + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'name' => 'name', + 'value' => 'value', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'name' => 'setName', + 'value' => 'setValue', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'name' => 'getName', + 'value' => 'getValue', + ]; + + /** + * Associative array for storing property values. + */ + protected array $container = []; + + /** + * Constructor. + * + * @param array|null $data Associated array of property values + * initializing the model + * + * @noinspection DuplicatedCode + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + } + + /** + * Gets the string presentation of the object. + * + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + * + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Checks if a property is nullable. + * + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * 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::$openAPIModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['name']) { + $invalidProperties[] = "'name' can't be null"; + } + if (null === $this->container['value']) { + $invalidProperties[] = "'value' 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 name. + * + */ + public function getName(): ?string + { + return $this->container['name']; + } + + /** + * Sets name. + * + * @param string $name Header name as forwarded by your server. Headers must be valid according to RFC 7230 and will be canonicalized according to RFC 9112. + * + */ + public function setName(string $name): self + { + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets value. + * + */ + public function getValue(): ?string + { + return $this->container['value']; + } + + /** + * Sets value. + * + * @param string $value Value of a single forwarded header entry. Be careful to preserve the original encoding and escaping. For example, do not double escape quotes. + * + */ + public function setValue(string $value): self + { + $this->container['value'] = $value; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int|string $offset Offset + * + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int|string $offset Offset + * + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[\ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets a header-safe presentation of the object. + * + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of nullable properties. + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null. + * + * @return bool[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null. + * + * @param bool[] $openAPINullablesSetToNull + * + * @codeCoverageIgnore + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array. + * + * @noinspection PhpSameParameterValueInspection + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; // @codeCoverageIgnore + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } +} diff --git a/src/Model/Event.php b/src/Model/Event.php index 10fdec8ff..6425fb8e2 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -32,11 +32,15 @@ use Fingerprint\ServerSdk\ObjectSerializer; /** - * Contains results from Fingerprint Identification and all active Smart Signals. Some Smart Signals are only supported for certain device types, these fields will be omitted for events not generated from the supported devices. Consult the [Smart Signals reference](https://docs.fingerprint.com/docs/smart-signals-reference) for more details. + * An identification event (`source: device`) or an Automation Intelligence event (`source: edge`). + * + * Use `source` to tell them apart. Device events include Identification and device-derived Smart Signals. Edge events do not. + * + * Consult the [Smart Signals reference](https://docs.fingerprint.com/docs/smart-signals-reference) for more details. * * @category Class * - * @description Contains results from Fingerprint Identification and all active Smart Signals. Some Smart Signals are only supported for certain device types, these fields will be omitted for events not generated from the supported devices. Consult the [Smart Signals reference](https://docs.fingerprint.com/docs/smart-signals-reference) for more details. + * @description An identification event (`source: device`) or an Automation Intelligence event (`source: edge`). Use `source` to tell them apart. Device events include Identification and device-derived Smart Signals. Edge events do not. Consult the [Smart Signals reference](https://docs.fingerprint.com/docs/smart-signals-reference) for more details. * * @author Fingerprint * @@ -49,7 +53,18 @@ */ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable { - public const DISCRIMINATOR = null; + /** + * SPIKE INTER-2457 — Event call sites do NOT break in PHP. + * DISCRIMINATOR looks up `\Fingerprint\ServerSdk\Model\device` / `edge`, + * which do not exist (real classes are EventDevice / EventEdge). + * ObjectSerializer falls back to this flat Event class, so + * getIdentification() still works. Proof that PHP codegen does not split + * this oneOf. + * + * Missing `source` hydrates to `device` (see ObjectSerializer::hydrateEmptyEventSource). + * `source: edge` is never rewritten. Unknown non-empty source fails. + */ + public const DISCRIMINATOR = 'source'; /** * The original name of the model. @@ -65,17 +80,25 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable protected static array $openAPITypes = [ 'event_id' => 'string', 'timestamp' => 'int', + 'linked_id' => 'string', + 'tags' => 'array', + 'url' => 'string', + 'bot_info' => '\Fingerprint\ServerSdk\Model\BotInfo', + 'ip_info' => '\Fingerprint\ServerSdk\Model\IPInfo', + 'proxy' => 'bool', + 'proxy_confidence' => '\Fingerprint\ServerSdk\Model\ProxyConfidence', + 'proxy_details' => '\Fingerprint\ServerSdk\Model\ProxyDetails', + 'vpn' => 'bool', + 'vpn_confidence' => '\Fingerprint\ServerSdk\Model\VpnConfidence', + 'vpn_methods' => '\Fingerprint\ServerSdk\Model\VpnMethods', 'source' => '\Fingerprint\ServerSdk\Model\EventSource', 'incremental_identification_status' => '\Fingerprint\ServerSdk\Model\IncrementalIdentificationStatus', - 'linked_id' => 'string', 'environment_id' => 'string', 'suspect' => 'bool', 'sdk' => '\Fingerprint\ServerSdk\Model\SDK', 'replayed' => 'bool', 'identification' => '\Fingerprint\ServerSdk\Model\Identification', 'supplementary_id_high_recall' => '\Fingerprint\ServerSdk\Model\SupplementaryIDHighRecall', - 'tags' => 'array', - 'url' => 'string', 'bundle_id' => 'string', 'package_name' => 'string', 'ip_address' => 'string', @@ -89,17 +112,12 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'active_call' => 'bool', 'bot' => '\Fingerprint\ServerSdk\Model\BotResult', 'bot_type' => 'string', - 'bot_info' => '\Fingerprint\ServerSdk\Model\BotInfo', 'cloned_app' => 'bool', 'developer_tools' => 'bool', 'emulator' => 'bool', 'factory_reset_timestamp' => 'int', 'frida' => 'bool', 'ip_blocklist' => '\Fingerprint\ServerSdk\Model\IPBlockList', - 'ip_info' => '\Fingerprint\ServerSdk\Model\IPInfo', - 'proxy' => 'bool', - 'proxy_confidence' => '\Fingerprint\ServerSdk\Model\ProxyConfidence', - 'proxy_details' => '\Fingerprint\ServerSdk\Model\ProxyDetails', 'proxy_ml_score' => 'float', 'incognito' => 'bool', 'jailbroken' => 'bool', @@ -117,12 +135,9 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'velocity' => '\Fingerprint\ServerSdk\Model\Velocity', 'virtual_machine' => 'bool', 'virtual_machine_ml_score' => 'float', - 'vpn' => 'bool', - 'vpn_confidence' => '\Fingerprint\ServerSdk\Model\VpnConfidence', 'vpn_ml_score' => 'float', 'vpn_origin_timezone' => 'string', 'vpn_origin_country' => 'string', - 'vpn_methods' => '\Fingerprint\ServerSdk\Model\VpnMethods', 'high_activity_device' => 'bool', 'rare_device' => 'bool', 'rare_device_percentile_bucket' => '\Fingerprint\ServerSdk\Model\RareDevicePercentileBucket', @@ -142,17 +157,25 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable protected static array $openAPIFormats = [ 'event_id' => null, 'timestamp' => 'int64', + 'linked_id' => null, + 'tags' => null, + 'url' => null, + 'bot_info' => null, + 'ip_info' => null, + 'proxy' => null, + 'proxy_confidence' => null, + 'proxy_details' => null, + 'vpn' => null, + 'vpn_confidence' => null, + 'vpn_methods' => null, 'source' => null, 'incremental_identification_status' => null, - 'linked_id' => null, 'environment_id' => null, 'suspect' => null, 'sdk' => null, 'replayed' => null, 'identification' => null, 'supplementary_id_high_recall' => null, - 'tags' => null, - 'url' => null, 'bundle_id' => null, 'package_name' => null, 'ip_address' => null, @@ -166,17 +189,12 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'active_call' => null, 'bot' => null, 'bot_type' => null, - 'bot_info' => null, 'cloned_app' => null, 'developer_tools' => null, 'emulator' => null, 'factory_reset_timestamp' => 'int64', 'frida' => null, 'ip_blocklist' => null, - 'ip_info' => null, - 'proxy' => null, - 'proxy_confidence' => null, - 'proxy_details' => null, 'proxy_ml_score' => 'double', 'incognito' => null, 'jailbroken' => null, @@ -194,12 +212,9 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'velocity' => null, 'virtual_machine' => null, 'virtual_machine_ml_score' => 'double', - 'vpn' => null, - 'vpn_confidence' => null, 'vpn_ml_score' => 'double', 'vpn_origin_timezone' => null, 'vpn_origin_country' => null, - 'vpn_methods' => null, 'high_activity_device' => null, 'rare_device' => null, 'rare_device_percentile_bucket' => null, @@ -215,17 +230,25 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable protected static array $openAPINullables = [ 'event_id' => false, 'timestamp' => false, + 'linked_id' => false, + 'tags' => false, + 'url' => false, + 'bot_info' => false, + 'ip_info' => false, + 'proxy' => false, + 'proxy_confidence' => false, + 'proxy_details' => false, + 'vpn' => false, + 'vpn_confidence' => false, + 'vpn_methods' => false, 'source' => false, 'incremental_identification_status' => false, - 'linked_id' => false, 'environment_id' => false, 'suspect' => false, 'sdk' => false, 'replayed' => false, 'identification' => false, 'supplementary_id_high_recall' => false, - 'tags' => false, - 'url' => false, 'bundle_id' => false, 'package_name' => false, 'ip_address' => false, @@ -239,17 +262,12 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'active_call' => false, 'bot' => false, 'bot_type' => false, - 'bot_info' => false, 'cloned_app' => false, 'developer_tools' => false, 'emulator' => false, 'factory_reset_timestamp' => false, 'frida' => false, 'ip_blocklist' => false, - 'ip_info' => false, - 'proxy' => false, - 'proxy_confidence' => false, - 'proxy_details' => false, 'proxy_ml_score' => false, 'incognito' => false, 'jailbroken' => false, @@ -267,12 +285,9 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'velocity' => false, 'virtual_machine' => false, 'virtual_machine_ml_score' => false, - 'vpn' => false, - 'vpn_confidence' => false, 'vpn_ml_score' => false, 'vpn_origin_timezone' => false, 'vpn_origin_country' => false, - 'vpn_methods' => false, 'high_activity_device' => false, 'rare_device' => false, 'rare_device_percentile_bucket' => false, @@ -296,17 +311,25 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable protected static array $attributeMap = [ 'event_id' => 'event_id', 'timestamp' => 'timestamp', + 'linked_id' => 'linked_id', + 'tags' => 'tags', + 'url' => 'url', + 'bot_info' => 'bot_info', + 'ip_info' => 'ip_info', + 'proxy' => 'proxy', + 'proxy_confidence' => 'proxy_confidence', + 'proxy_details' => 'proxy_details', + 'vpn' => 'vpn', + 'vpn_confidence' => 'vpn_confidence', + 'vpn_methods' => 'vpn_methods', 'source' => 'source', 'incremental_identification_status' => 'incremental_identification_status', - 'linked_id' => 'linked_id', 'environment_id' => 'environment_id', 'suspect' => 'suspect', 'sdk' => 'sdk', 'replayed' => 'replayed', 'identification' => 'identification', 'supplementary_id_high_recall' => 'supplementary_id_high_recall', - 'tags' => 'tags', - 'url' => 'url', 'bundle_id' => 'bundle_id', 'package_name' => 'package_name', 'ip_address' => 'ip_address', @@ -320,17 +343,12 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'active_call' => 'active_call', 'bot' => 'bot', 'bot_type' => 'bot_type', - 'bot_info' => 'bot_info', 'cloned_app' => 'cloned_app', 'developer_tools' => 'developer_tools', 'emulator' => 'emulator', 'factory_reset_timestamp' => 'factory_reset_timestamp', 'frida' => 'frida', 'ip_blocklist' => 'ip_blocklist', - 'ip_info' => 'ip_info', - 'proxy' => 'proxy', - 'proxy_confidence' => 'proxy_confidence', - 'proxy_details' => 'proxy_details', 'proxy_ml_score' => 'proxy_ml_score', 'incognito' => 'incognito', 'jailbroken' => 'jailbroken', @@ -348,12 +366,9 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'velocity' => 'velocity', 'virtual_machine' => 'virtual_machine', 'virtual_machine_ml_score' => 'virtual_machine_ml_score', - 'vpn' => 'vpn', - 'vpn_confidence' => 'vpn_confidence', 'vpn_ml_score' => 'vpn_ml_score', 'vpn_origin_timezone' => 'vpn_origin_timezone', 'vpn_origin_country' => 'vpn_origin_country', - 'vpn_methods' => 'vpn_methods', 'high_activity_device' => 'high_activity_device', 'rare_device' => 'rare_device', 'rare_device_percentile_bucket' => 'rare_device_percentile_bucket', @@ -369,17 +384,25 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable protected static array $setters = [ 'event_id' => 'setEventId', 'timestamp' => 'setTimestamp', + 'linked_id' => 'setLinkedId', + 'tags' => 'setTags', + 'url' => 'setUrl', + 'bot_info' => 'setBotInfo', + 'ip_info' => 'setIpInfo', + 'proxy' => 'setProxy', + 'proxy_confidence' => 'setProxyConfidence', + 'proxy_details' => 'setProxyDetails', + 'vpn' => 'setVpn', + 'vpn_confidence' => 'setVpnConfidence', + 'vpn_methods' => 'setVpnMethods', 'source' => 'setSource', 'incremental_identification_status' => 'setIncrementalIdentificationStatus', - 'linked_id' => 'setLinkedId', 'environment_id' => 'setEnvironmentId', 'suspect' => 'setSuspect', 'sdk' => 'setSdk', 'replayed' => 'setReplayed', 'identification' => 'setIdentification', 'supplementary_id_high_recall' => 'setSupplementaryIdHighRecall', - 'tags' => 'setTags', - 'url' => 'setUrl', 'bundle_id' => 'setBundleId', 'package_name' => 'setPackageName', 'ip_address' => 'setIpAddress', @@ -393,17 +416,12 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'active_call' => 'setActiveCall', 'bot' => 'setBot', 'bot_type' => 'setBotType', - 'bot_info' => 'setBotInfo', 'cloned_app' => 'setClonedApp', 'developer_tools' => 'setDeveloperTools', 'emulator' => 'setEmulator', 'factory_reset_timestamp' => 'setFactoryResetTimestamp', 'frida' => 'setFrida', 'ip_blocklist' => 'setIpBlocklist', - 'ip_info' => 'setIpInfo', - 'proxy' => 'setProxy', - 'proxy_confidence' => 'setProxyConfidence', - 'proxy_details' => 'setProxyDetails', 'proxy_ml_score' => 'setProxyMlScore', 'incognito' => 'setIncognito', 'jailbroken' => 'setJailbroken', @@ -421,12 +439,9 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'velocity' => 'setVelocity', 'virtual_machine' => 'setVirtualMachine', 'virtual_machine_ml_score' => 'setVirtualMachineMlScore', - 'vpn' => 'setVpn', - 'vpn_confidence' => 'setVpnConfidence', 'vpn_ml_score' => 'setVpnMlScore', 'vpn_origin_timezone' => 'setVpnOriginTimezone', 'vpn_origin_country' => 'setVpnOriginCountry', - 'vpn_methods' => 'setVpnMethods', 'high_activity_device' => 'setHighActivityDevice', 'rare_device' => 'setRareDevice', 'rare_device_percentile_bucket' => 'setRareDevicePercentileBucket', @@ -442,17 +457,25 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable protected static array $getters = [ 'event_id' => 'getEventId', 'timestamp' => 'getTimestamp', + 'linked_id' => 'getLinkedId', + 'tags' => 'getTags', + 'url' => 'getUrl', + 'bot_info' => 'getBotInfo', + 'ip_info' => 'getIpInfo', + 'proxy' => 'getProxy', + 'proxy_confidence' => 'getProxyConfidence', + 'proxy_details' => 'getProxyDetails', + 'vpn' => 'getVpn', + 'vpn_confidence' => 'getVpnConfidence', + 'vpn_methods' => 'getVpnMethods', 'source' => 'getSource', 'incremental_identification_status' => 'getIncrementalIdentificationStatus', - 'linked_id' => 'getLinkedId', 'environment_id' => 'getEnvironmentId', 'suspect' => 'getSuspect', 'sdk' => 'getSdk', 'replayed' => 'getReplayed', 'identification' => 'getIdentification', 'supplementary_id_high_recall' => 'getSupplementaryIdHighRecall', - 'tags' => 'getTags', - 'url' => 'getUrl', 'bundle_id' => 'getBundleId', 'package_name' => 'getPackageName', 'ip_address' => 'getIpAddress', @@ -466,17 +489,12 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'active_call' => 'getActiveCall', 'bot' => 'getBot', 'bot_type' => 'getBotType', - 'bot_info' => 'getBotInfo', 'cloned_app' => 'getClonedApp', 'developer_tools' => 'getDeveloperTools', 'emulator' => 'getEmulator', 'factory_reset_timestamp' => 'getFactoryResetTimestamp', 'frida' => 'getFrida', 'ip_blocklist' => 'getIpBlocklist', - 'ip_info' => 'getIpInfo', - 'proxy' => 'getProxy', - 'proxy_confidence' => 'getProxyConfidence', - 'proxy_details' => 'getProxyDetails', 'proxy_ml_score' => 'getProxyMlScore', 'incognito' => 'getIncognito', 'jailbroken' => 'getJailbroken', @@ -494,12 +512,9 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'velocity' => 'getVelocity', 'virtual_machine' => 'getVirtualMachine', 'virtual_machine_ml_score' => 'getVirtualMachineMlScore', - 'vpn' => 'getVpn', - 'vpn_confidence' => 'getVpnConfidence', 'vpn_ml_score' => 'getVpnMlScore', 'vpn_origin_timezone' => 'getVpnOriginTimezone', 'vpn_origin_country' => 'getVpnOriginCountry', - 'vpn_methods' => 'getVpnMethods', 'high_activity_device' => 'getHighActivityDevice', 'rare_device' => 'getRareDevice', 'rare_device_percentile_bucket' => 'getRareDevicePercentileBucket', @@ -522,19 +537,29 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable */ public function __construct(?array $data = null) { + $data = ObjectSerializer::hydrateEmptyEventSource($data); + $this->setIfExists('event_id', $data ?? [], null); $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('linked_id', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('bot_info', $data ?? [], null); + $this->setIfExists('ip_info', $data ?? [], null); + $this->setIfExists('proxy', $data ?? [], null); + $this->setIfExists('proxy_confidence', $data ?? [], null); + $this->setIfExists('proxy_details', $data ?? [], null); + $this->setIfExists('vpn', $data ?? [], null); + $this->setIfExists('vpn_confidence', $data ?? [], null); + $this->setIfExists('vpn_methods', $data ?? [], null); $this->setIfExists('source', $data ?? [], null); $this->setIfExists('incremental_identification_status', $data ?? [], null); - $this->setIfExists('linked_id', $data ?? [], null); $this->setIfExists('environment_id', $data ?? [], null); $this->setIfExists('suspect', $data ?? [], null); $this->setIfExists('sdk', $data ?? [], null); $this->setIfExists('replayed', $data ?? [], null); $this->setIfExists('identification', $data ?? [], null); $this->setIfExists('supplementary_id_high_recall', $data ?? [], null); - $this->setIfExists('tags', $data ?? [], null); - $this->setIfExists('url', $data ?? [], null); $this->setIfExists('bundle_id', $data ?? [], null); $this->setIfExists('package_name', $data ?? [], null); $this->setIfExists('ip_address', $data ?? [], null); @@ -548,17 +573,12 @@ public function __construct(?array $data = null) $this->setIfExists('active_call', $data ?? [], null); $this->setIfExists('bot', $data ?? [], null); $this->setIfExists('bot_type', $data ?? [], null); - $this->setIfExists('bot_info', $data ?? [], null); $this->setIfExists('cloned_app', $data ?? [], null); $this->setIfExists('developer_tools', $data ?? [], null); $this->setIfExists('emulator', $data ?? [], null); $this->setIfExists('factory_reset_timestamp', $data ?? [], null); $this->setIfExists('frida', $data ?? [], null); $this->setIfExists('ip_blocklist', $data ?? [], null); - $this->setIfExists('ip_info', $data ?? [], null); - $this->setIfExists('proxy', $data ?? [], null); - $this->setIfExists('proxy_confidence', $data ?? [], null); - $this->setIfExists('proxy_details', $data ?? [], null); $this->setIfExists('proxy_ml_score', $data ?? [], null); $this->setIfExists('incognito', $data ?? [], null); $this->setIfExists('jailbroken', $data ?? [], null); @@ -576,12 +596,9 @@ public function __construct(?array $data = null) $this->setIfExists('velocity', $data ?? [], null); $this->setIfExists('virtual_machine', $data ?? [], null); $this->setIfExists('virtual_machine_ml_score', $data ?? [], null); - $this->setIfExists('vpn', $data ?? [], null); - $this->setIfExists('vpn_confidence', $data ?? [], null); $this->setIfExists('vpn_ml_score', $data ?? [], null); $this->setIfExists('vpn_origin_timezone', $data ?? [], null); $this->setIfExists('vpn_origin_country', $data ?? [], null); - $this->setIfExists('vpn_methods', $data ?? [], null); $this->setIfExists('high_activity_device', $data ?? [], null); $this->setIfExists('rare_device', $data ?? [], null); $this->setIfExists('rare_device_percentile_bucket', $data ?? [], null); @@ -688,6 +705,12 @@ public function listInvalidProperties(): array if (null === $this->container['timestamp']) { $invalidProperties[] = "'timestamp' can't be null"; } + if (null === $this->container['ip_info']) { + $invalidProperties[] = "'ip_info' can't be null"; + } + if (null === $this->container['source']) { + $invalidProperties[] = "'source' can't be null"; + } if (!is_null($this->container['proxy_ml_score']) && ($this->container['proxy_ml_score'] > 1)) { $invalidProperties[] = "invalid value for 'proxy_ml_score', must be smaller than or equal to 1."; } @@ -760,20 +783,263 @@ public function setEventId(string $event_id): self * Gets timestamp. * */ - public function getTimestamp(): ?int + public function getTimestamp(): ?int + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp. + * + * @param int $timestamp timestamp of the event with millisecond precision in Unix time + * + */ + public function setTimestamp(int $timestamp): self + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets linked_id. + * + */ + public function getLinkedId(): ?string + { + return $this->container['linked_id']; + } + + /** + * Sets linked_id. + * + * @param string $linked_id a customer-provided id that was sent with the request + * + */ + public function setLinkedId(string $linked_id): self + { + $this->container['linked_id'] = $linked_id; + + return $this; + } + + /** + * Gets tags. + * + * @return array|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags. + * + * @param array $tags a customer-provided value or an object that was sent with the identification request or updated later + * + */ + public function setTags(array $tags): self + { + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets url. + * + */ + public function getUrl(): ?string + { + return $this->container['url']; + } + + /** + * Sets url. + * + * @param string $url page URL from which the request was sent + * + */ + public function setUrl(string $url): self + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets bot_info. + * + */ + public function getBotInfo(): ?BotInfo + { + return $this->container['bot_info']; + } + + /** + * Sets bot_info. + * + * @param BotInfo $bot_info bot_info + * + */ + public function setBotInfo(BotInfo $bot_info): self + { + $this->container['bot_info'] = $bot_info; + + return $this; + } + + /** + * Gets ip_info. + * + */ + public function getIpInfo(): ?IPInfo + { + return $this->container['ip_info']; + } + + /** + * Sets ip_info. + * + * @param IPInfo $ip_info ip_info + * + */ + public function setIpInfo(IPInfo $ip_info): self + { + $this->container['ip_info'] = $ip_info; + + return $this; + } + + /** + * Gets proxy. + * + */ + public function getProxy(): ?bool + { + return $this->container['proxy']; + } + + /** + * Sets proxy. + * + * @param bool $proxy IP address was used by a public proxy provider or belonged to a known recent residential proxy + * + */ + public function setProxy(bool $proxy): self + { + $this->container['proxy'] = $proxy; + + return $this; + } + + /** + * Gets proxy_confidence. + * + */ + public function getProxyConfidence(): ProxyConfidence|string|null + { + return $this->container['proxy_confidence']; + } + + /** + * Sets proxy_confidence. + * + * @param ProxyConfidence|string $proxy_confidence proxy_confidence + * + */ + public function setProxyConfidence(ProxyConfidence|string $proxy_confidence): self + { + $this->container['proxy_confidence'] = $proxy_confidence; + + return $this; + } + + /** + * Gets proxy_details. + * + */ + public function getProxyDetails(): ?ProxyDetails + { + return $this->container['proxy_details']; + } + + /** + * Sets proxy_details. + * + * @param ProxyDetails $proxy_details proxy_details + * + */ + public function setProxyDetails(ProxyDetails $proxy_details): self + { + $this->container['proxy_details'] = $proxy_details; + + return $this; + } + + /** + * Gets vpn. + * + */ + public function getVpn(): ?bool + { + return $this->container['vpn']; + } + + /** + * Sets vpn. + * + * @param bool $vpn VPN or other anonymizing service has been used when sending the request + * + */ + public function setVpn(bool $vpn): self + { + $this->container['vpn'] = $vpn; + + return $this; + } + + /** + * Gets vpn_confidence. + * + */ + public function getVpnConfidence(): string|VpnConfidence|null + { + return $this->container['vpn_confidence']; + } + + /** + * Sets vpn_confidence. + * + * @param VpnConfidence|string $vpn_confidence vpn_confidence + * + */ + public function setVpnConfidence(string|VpnConfidence $vpn_confidence): self + { + $this->container['vpn_confidence'] = $vpn_confidence; + + return $this; + } + + /** + * Gets vpn_methods. + * + */ + public function getVpnMethods(): ?VpnMethods { - return $this->container['timestamp']; + return $this->container['vpn_methods']; } /** - * Sets timestamp. + * Sets vpn_methods. * - * @param int $timestamp timestamp of the event with millisecond precision in Unix time + * @param VpnMethods $vpn_methods vpn_methods * */ - public function setTimestamp(int $timestamp): self + public function setVpnMethods(VpnMethods $vpn_methods): self { - $this->container['timestamp'] = $timestamp; + $this->container['vpn_methods'] = $vpn_methods; return $this; } @@ -822,28 +1088,6 @@ public function setIncrementalIdentificationStatus(IncrementalIdentificationStat return $this; } - /** - * Gets linked_id. - * - */ - public function getLinkedId(): ?string - { - return $this->container['linked_id']; - } - - /** - * Sets linked_id. - * - * @param string $linked_id a customer-provided id that was sent with the request - * - */ - public function setLinkedId(string $linked_id): self - { - $this->container['linked_id'] = $linked_id; - - return $this; - } - /** * Gets environment_id. * @@ -878,7 +1122,7 @@ public function getSuspect(): ?bool /** * Sets suspect. * - * @param bool $suspect Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://docs.fingerprint.com/reference/server-api-v4-update-event). + * @param bool $suspect Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://docs.fingerprint.com/reference/server-api-update-event). * */ public function setSuspect(bool $suspect): self @@ -935,6 +1179,8 @@ public function setReplayed(bool $replayed): self /** * Gets identification. * + * SPIKE INTER-2457 — This getter still exists. PHP did not split Event into + * a union, so existing `$event->getIdentification()` call sites keep working. */ public function getIdentification(): ?Identification { @@ -976,51 +1222,6 @@ public function setSupplementaryIdHighRecall(SupplementaryIDHighRecall $suppleme return $this; } - /** - * Gets tags. - * - * @return array|null - */ - public function getTags(): ?array - { - return $this->container['tags']; - } - - /** - * Sets tags. - * - * @param array $tags a customer-provided value or an object that was sent with the identification request or updated later - * - */ - public function setTags(array $tags): self - { - $this->container['tags'] = $tags; - - return $this; - } - - /** - * Gets url. - * - */ - public function getUrl(): ?string - { - return $this->container['url']; - } - - /** - * Sets url. - * - * @param string $url page URL from which the request was sent - * - */ - public function setUrl(string $url): self - { - $this->container['url'] = $url; - - return $this; - } - /** * Gets bundle_id. * @@ -1307,28 +1508,6 @@ public function setBotType(string $bot_type): self return $this; } - /** - * Gets bot_info. - * - */ - public function getBotInfo(): ?BotInfo - { - return $this->container['bot_info']; - } - - /** - * Sets bot_info. - * - * @param BotInfo $bot_info bot_info - * - */ - public function setBotInfo(BotInfo $bot_info): self - { - $this->container['bot_info'] = $bot_info; - - return $this; - } - /** * Gets cloned_app. * @@ -1461,94 +1640,6 @@ public function setIpBlocklist(IPBlockList $ip_blocklist): self return $this; } - /** - * Gets ip_info. - * - */ - public function getIpInfo(): ?IPInfo - { - return $this->container['ip_info']; - } - - /** - * Sets ip_info. - * - * @param IPInfo $ip_info ip_info - * - */ - public function setIpInfo(IPInfo $ip_info): self - { - $this->container['ip_info'] = $ip_info; - - return $this; - } - - /** - * Gets proxy. - * - */ - public function getProxy(): ?bool - { - return $this->container['proxy']; - } - - /** - * Sets proxy. - * - * @param bool $proxy IP address was used by a public proxy provider or belonged to a known recent residential proxy - * - */ - public function setProxy(bool $proxy): self - { - $this->container['proxy'] = $proxy; - - return $this; - } - - /** - * Gets proxy_confidence. - * - */ - public function getProxyConfidence(): ProxyConfidence|string|null - { - return $this->container['proxy_confidence']; - } - - /** - * Sets proxy_confidence. - * - * @param ProxyConfidence|string $proxy_confidence proxy_confidence - * - */ - public function setProxyConfidence(ProxyConfidence|string $proxy_confidence): self - { - $this->container['proxy_confidence'] = $proxy_confidence; - - return $this; - } - - /** - * Gets proxy_details. - * - */ - public function getProxyDetails(): ?ProxyDetails - { - return $this->container['proxy_details']; - } - - /** - * Sets proxy_details. - * - * @param ProxyDetails $proxy_details proxy_details - * - */ - public function setProxyDetails(ProxyDetails $proxy_details): self - { - $this->container['proxy_details'] = $proxy_details; - - return $this; - } - /** * Gets proxy_ml_score. * @@ -1944,50 +2035,6 @@ public function setVirtualMachineMlScore(float $virtual_machine_ml_score): self return $this; } - /** - * Gets vpn. - * - */ - public function getVpn(): ?bool - { - return $this->container['vpn']; - } - - /** - * Sets vpn. - * - * @param bool $vpn VPN or other anonymizing service has been used when sending the request - * - */ - public function setVpn(bool $vpn): self - { - $this->container['vpn'] = $vpn; - - return $this; - } - - /** - * Gets vpn_confidence. - * - */ - public function getVpnConfidence(): string|VpnConfidence|null - { - return $this->container['vpn_confidence']; - } - - /** - * Sets vpn_confidence. - * - * @param VpnConfidence|string $vpn_confidence vpn_confidence - * - */ - public function setVpnConfidence(string|VpnConfidence $vpn_confidence): self - { - $this->container['vpn_confidence'] = $vpn_confidence; - - return $this; - } - /** * Gets vpn_ml_score. * @@ -2061,28 +2108,6 @@ public function setVpnOriginCountry(string $vpn_origin_country): self return $this; } - /** - * Gets vpn_methods. - * - */ - public function getVpnMethods(): ?VpnMethods - { - return $this->container['vpn_methods']; - } - - /** - * Sets vpn_methods. - * - * @param VpnMethods $vpn_methods vpn_methods - * - */ - public function setVpnMethods(VpnMethods $vpn_methods): self - { - $this->container['vpn_methods'] = $vpn_methods; - - return $this; - } - /** * Gets high_activity_device. * diff --git a/src/Model/EventDevice.php b/src/Model/EventDevice.php new file mode 100644 index 000000000..e50957e53 --- /dev/null +++ b/src/Model/EventDevice.php @@ -0,0 +1,2319 @@ + + * + * @noinspection GrazieInspection + * @noinspection RedundantSuppression + */ +class EventDevice implements ModelInterface, \ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + */ + protected static string $openAPIModelName = 'EventDevice'; + + /** + * Array of property to type mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $openAPITypes = [ + 'event_id' => 'string', + 'timestamp' => 'int', + 'linked_id' => 'string', + 'tags' => 'array', + 'url' => 'string', + 'bot_info' => '\Fingerprint\ServerSdk\Model\BotInfo', + 'ip_info' => '\Fingerprint\ServerSdk\Model\IPInfo', + 'proxy' => 'bool', + 'proxy_confidence' => '\Fingerprint\ServerSdk\Model\ProxyConfidence', + 'proxy_details' => '\Fingerprint\ServerSdk\Model\ProxyDetails', + 'vpn' => 'bool', + 'vpn_confidence' => '\Fingerprint\ServerSdk\Model\VpnConfidence', + 'vpn_methods' => '\Fingerprint\ServerSdk\Model\VpnMethods', + 'source' => '\Fingerprint\ServerSdk\Model\EventSource', + 'incremental_identification_status' => '\Fingerprint\ServerSdk\Model\IncrementalIdentificationStatus', + 'environment_id' => 'string', + 'suspect' => 'bool', + 'sdk' => '\Fingerprint\ServerSdk\Model\SDK', + 'replayed' => 'bool', + 'identification' => '\Fingerprint\ServerSdk\Model\Identification', + 'supplementary_id_high_recall' => '\Fingerprint\ServerSdk\Model\SupplementaryIDHighRecall', + 'bundle_id' => 'string', + 'package_name' => 'string', + 'ip_address' => 'string', + 'user_agent' => 'string', + 'device' => 'string', + 'os' => 'string', + 'os_version' => 'string', + 'client_referrer' => 'string', + 'browser_details' => '\Fingerprint\ServerSdk\Model\BrowserDetails', + 'proximity' => '\Fingerprint\ServerSdk\Model\Proximity', + 'active_call' => 'bool', + 'bot' => '\Fingerprint\ServerSdk\Model\BotResult', + 'bot_type' => 'string', + 'cloned_app' => 'bool', + 'developer_tools' => 'bool', + 'emulator' => 'bool', + 'factory_reset_timestamp' => 'int', + 'frida' => 'bool', + 'ip_blocklist' => '\Fingerprint\ServerSdk\Model\IPBlockList', + 'proxy_ml_score' => 'float', + 'incognito' => 'bool', + 'jailbroken' => 'bool', + 'location_spoofing' => 'bool', + 'mitm_attack' => 'bool', + 'privacy_settings' => 'bool', + 'root_apps' => 'bool', + 'rule_action' => '\Fingerprint\ServerSdk\Model\EventRuleAction', + 'simulator' => 'bool', + 'suspect_score' => 'int', + 'tampering' => 'bool', + 'tampering_confidence' => '\Fingerprint\ServerSdk\Model\TamperingConfidence', + 'tampering_ml_score' => 'float', + 'tampering_details' => '\Fingerprint\ServerSdk\Model\TamperingDetails', + 'velocity' => '\Fingerprint\ServerSdk\Model\Velocity', + 'virtual_machine' => 'bool', + 'virtual_machine_ml_score' => 'float', + 'vpn_ml_score' => 'float', + 'vpn_origin_timezone' => 'string', + 'vpn_origin_country' => 'string', + 'high_activity_device' => 'bool', + 'rare_device' => 'bool', + 'rare_device_percentile_bucket' => '\Fingerprint\ServerSdk\Model\RareDevicePercentileBucket', + 'raw_device_attributes' => '\Fingerprint\ServerSdk\Model\RawDeviceAttributes', + 'labels' => '\Fingerprint\ServerSdk\Model\LabelsInner[]', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + * + * @phpstan-var array + * + * @psalm-var array + */ + protected static array $openAPIFormats = [ + 'event_id' => null, + 'timestamp' => 'int64', + 'linked_id' => null, + 'tags' => null, + 'url' => null, + 'bot_info' => null, + 'ip_info' => null, + 'proxy' => null, + 'proxy_confidence' => null, + 'proxy_details' => null, + 'vpn' => null, + 'vpn_confidence' => null, + 'vpn_methods' => null, + 'source' => null, + 'incremental_identification_status' => null, + 'environment_id' => null, + 'suspect' => null, + 'sdk' => null, + 'replayed' => null, + 'identification' => null, + 'supplementary_id_high_recall' => null, + 'bundle_id' => null, + 'package_name' => null, + 'ip_address' => null, + 'user_agent' => null, + 'device' => null, + 'os' => null, + 'os_version' => null, + 'client_referrer' => null, + 'browser_details' => null, + 'proximity' => null, + 'active_call' => null, + 'bot' => null, + 'bot_type' => null, + 'cloned_app' => null, + 'developer_tools' => null, + 'emulator' => null, + 'factory_reset_timestamp' => 'int64', + 'frida' => null, + 'ip_blocklist' => null, + 'proxy_ml_score' => 'double', + 'incognito' => null, + 'jailbroken' => null, + 'location_spoofing' => null, + 'mitm_attack' => null, + 'privacy_settings' => null, + 'root_apps' => null, + 'rule_action' => null, + 'simulator' => null, + 'suspect_score' => null, + 'tampering' => null, + 'tampering_confidence' => null, + 'tampering_ml_score' => 'double', + 'tampering_details' => null, + 'velocity' => null, + 'virtual_machine' => null, + 'virtual_machine_ml_score' => 'double', + 'vpn_ml_score' => 'double', + 'vpn_origin_timezone' => null, + 'vpn_origin_country' => null, + 'high_activity_device' => null, + 'rare_device' => null, + 'rare_device_percentile_bucket' => null, + 'raw_device_attributes' => null, + 'labels' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization. + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'event_id' => false, + 'timestamp' => false, + 'linked_id' => false, + 'tags' => false, + 'url' => false, + 'bot_info' => false, + 'ip_info' => false, + 'proxy' => false, + 'proxy_confidence' => false, + 'proxy_details' => false, + 'vpn' => false, + 'vpn_confidence' => false, + 'vpn_methods' => false, + 'source' => false, + 'incremental_identification_status' => false, + 'environment_id' => false, + 'suspect' => false, + 'sdk' => false, + 'replayed' => false, + 'identification' => false, + 'supplementary_id_high_recall' => false, + 'bundle_id' => false, + 'package_name' => false, + 'ip_address' => false, + 'user_agent' => false, + 'device' => false, + 'os' => false, + 'os_version' => false, + 'client_referrer' => false, + 'browser_details' => false, + 'proximity' => false, + 'active_call' => false, + 'bot' => false, + 'bot_type' => false, + 'cloned_app' => false, + 'developer_tools' => false, + 'emulator' => false, + 'factory_reset_timestamp' => false, + 'frida' => false, + 'ip_blocklist' => false, + 'proxy_ml_score' => false, + 'incognito' => false, + 'jailbroken' => false, + 'location_spoofing' => false, + 'mitm_attack' => false, + 'privacy_settings' => false, + 'root_apps' => false, + 'rule_action' => false, + 'simulator' => false, + 'suspect_score' => false, + 'tampering' => false, + 'tampering_confidence' => false, + 'tampering_ml_score' => false, + 'tampering_details' => false, + 'velocity' => false, + 'virtual_machine' => false, + 'virtual_machine_ml_score' => false, + 'vpn_ml_score' => false, + 'vpn_origin_timezone' => false, + 'vpn_origin_country' => false, + 'high_activity_device' => false, + 'rare_device' => false, + 'rare_device_percentile_bucket' => false, + 'raw_device_attributes' => false, + 'labels' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here. + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'event_id' => 'event_id', + 'timestamp' => 'timestamp', + 'linked_id' => 'linked_id', + 'tags' => 'tags', + 'url' => 'url', + 'bot_info' => 'bot_info', + 'ip_info' => 'ip_info', + 'proxy' => 'proxy', + 'proxy_confidence' => 'proxy_confidence', + 'proxy_details' => 'proxy_details', + 'vpn' => 'vpn', + 'vpn_confidence' => 'vpn_confidence', + 'vpn_methods' => 'vpn_methods', + 'source' => 'source', + 'incremental_identification_status' => 'incremental_identification_status', + 'environment_id' => 'environment_id', + 'suspect' => 'suspect', + 'sdk' => 'sdk', + 'replayed' => 'replayed', + 'identification' => 'identification', + 'supplementary_id_high_recall' => 'supplementary_id_high_recall', + 'bundle_id' => 'bundle_id', + 'package_name' => 'package_name', + 'ip_address' => 'ip_address', + 'user_agent' => 'user_agent', + 'device' => 'device', + 'os' => 'os', + 'os_version' => 'os_version', + 'client_referrer' => 'client_referrer', + 'browser_details' => 'browser_details', + 'proximity' => 'proximity', + 'active_call' => 'active_call', + 'bot' => 'bot', + 'bot_type' => 'bot_type', + 'cloned_app' => 'cloned_app', + 'developer_tools' => 'developer_tools', + 'emulator' => 'emulator', + 'factory_reset_timestamp' => 'factory_reset_timestamp', + 'frida' => 'frida', + 'ip_blocklist' => 'ip_blocklist', + 'proxy_ml_score' => 'proxy_ml_score', + 'incognito' => 'incognito', + 'jailbroken' => 'jailbroken', + 'location_spoofing' => 'location_spoofing', + 'mitm_attack' => 'mitm_attack', + 'privacy_settings' => 'privacy_settings', + 'root_apps' => 'root_apps', + 'rule_action' => 'rule_action', + 'simulator' => 'simulator', + 'suspect_score' => 'suspect_score', + 'tampering' => 'tampering', + 'tampering_confidence' => 'tampering_confidence', + 'tampering_ml_score' => 'tampering_ml_score', + 'tampering_details' => 'tampering_details', + 'velocity' => 'velocity', + 'virtual_machine' => 'virtual_machine', + 'virtual_machine_ml_score' => 'virtual_machine_ml_score', + 'vpn_ml_score' => 'vpn_ml_score', + 'vpn_origin_timezone' => 'vpn_origin_timezone', + 'vpn_origin_country' => 'vpn_origin_country', + 'high_activity_device' => 'high_activity_device', + 'rare_device' => 'rare_device', + 'rare_device_percentile_bucket' => 'rare_device_percentile_bucket', + 'raw_device_attributes' => 'raw_device_attributes', + 'labels' => 'labels', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'event_id' => 'setEventId', + 'timestamp' => 'setTimestamp', + 'linked_id' => 'setLinkedId', + 'tags' => 'setTags', + 'url' => 'setUrl', + 'bot_info' => 'setBotInfo', + 'ip_info' => 'setIpInfo', + 'proxy' => 'setProxy', + 'proxy_confidence' => 'setProxyConfidence', + 'proxy_details' => 'setProxyDetails', + 'vpn' => 'setVpn', + 'vpn_confidence' => 'setVpnConfidence', + 'vpn_methods' => 'setVpnMethods', + 'source' => 'setSource', + 'incremental_identification_status' => 'setIncrementalIdentificationStatus', + 'environment_id' => 'setEnvironmentId', + 'suspect' => 'setSuspect', + 'sdk' => 'setSdk', + 'replayed' => 'setReplayed', + 'identification' => 'setIdentification', + 'supplementary_id_high_recall' => 'setSupplementaryIdHighRecall', + 'bundle_id' => 'setBundleId', + 'package_name' => 'setPackageName', + 'ip_address' => 'setIpAddress', + 'user_agent' => 'setUserAgent', + 'device' => 'setDevice', + 'os' => 'setOs', + 'os_version' => 'setOsVersion', + 'client_referrer' => 'setClientReferrer', + 'browser_details' => 'setBrowserDetails', + 'proximity' => 'setProximity', + 'active_call' => 'setActiveCall', + 'bot' => 'setBot', + 'bot_type' => 'setBotType', + 'cloned_app' => 'setClonedApp', + 'developer_tools' => 'setDeveloperTools', + 'emulator' => 'setEmulator', + 'factory_reset_timestamp' => 'setFactoryResetTimestamp', + 'frida' => 'setFrida', + 'ip_blocklist' => 'setIpBlocklist', + 'proxy_ml_score' => 'setProxyMlScore', + 'incognito' => 'setIncognito', + 'jailbroken' => 'setJailbroken', + 'location_spoofing' => 'setLocationSpoofing', + 'mitm_attack' => 'setMitmAttack', + 'privacy_settings' => 'setPrivacySettings', + 'root_apps' => 'setRootApps', + 'rule_action' => 'setRuleAction', + 'simulator' => 'setSimulator', + 'suspect_score' => 'setSuspectScore', + 'tampering' => 'setTampering', + 'tampering_confidence' => 'setTamperingConfidence', + 'tampering_ml_score' => 'setTamperingMlScore', + 'tampering_details' => 'setTamperingDetails', + 'velocity' => 'setVelocity', + 'virtual_machine' => 'setVirtualMachine', + 'virtual_machine_ml_score' => 'setVirtualMachineMlScore', + 'vpn_ml_score' => 'setVpnMlScore', + 'vpn_origin_timezone' => 'setVpnOriginTimezone', + 'vpn_origin_country' => 'setVpnOriginCountry', + 'high_activity_device' => 'setHighActivityDevice', + 'rare_device' => 'setRareDevice', + 'rare_device_percentile_bucket' => 'setRareDevicePercentileBucket', + 'raw_device_attributes' => 'setRawDeviceAttributes', + 'labels' => 'setLabels', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'event_id' => 'getEventId', + 'timestamp' => 'getTimestamp', + 'linked_id' => 'getLinkedId', + 'tags' => 'getTags', + 'url' => 'getUrl', + 'bot_info' => 'getBotInfo', + 'ip_info' => 'getIpInfo', + 'proxy' => 'getProxy', + 'proxy_confidence' => 'getProxyConfidence', + 'proxy_details' => 'getProxyDetails', + 'vpn' => 'getVpn', + 'vpn_confidence' => 'getVpnConfidence', + 'vpn_methods' => 'getVpnMethods', + 'source' => 'getSource', + 'incremental_identification_status' => 'getIncrementalIdentificationStatus', + 'environment_id' => 'getEnvironmentId', + 'suspect' => 'getSuspect', + 'sdk' => 'getSdk', + 'replayed' => 'getReplayed', + 'identification' => 'getIdentification', + 'supplementary_id_high_recall' => 'getSupplementaryIdHighRecall', + 'bundle_id' => 'getBundleId', + 'package_name' => 'getPackageName', + 'ip_address' => 'getIpAddress', + 'user_agent' => 'getUserAgent', + 'device' => 'getDevice', + 'os' => 'getOs', + 'os_version' => 'getOsVersion', + 'client_referrer' => 'getClientReferrer', + 'browser_details' => 'getBrowserDetails', + 'proximity' => 'getProximity', + 'active_call' => 'getActiveCall', + 'bot' => 'getBot', + 'bot_type' => 'getBotType', + 'cloned_app' => 'getClonedApp', + 'developer_tools' => 'getDeveloperTools', + 'emulator' => 'getEmulator', + 'factory_reset_timestamp' => 'getFactoryResetTimestamp', + 'frida' => 'getFrida', + 'ip_blocklist' => 'getIpBlocklist', + 'proxy_ml_score' => 'getProxyMlScore', + 'incognito' => 'getIncognito', + 'jailbroken' => 'getJailbroken', + 'location_spoofing' => 'getLocationSpoofing', + 'mitm_attack' => 'getMitmAttack', + 'privacy_settings' => 'getPrivacySettings', + 'root_apps' => 'getRootApps', + 'rule_action' => 'getRuleAction', + 'simulator' => 'getSimulator', + 'suspect_score' => 'getSuspectScore', + 'tampering' => 'getTampering', + 'tampering_confidence' => 'getTamperingConfidence', + 'tampering_ml_score' => 'getTamperingMlScore', + 'tampering_details' => 'getTamperingDetails', + 'velocity' => 'getVelocity', + 'virtual_machine' => 'getVirtualMachine', + 'virtual_machine_ml_score' => 'getVirtualMachineMlScore', + 'vpn_ml_score' => 'getVpnMlScore', + 'vpn_origin_timezone' => 'getVpnOriginTimezone', + 'vpn_origin_country' => 'getVpnOriginCountry', + 'high_activity_device' => 'getHighActivityDevice', + 'rare_device' => 'getRareDevice', + 'rare_device_percentile_bucket' => 'getRareDevicePercentileBucket', + 'raw_device_attributes' => 'getRawDeviceAttributes', + 'labels' => 'getLabels', + ]; + + /** + * Associative array for storing property values. + */ + protected array $container = []; + + /** + * Constructor. + * + * @param array|null $data Associated array of property values + * initializing the model + * + * @noinspection DuplicatedCode + */ + public function __construct(?array $data = null) + { + $this->setIfExists('event_id', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('linked_id', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('bot_info', $data ?? [], null); + $this->setIfExists('ip_info', $data ?? [], null); + $this->setIfExists('proxy', $data ?? [], null); + $this->setIfExists('proxy_confidence', $data ?? [], null); + $this->setIfExists('proxy_details', $data ?? [], null); + $this->setIfExists('vpn', $data ?? [], null); + $this->setIfExists('vpn_confidence', $data ?? [], null); + $this->setIfExists('vpn_methods', $data ?? [], null); + $this->setIfExists('source', $data ?? [], null); + $this->setIfExists('incremental_identification_status', $data ?? [], null); + $this->setIfExists('environment_id', $data ?? [], null); + $this->setIfExists('suspect', $data ?? [], null); + $this->setIfExists('sdk', $data ?? [], null); + $this->setIfExists('replayed', $data ?? [], null); + $this->setIfExists('identification', $data ?? [], null); + $this->setIfExists('supplementary_id_high_recall', $data ?? [], null); + $this->setIfExists('bundle_id', $data ?? [], null); + $this->setIfExists('package_name', $data ?? [], null); + $this->setIfExists('ip_address', $data ?? [], null); + $this->setIfExists('user_agent', $data ?? [], null); + $this->setIfExists('device', $data ?? [], null); + $this->setIfExists('os', $data ?? [], null); + $this->setIfExists('os_version', $data ?? [], null); + $this->setIfExists('client_referrer', $data ?? [], null); + $this->setIfExists('browser_details', $data ?? [], null); + $this->setIfExists('proximity', $data ?? [], null); + $this->setIfExists('active_call', $data ?? [], null); + $this->setIfExists('bot', $data ?? [], null); + $this->setIfExists('bot_type', $data ?? [], null); + $this->setIfExists('cloned_app', $data ?? [], null); + $this->setIfExists('developer_tools', $data ?? [], null); + $this->setIfExists('emulator', $data ?? [], null); + $this->setIfExists('factory_reset_timestamp', $data ?? [], null); + $this->setIfExists('frida', $data ?? [], null); + $this->setIfExists('ip_blocklist', $data ?? [], null); + $this->setIfExists('proxy_ml_score', $data ?? [], null); + $this->setIfExists('incognito', $data ?? [], null); + $this->setIfExists('jailbroken', $data ?? [], null); + $this->setIfExists('location_spoofing', $data ?? [], null); + $this->setIfExists('mitm_attack', $data ?? [], null); + $this->setIfExists('privacy_settings', $data ?? [], null); + $this->setIfExists('root_apps', $data ?? [], null); + $this->setIfExists('rule_action', $data ?? [], null); + $this->setIfExists('simulator', $data ?? [], null); + $this->setIfExists('suspect_score', $data ?? [], null); + $this->setIfExists('tampering', $data ?? [], null); + $this->setIfExists('tampering_confidence', $data ?? [], null); + $this->setIfExists('tampering_ml_score', $data ?? [], null); + $this->setIfExists('tampering_details', $data ?? [], null); + $this->setIfExists('velocity', $data ?? [], null); + $this->setIfExists('virtual_machine', $data ?? [], null); + $this->setIfExists('virtual_machine_ml_score', $data ?? [], null); + $this->setIfExists('vpn_ml_score', $data ?? [], null); + $this->setIfExists('vpn_origin_timezone', $data ?? [], null); + $this->setIfExists('vpn_origin_country', $data ?? [], null); + $this->setIfExists('high_activity_device', $data ?? [], null); + $this->setIfExists('rare_device', $data ?? [], null); + $this->setIfExists('rare_device_percentile_bucket', $data ?? [], null); + $this->setIfExists('raw_device_attributes', $data ?? [], null); + $this->setIfExists('labels', $data ?? [], null); + } + + /** + * Gets the string presentation of the object. + * + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + * + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Checks if a property is nullable. + * + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * 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::$openAPIModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['event_id']) { + $invalidProperties[] = "'event_id' can't be null"; + } + if (null === $this->container['timestamp']) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if (null === $this->container['source']) { + $invalidProperties[] = "'source' can't be null"; + } + if (!is_null($this->container['proxy_ml_score']) && ($this->container['proxy_ml_score'] > 1)) { + $invalidProperties[] = "invalid value for 'proxy_ml_score', must be smaller than or equal to 1."; + } + + if (!is_null($this->container['proxy_ml_score']) && ($this->container['proxy_ml_score'] < 0)) { + $invalidProperties[] = "invalid value for 'proxy_ml_score', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['tampering_ml_score']) && ($this->container['tampering_ml_score'] > 1)) { + $invalidProperties[] = "invalid value for 'tampering_ml_score', must be smaller than or equal to 1."; + } + + if (!is_null($this->container['tampering_ml_score']) && ($this->container['tampering_ml_score'] < 0)) { + $invalidProperties[] = "invalid value for 'tampering_ml_score', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['virtual_machine_ml_score']) && ($this->container['virtual_machine_ml_score'] > 1)) { + $invalidProperties[] = "invalid value for 'virtual_machine_ml_score', must be smaller than or equal to 1."; + } + + if (!is_null($this->container['virtual_machine_ml_score']) && ($this->container['virtual_machine_ml_score'] < 0)) { + $invalidProperties[] = "invalid value for 'virtual_machine_ml_score', must be bigger than or equal to 0."; + } + + if (!is_null($this->container['vpn_ml_score']) && ($this->container['vpn_ml_score'] > 1)) { + $invalidProperties[] = "invalid value for 'vpn_ml_score', must be smaller than or equal to 1."; + } + + if (!is_null($this->container['vpn_ml_score']) && ($this->container['vpn_ml_score'] < 0)) { + $invalidProperties[] = "invalid value for 'vpn_ml_score', must be bigger than or equal to 0."; + } + + 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 event_id. + * + */ + public function getEventId(): ?string + { + return $this->container['event_id']; + } + + /** + * Sets event_id. + * + * @param string $event_id Unique identifier of the user's request. The first portion of the event_id is a unix epoch milliseconds timestamp. + * + */ + public function setEventId(string $event_id): self + { + $this->container['event_id'] = $event_id; + + return $this; + } + + /** + * Gets timestamp. + * + */ + public function getTimestamp(): ?int + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp. + * + * @param int $timestamp timestamp of the event with millisecond precision in Unix time + * + */ + public function setTimestamp(int $timestamp): self + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets linked_id. + * + */ + public function getLinkedId(): ?string + { + return $this->container['linked_id']; + } + + /** + * Sets linked_id. + * + * @param string $linked_id a customer-provided id that was sent with the request + * + */ + public function setLinkedId(string $linked_id): self + { + $this->container['linked_id'] = $linked_id; + + return $this; + } + + /** + * Gets tags. + * + * @return array|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags. + * + * @param array $tags a customer-provided value or an object that was sent with the identification request or updated later + * + */ + public function setTags(array $tags): self + { + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets url. + * + */ + public function getUrl(): ?string + { + return $this->container['url']; + } + + /** + * Sets url. + * + * @param string $url page URL from which the request was sent + * + */ + public function setUrl(string $url): self + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets bot_info. + * + */ + public function getBotInfo(): ?BotInfo + { + return $this->container['bot_info']; + } + + /** + * Sets bot_info. + * + * @param BotInfo $bot_info bot_info + * + */ + public function setBotInfo(BotInfo $bot_info): self + { + $this->container['bot_info'] = $bot_info; + + return $this; + } + + /** + * Gets ip_info. + * + */ + public function getIpInfo(): ?IPInfo + { + return $this->container['ip_info']; + } + + /** + * Sets ip_info. + * + * @param IPInfo $ip_info ip_info + * + */ + public function setIpInfo(IPInfo $ip_info): self + { + $this->container['ip_info'] = $ip_info; + + return $this; + } + + /** + * Gets proxy. + * + */ + public function getProxy(): ?bool + { + return $this->container['proxy']; + } + + /** + * Sets proxy. + * + * @param bool $proxy IP address was used by a public proxy provider or belonged to a known recent residential proxy + * + */ + public function setProxy(bool $proxy): self + { + $this->container['proxy'] = $proxy; + + return $this; + } + + /** + * Gets proxy_confidence. + * + */ + public function getProxyConfidence(): ProxyConfidence|string|null + { + return $this->container['proxy_confidence']; + } + + /** + * Sets proxy_confidence. + * + * @param ProxyConfidence|string $proxy_confidence proxy_confidence + * + */ + public function setProxyConfidence(ProxyConfidence|string $proxy_confidence): self + { + $this->container['proxy_confidence'] = $proxy_confidence; + + return $this; + } + + /** + * Gets proxy_details. + * + */ + public function getProxyDetails(): ?ProxyDetails + { + return $this->container['proxy_details']; + } + + /** + * Sets proxy_details. + * + * @param ProxyDetails $proxy_details proxy_details + * + */ + public function setProxyDetails(ProxyDetails $proxy_details): self + { + $this->container['proxy_details'] = $proxy_details; + + return $this; + } + + /** + * Gets vpn. + * + */ + public function getVpn(): ?bool + { + return $this->container['vpn']; + } + + /** + * Sets vpn. + * + * @param bool $vpn VPN or other anonymizing service has been used when sending the request + * + */ + public function setVpn(bool $vpn): self + { + $this->container['vpn'] = $vpn; + + return $this; + } + + /** + * Gets vpn_confidence. + * + */ + public function getVpnConfidence(): string|VpnConfidence|null + { + return $this->container['vpn_confidence']; + } + + /** + * Sets vpn_confidence. + * + * @param VpnConfidence|string $vpn_confidence vpn_confidence + * + */ + public function setVpnConfidence(string|VpnConfidence $vpn_confidence): self + { + $this->container['vpn_confidence'] = $vpn_confidence; + + return $this; + } + + /** + * Gets vpn_methods. + * + */ + public function getVpnMethods(): ?VpnMethods + { + return $this->container['vpn_methods']; + } + + /** + * Sets vpn_methods. + * + * @param VpnMethods $vpn_methods vpn_methods + * + */ + public function setVpnMethods(VpnMethods $vpn_methods): self + { + $this->container['vpn_methods'] = $vpn_methods; + + return $this; + } + + /** + * Gets source. + * + */ + public function getSource(): EventSource|string|null + { + return $this->container['source']; + } + + /** + * Sets source. + * + * @param EventSource|string $source source + * + */ + public function setSource(EventSource|string $source): self + { + $this->container['source'] = $source; + + return $this; + } + + /** + * Gets incremental_identification_status. + * + */ + public function getIncrementalIdentificationStatus(): IncrementalIdentificationStatus|string|null + { + return $this->container['incremental_identification_status']; + } + + /** + * Sets incremental_identification_status. + * + * @param IncrementalIdentificationStatus|string $incremental_identification_status incremental_identification_status + * + */ + public function setIncrementalIdentificationStatus(IncrementalIdentificationStatus|string $incremental_identification_status): self + { + $this->container['incremental_identification_status'] = $incremental_identification_status; + + return $this; + } + + /** + * Gets environment_id. + * + */ + public function getEnvironmentId(): ?string + { + return $this->container['environment_id']; + } + + /** + * Sets environment_id. + * + * @param string $environment_id environment Id of the event + * + */ + public function setEnvironmentId(string $environment_id): self + { + $this->container['environment_id'] = $environment_id; + + return $this; + } + + /** + * Gets suspect. + * + */ + public function getSuspect(): ?bool + { + return $this->container['suspect']; + } + + /** + * Sets suspect. + * + * @param bool $suspect Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://docs.fingerprint.com/reference/server-api-update-event). + * + */ + public function setSuspect(bool $suspect): self + { + $this->container['suspect'] = $suspect; + + return $this; + } + + /** + * Gets sdk. + * + */ + public function getSdk(): ?SDK + { + return $this->container['sdk']; + } + + /** + * Sets sdk. + * + * @param SDK $sdk sdk + * + */ + public function setSdk(SDK $sdk): self + { + $this->container['sdk'] = $sdk; + + return $this; + } + + /** + * Gets replayed. + * + */ + public function getReplayed(): ?bool + { + return $this->container['replayed']; + } + + /** + * Sets replayed. + * + * @param bool $replayed `true` if we determined that this payload was replayed, `false` otherwise + * + */ + public function setReplayed(bool $replayed): self + { + $this->container['replayed'] = $replayed; + + return $this; + } + + /** + * Gets identification. + * + */ + public function getIdentification(): ?Identification + { + return $this->container['identification']; + } + + /** + * Sets identification. + * + * @param Identification $identification identification + * + */ + public function setIdentification(Identification $identification): self + { + $this->container['identification'] = $identification; + + return $this; + } + + /** + * Gets supplementary_id_high_recall. + * + */ + public function getSupplementaryIdHighRecall(): ?SupplementaryIDHighRecall + { + return $this->container['supplementary_id_high_recall']; + } + + /** + * Sets supplementary_id_high_recall. + * + * @param SupplementaryIDHighRecall $supplementary_id_high_recall supplementary_id_high_recall + * + */ + public function setSupplementaryIdHighRecall(SupplementaryIDHighRecall $supplementary_id_high_recall): self + { + $this->container['supplementary_id_high_recall'] = $supplementary_id_high_recall; + + return $this; + } + + /** + * Gets bundle_id. + * + */ + public function getBundleId(): ?string + { + return $this->container['bundle_id']; + } + + /** + * Sets bundle_id. + * + * @param string $bundle_id bundle Id of the iOS application integrated with the Fingerprint SDK for the event + * + */ + public function setBundleId(string $bundle_id): self + { + $this->container['bundle_id'] = $bundle_id; + + return $this; + } + + /** + * Gets package_name. + * + */ + public function getPackageName(): ?string + { + return $this->container['package_name']; + } + + /** + * Sets package_name. + * + * @param string $package_name package name of the Android application integrated with the Fingerprint SDK for the event + * + */ + public function setPackageName(string $package_name): self + { + $this->container['package_name'] = $package_name; + + return $this; + } + + /** + * Gets ip_address. + * + */ + public function getIpAddress(): ?string + { + return $this->container['ip_address']; + } + + /** + * Sets ip_address. + * + * @param string $ip_address IP address of the requesting browser or bot + * + */ + public function setIpAddress(string $ip_address): self + { + $this->container['ip_address'] = $ip_address; + + return $this; + } + + /** + * Gets user_agent. + * + */ + public function getUserAgent(): ?string + { + return $this->container['user_agent']; + } + + /** + * Sets user_agent. + * + * @param string $user_agent user Agent of the client + * + */ + public function setUserAgent(string $user_agent): self + { + $this->container['user_agent'] = $user_agent; + + return $this; + } + + /** + * Gets device. + * + */ + public function getDevice(): ?string + { + return $this->container['device']; + } + + /** + * Sets device. + * + * @param string $device Device model or family extracted from the user agent string. On web, this field is also present inside `browser_details`. + * + */ + public function setDevice(string $device): self + { + $this->container['device'] = $device; + + return $this; + } + + /** + * Gets os. + * + */ + public function getOs(): ?string + { + return $this->container['os']; + } + + /** + * Sets os. + * + * @param string $os Operating system family extracted from the user agent string. On web, this field is also present inside `browser_details`. + * + */ + public function setOs(string $os): self + { + $this->container['os'] = $os; + + return $this; + } + + /** + * Gets os_version. + * + */ + public function getOsVersion(): ?string + { + return $this->container['os_version']; + } + + /** + * Sets os_version. + * + * @param string $os_version Operating system version string extracted from the user agent string. On web, this field is also present inside `browser_details`. + * + */ + public function setOsVersion(string $os_version): self + { + $this->container['os_version'] = $os_version; + + return $this; + } + + /** + * Gets client_referrer. + * + */ + public function getClientReferrer(): ?string + { + return $this->container['client_referrer']; + } + + /** + * Sets client_referrer. + * + * @param string $client_referrer Client Referrer field corresponds to the `document.referrer` field gathered during an identification request. The value is an empty string if the user navigated to the page directly (not through a link, but, for example, by using a bookmark). + * + */ + public function setClientReferrer(string $client_referrer): self + { + $this->container['client_referrer'] = $client_referrer; + + return $this; + } + + /** + * Gets browser_details. + * + */ + public function getBrowserDetails(): ?BrowserDetails + { + return $this->container['browser_details']; + } + + /** + * Sets browser_details. + * + * @param BrowserDetails $browser_details browser_details + * + */ + public function setBrowserDetails(BrowserDetails $browser_details): self + { + $this->container['browser_details'] = $browser_details; + + return $this; + } + + /** + * Gets proximity. + * + */ + public function getProximity(): ?Proximity + { + return $this->container['proximity']; + } + + /** + * Sets proximity. + * + * @param Proximity $proximity proximity + * + */ + public function setProximity(Proximity $proximity): self + { + $this->container['proximity'] = $proximity; + + return $this; + } + + /** + * Gets active_call. + * + */ + public function getActiveCall(): ?bool + { + return $this->container['active_call']; + } + + /** + * Sets active_call. + * + * @param bool $active_call Indicates whether the mobile device had an active call (cellular or VoIP) at the time of the request. Available from SDK 2.16.0+ on iOS and Android. + * + */ + public function setActiveCall(bool $active_call): self + { + $this->container['active_call'] = $active_call; + + return $this; + } + + /** + * Gets bot. + * + */ + public function getBot(): BotResult|string|null + { + return $this->container['bot']; + } + + /** + * Sets bot. + * + * @param BotResult|string $bot bot + * + */ + public function setBot(BotResult|string $bot): self + { + $this->container['bot'] = $bot; + + return $this; + } + + /** + * Gets bot_type. + * + */ + public function getBotType(): ?string + { + return $this->container['bot_type']; + } + + /** + * Sets bot_type. + * + * @param string $bot_type additional classification of the bot type if detected + * + */ + public function setBotType(string $bot_type): self + { + $this->container['bot_type'] = $bot_type; + + return $this; + } + + /** + * Gets cloned_app. + * + */ + public function getClonedApp(): ?bool + { + return $this->container['cloned_app']; + } + + /** + * Sets cloned_app. + * + * @param bool $cloned_app Android specific cloned application detection. There are 2 values: * `true` - Presence of app cloners work detected (e.g. fully cloned application found or launch of it inside of a not main working profile detected). * `false` - No signs of cloned application detected or the client is not Android. + * + */ + public function setClonedApp(bool $cloned_app): self + { + $this->container['cloned_app'] = $cloned_app; + + return $this; + } + + /** + * Gets developer_tools. + * + */ + public function getDeveloperTools(): ?bool + { + return $this->container['developer_tools']; + } + + /** + * Sets developer_tools. + * + * @param bool $developer_tools `true` if the browser has DevTools open (Chrome, Firefox) or the Android/iOS device has Developer Tools enabled, `false` otherwise + * + */ + public function setDeveloperTools(bool $developer_tools): self + { + $this->container['developer_tools'] = $developer_tools; + + return $this; + } + + /** + * Gets emulator. + * + */ + public function getEmulator(): ?bool + { + return $this->container['emulator']; + } + + /** + * Sets emulator. + * + * @param bool $emulator Android specific emulator detection. There are 2 values: * `true` - Emulated environment detected (e.g. launch inside of AVD). * `false` - No signs of emulated environment detected or the client is not Android. + * + */ + public function setEmulator(bool $emulator): self + { + $this->container['emulator'] = $emulator; + + return $this; + } + + /** + * Gets factory_reset_timestamp. + * + */ + public function getFactoryResetTimestamp(): ?int + { + return $this->container['factory_reset_timestamp']; + } + + /** + * Sets factory_reset_timestamp. + * + * @param int $factory_reset_timestamp The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. 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) as a value of 0. See [Factory Reset Detection](https://docs.fingerprint.com/docs/smart-signals-reference#factory-reset-detection) to learn more about this Smart Signal. + * + */ + public function setFactoryResetTimestamp(int $factory_reset_timestamp): self + { + $this->container['factory_reset_timestamp'] = $factory_reset_timestamp; + + return $this; + } + + /** + * Gets frida. + * + */ + public function getFrida(): ?bool + { + return $this->container['frida']; + } + + /** + * Sets frida. + * + * @param bool $frida [Frida](https://frida.re/docs/) detection for Android and iOS devices. There are 2 values: * `true` - Frida detected * `false` - No signs of Frida or the client is not a mobile device. + * + */ + public function setFrida(bool $frida): self + { + $this->container['frida'] = $frida; + + return $this; + } + + /** + * Gets ip_blocklist. + * + */ + public function getIpBlocklist(): ?IPBlockList + { + return $this->container['ip_blocklist']; + } + + /** + * Sets ip_blocklist. + * + * @param IPBlockList $ip_blocklist ip_blocklist + * + */ + public function setIpBlocklist(IPBlockList $ip_blocklist): self + { + $this->container['ip_blocklist'] = $ip_blocklist; + + return $this; + } + + /** + * Gets proxy_ml_score. + * + */ + public function getProxyMlScore(): ?float + { + return $this->container['proxy_ml_score']; + } + + /** + * Sets proxy_ml_score. + * + * @param float $proxy_ml_score Machine learning–based proxy score, represented as a floating-point value between 0 and 1 (inclusive), with up to three decimal places of precision. A higher score means a higher confidence in the positive `proxy` detection result. This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). + * + */ + public function setProxyMlScore(float $proxy_ml_score): self + { + if ($proxy_ml_score > 1) { + throw new \InvalidArgumentException('invalid value for $proxy_ml_score when calling EventDevice., must be smaller than or equal to 1.'); + } + if ($proxy_ml_score < 0) { + throw new \InvalidArgumentException('invalid value for $proxy_ml_score when calling EventDevice., must be bigger than or equal to 0.'); + } + + $this->container['proxy_ml_score'] = $proxy_ml_score; + + return $this; + } + + /** + * Gets incognito. + * + */ + public function getIncognito(): ?bool + { + return $this->container['incognito']; + } + + /** + * Sets incognito. + * + * @param bool $incognito `true` if we detected incognito mode used in the browser, `false` otherwise + * + */ + public function setIncognito(bool $incognito): self + { + $this->container['incognito'] = $incognito; + + return $this; + } + + /** + * Gets jailbroken. + * + */ + public function getJailbroken(): ?bool + { + return $this->container['jailbroken']; + } + + /** + * Sets jailbroken. + * + * @param bool $jailbroken iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. + * + */ + public function setJailbroken(bool $jailbroken): self + { + $this->container['jailbroken'] = $jailbroken; + + return $this; + } + + /** + * Gets location_spoofing. + * + */ + public function getLocationSpoofing(): ?bool + { + return $this->container['location_spoofing']; + } + + /** + * Sets location_spoofing. + * + * @param bool $location_spoofing flag indicating whether the request came from a mobile device with location spoofing enabled + * + */ + public function setLocationSpoofing(bool $location_spoofing): self + { + $this->container['location_spoofing'] = $location_spoofing; + + return $this; + } + + /** + * Gets mitm_attack. + * + */ + public function getMitmAttack(): ?bool + { + return $this->container['mitm_attack']; + } + + /** + * Sets mitm_attack. + * + * @param bool $mitm_attack * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://docs.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. + * + */ + public function setMitmAttack(bool $mitm_attack): self + { + $this->container['mitm_attack'] = $mitm_attack; + + return $this; + } + + /** + * Gets privacy_settings. + * + */ + public function getPrivacySettings(): ?bool + { + return $this->container['privacy_settings']; + } + + /** + * Sets privacy_settings. + * + * @param bool $privacy_settings `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. + * + */ + public function setPrivacySettings(bool $privacy_settings): self + { + $this->container['privacy_settings'] = $privacy_settings; + + return $this; + } + + /** + * Gets root_apps. + * + */ + public function getRootApps(): ?bool + { + return $this->container['root_apps']; + } + + /** + * Sets root_apps. + * + * @param bool $root_apps Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. + * + */ + public function setRootApps(bool $root_apps): self + { + $this->container['root_apps'] = $root_apps; + + return $this; + } + + /** + * Gets rule_action. + * + */ + public function getRuleAction(): ?EventRuleAction + { + return $this->container['rule_action']; + } + + /** + * Sets rule_action. + * + * @param EventRuleAction $rule_action rule_action + * + */ + public function setRuleAction(EventRuleAction $rule_action): self + { + $this->container['rule_action'] = $rule_action; + + return $this; + } + + /** + * Gets simulator. + * + */ + public function getSimulator(): ?bool + { + return $this->container['simulator']; + } + + /** + * Sets simulator. + * + * @param bool $simulator iOS specific simulator detection. There are 2 values: * `true` - Simulator environment detected. * `false` - No signs of simulator or the client is not iOS. + * + */ + public function setSimulator(bool $simulator): self + { + $this->container['simulator'] = $simulator; + + return $this; + } + + /** + * Gets suspect_score. + * + */ + public function getSuspectScore(): ?int + { + return $this->container['suspect_score']; + } + + /** + * Sets suspect_score. + * + * @param int $suspect_score Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://docs.fingerprint.com/docs/suspect-score + * + */ + public function setSuspectScore(int $suspect_score): self + { + $this->container['suspect_score'] = $suspect_score; + + return $this; + } + + /** + * Gets tampering. + * + */ + public function getTampering(): ?bool + { + return $this->container['tampering']; + } + + /** + * Sets tampering. + * + * @param bool $tampering The field can be used as a standalone flag for tampering detection. Alternatively, the more granular fields documented below can be used for workflows that require more context. * `true` if tampering is detected through an anomalous browser signature, anti-detect browser detection, or other tampering-related methods * `false` if none of the tampering checks return a positive result + * + */ + public function setTampering(bool $tampering): self + { + $this->container['tampering'] = $tampering; + + return $this; + } + + /** + * Gets tampering_confidence. + * + */ + public function getTamperingConfidence(): string|TamperingConfidence|null + { + return $this->container['tampering_confidence']; + } + + /** + * Sets tampering_confidence. + * + * @param TamperingConfidence|string $tampering_confidence tampering_confidence + * + */ + public function setTamperingConfidence(string|TamperingConfidence $tampering_confidence): self + { + $this->container['tampering_confidence'] = $tampering_confidence; + + return $this; + } + + /** + * Gets tampering_ml_score. + * + */ + public function getTamperingMlScore(): ?float + { + return $this->container['tampering_ml_score']; + } + + /** + * Sets tampering_ml_score. + * + * @param float $tampering_ml_score The output of this model is captured as tampering_ml_score, a number indicating how likely an event is coming from an anti detect browser. Values close to 1 signify higher confidence and we consider anything above the threshold of 0.8 to be actionable (the result and anti_detect_browser fields conveniently captures that fact) + * + */ + public function setTamperingMlScore(float $tampering_ml_score): self + { + if ($tampering_ml_score > 1) { + throw new \InvalidArgumentException('invalid value for $tampering_ml_score when calling EventDevice., must be smaller than or equal to 1.'); + } + if ($tampering_ml_score < 0) { + throw new \InvalidArgumentException('invalid value for $tampering_ml_score when calling EventDevice., must be bigger than or equal to 0.'); + } + + $this->container['tampering_ml_score'] = $tampering_ml_score; + + return $this; + } + + /** + * Gets tampering_details. + * + */ + public function getTamperingDetails(): ?TamperingDetails + { + return $this->container['tampering_details']; + } + + /** + * Sets tampering_details. + * + * @param TamperingDetails $tampering_details tampering_details + * + */ + public function setTamperingDetails(TamperingDetails $tampering_details): self + { + $this->container['tampering_details'] = $tampering_details; + + return $this; + } + + /** + * Gets velocity. + * + */ + public function getVelocity(): ?Velocity + { + return $this->container['velocity']; + } + + /** + * Sets velocity. + * + * @param Velocity $velocity velocity + * + */ + public function setVelocity(Velocity $velocity): self + { + $this->container['velocity'] = $velocity; + + return $this; + } + + /** + * Gets virtual_machine. + * + */ + public function getVirtualMachine(): ?bool + { + return $this->container['virtual_machine']; + } + + /** + * Sets virtual_machine. + * + * @param bool $virtual_machine `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. + * + */ + public function setVirtualMachine(bool $virtual_machine): self + { + $this->container['virtual_machine'] = $virtual_machine; + + return $this; + } + + /** + * Gets virtual_machine_ml_score. + * + */ + public function getVirtualMachineMlScore(): ?float + { + return $this->container['virtual_machine_ml_score']; + } + + /** + * Sets virtual_machine_ml_score. + * + * @param float $virtual_machine_ml_score Machine learning–based virtual machine score, represented as a floating-point value between 0 and 1 (inclusive), with up to three decimal places of precision. A higher score means a higher confidence in the positive `virtual_machine` detection result. This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). + * + */ + public function setVirtualMachineMlScore(float $virtual_machine_ml_score): self + { + if ($virtual_machine_ml_score > 1) { + throw new \InvalidArgumentException('invalid value for $virtual_machine_ml_score when calling EventDevice., must be smaller than or equal to 1.'); + } + if ($virtual_machine_ml_score < 0) { + throw new \InvalidArgumentException('invalid value for $virtual_machine_ml_score when calling EventDevice., must be bigger than or equal to 0.'); + } + + $this->container['virtual_machine_ml_score'] = $virtual_machine_ml_score; + + return $this; + } + + /** + * Gets vpn_ml_score. + * + */ + public function getVpnMlScore(): ?float + { + return $this->container['vpn_ml_score']; + } + + /** + * Sets vpn_ml_score. + * + * @param float $vpn_ml_score Machine learning–based VPN score, represented as a floating-point value between 0 and 1 (inclusive), with up to three decimal places of precision. A higher score means a higher confidence in the positive `vpn` detection result. This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). + * + */ + public function setVpnMlScore(float $vpn_ml_score): self + { + if ($vpn_ml_score > 1) { + throw new \InvalidArgumentException('invalid value for $vpn_ml_score when calling EventDevice., must be smaller than or equal to 1.'); + } + if ($vpn_ml_score < 0) { + throw new \InvalidArgumentException('invalid value for $vpn_ml_score when calling EventDevice., must be bigger than or equal to 0.'); + } + + $this->container['vpn_ml_score'] = $vpn_ml_score; + + return $this; + } + + /** + * Gets vpn_origin_timezone. + * + */ + public function getVpnOriginTimezone(): ?string + { + return $this->container['vpn_origin_timezone']; + } + + /** + * Sets vpn_origin_timezone. + * + * @param string $vpn_origin_timezone local timezone which is used in timezone_mismatch method + * + */ + public function setVpnOriginTimezone(string $vpn_origin_timezone): self + { + $this->container['vpn_origin_timezone'] = $vpn_origin_timezone; + + return $this; + } + + /** + * Gets vpn_origin_country. + * + */ + public function getVpnOriginCountry(): ?string + { + return $this->container['vpn_origin_country']; + } + + /** + * Sets vpn_origin_country. + * + * @param string $vpn_origin_country Country of the request (Android SDK version >= 2.4.0, iOS SDK version >= 2.9.0, JS agent >= 3.12.9 / 4.0.2), ISO 3166 format or unknown. + * + */ + public function setVpnOriginCountry(string $vpn_origin_country): self + { + $this->container['vpn_origin_country'] = $vpn_origin_country; + + return $this; + } + + /** + * Gets high_activity_device. + * + */ + public function getHighActivityDevice(): ?bool + { + return $this->container['high_activity_device']; + } + + /** + * Sets high_activity_device. + * + * @param bool $high_activity_device flag indicating if the request came from a high-activity visitor + * + */ + public function setHighActivityDevice(bool $high_activity_device): self + { + $this->container['high_activity_device'] = $high_activity_device; + + return $this; + } + + /** + * Gets rare_device. + * + */ + public function getRareDevice(): ?bool + { + return $this->container['rare_device']; + } + + /** + * Sets rare_device. + * + * @param bool $rare_device `true` if the device is considered rare based on its combination of hardware and software attributes. A device is classified as rare if it falls within the top 99.9 percentile (lowest-frequency segment) of observed traffic, or if its configuration has not been previously seen (`not_seen`). > This Smart Signal is currently in beta and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). + * + */ + public function setRareDevice(bool $rare_device): self + { + $this->container['rare_device'] = $rare_device; + + return $this; + } + + /** + * Gets rare_device_percentile_bucket. + * + */ + public function getRareDevicePercentileBucket(): RareDevicePercentileBucket|string|null + { + return $this->container['rare_device_percentile_bucket']; + } + + /** + * Sets rare_device_percentile_bucket. + * + * @param RareDevicePercentileBucket|string $rare_device_percentile_bucket rare_device_percentile_bucket + * + */ + public function setRareDevicePercentileBucket(RareDevicePercentileBucket|string $rare_device_percentile_bucket): self + { + $this->container['rare_device_percentile_bucket'] = $rare_device_percentile_bucket; + + return $this; + } + + /** + * Gets raw_device_attributes. + * + */ + public function getRawDeviceAttributes(): ?RawDeviceAttributes + { + return $this->container['raw_device_attributes']; + } + + /** + * Sets raw_device_attributes. + * + * @param RawDeviceAttributes $raw_device_attributes raw_device_attributes + * + */ + public function setRawDeviceAttributes(RawDeviceAttributes $raw_device_attributes): self + { + $this->container['raw_device_attributes'] = $raw_device_attributes; + + return $this; + } + + /** + * Gets labels. + * + * @return LabelsInner[]|null + */ + public function getLabels(): ?array + { + return $this->container['labels']; + } + + /** + * Sets labels. + * + * @param LabelsInner[] $labels Each label returns a prediction (true or false) for a specific use case (label field) based on a machine learning score. The machine learning score is determined by a model trained on customer data for that use case. This field is in the beta phase and only available to select customers. If you are interested, please [contact our support team](https://fingerprint.com/support/). + * + */ + public function setLabels(array $labels): self + { + $this->container['labels'] = $labels; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int|string $offset Offset + * + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int|string $offset Offset + * + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[\ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets a header-safe presentation of the object. + * + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of nullable properties. + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null. + * + * @return bool[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null. + * + * @param bool[] $openAPINullablesSetToNull + * + * @codeCoverageIgnore + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array. + * + * @noinspection PhpSameParameterValueInspection + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; // @codeCoverageIgnore + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } +} diff --git a/src/Model/EventEdge.php b/src/Model/EventEdge.php new file mode 100644 index 000000000..fe2e7f7ee --- /dev/null +++ b/src/Model/EventEdge.php @@ -0,0 +1,783 @@ + + * + * @noinspection GrazieInspection + * @noinspection RedundantSuppression + */ +class EventEdge implements ModelInterface, \ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + */ + protected static string $openAPIModelName = 'EventEdge'; + + /** + * Array of property to type mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $openAPITypes = [ + 'event_id' => 'string', + 'timestamp' => 'int', + 'linked_id' => 'string', + 'tags' => 'array', + 'url' => 'string', + 'bot_info' => '\Fingerprint\ServerSdk\Model\BotInfo', + 'ip_info' => '\Fingerprint\ServerSdk\Model\IPInfo', + 'proxy' => 'bool', + 'proxy_confidence' => '\Fingerprint\ServerSdk\Model\ProxyConfidence', + 'proxy_details' => '\Fingerprint\ServerSdk\Model\ProxyDetails', + 'vpn' => 'bool', + 'vpn_confidence' => '\Fingerprint\ServerSdk\Model\VpnConfidence', + 'vpn_methods' => '\Fingerprint\ServerSdk\Model\VpnMethods', + 'source' => '\Fingerprint\ServerSdk\Model\EventSource', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + * + * @phpstan-var array + * + * @psalm-var array + */ + protected static array $openAPIFormats = [ + 'event_id' => null, + 'timestamp' => 'int64', + 'linked_id' => null, + 'tags' => null, + 'url' => null, + 'bot_info' => null, + 'ip_info' => null, + 'proxy' => null, + 'proxy_confidence' => null, + 'proxy_details' => null, + 'vpn' => null, + 'vpn_confidence' => null, + 'vpn_methods' => null, + 'source' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization. + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'event_id' => false, + 'timestamp' => false, + 'linked_id' => false, + 'tags' => false, + 'url' => false, + 'bot_info' => false, + 'ip_info' => false, + 'proxy' => false, + 'proxy_confidence' => false, + 'proxy_details' => false, + 'vpn' => false, + 'vpn_confidence' => false, + 'vpn_methods' => false, + 'source' => false, + ]; + + /** + * If a nullable field gets set to null, insert it here. + * + * @var bool[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name. + * + * @var string[] + */ + protected static array $attributeMap = [ + 'event_id' => 'event_id', + 'timestamp' => 'timestamp', + 'linked_id' => 'linked_id', + 'tags' => 'tags', + 'url' => 'url', + 'bot_info' => 'bot_info', + 'ip_info' => 'ip_info', + 'proxy' => 'proxy', + 'proxy_confidence' => 'proxy_confidence', + 'proxy_details' => 'proxy_details', + 'vpn' => 'vpn', + 'vpn_confidence' => 'vpn_confidence', + 'vpn_methods' => 'vpn_methods', + 'source' => 'source', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'event_id' => 'setEventId', + 'timestamp' => 'setTimestamp', + 'linked_id' => 'setLinkedId', + 'tags' => 'setTags', + 'url' => 'setUrl', + 'bot_info' => 'setBotInfo', + 'ip_info' => 'setIpInfo', + 'proxy' => 'setProxy', + 'proxy_confidence' => 'setProxyConfidence', + 'proxy_details' => 'setProxyDetails', + 'vpn' => 'setVpn', + 'vpn_confidence' => 'setVpnConfidence', + 'vpn_methods' => 'setVpnMethods', + 'source' => 'setSource', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'event_id' => 'getEventId', + 'timestamp' => 'getTimestamp', + 'linked_id' => 'getLinkedId', + 'tags' => 'getTags', + 'url' => 'getUrl', + 'bot_info' => 'getBotInfo', + 'ip_info' => 'getIpInfo', + 'proxy' => 'getProxy', + 'proxy_confidence' => 'getProxyConfidence', + 'proxy_details' => 'getProxyDetails', + 'vpn' => 'getVpn', + 'vpn_confidence' => 'getVpnConfidence', + 'vpn_methods' => 'getVpnMethods', + 'source' => 'getSource', + ]; + + /** + * Associative array for storing property values. + */ + protected array $container = []; + + /** + * Constructor. + * + * @param array|null $data Associated array of property values + * initializing the model + * + * @noinspection DuplicatedCode + */ + public function __construct(?array $data = null) + { + $this->setIfExists('event_id', $data ?? [], null); + $this->setIfExists('timestamp', $data ?? [], null); + $this->setIfExists('linked_id', $data ?? [], null); + $this->setIfExists('tags', $data ?? [], null); + $this->setIfExists('url', $data ?? [], null); + $this->setIfExists('bot_info', $data ?? [], null); + $this->setIfExists('ip_info', $data ?? [], null); + $this->setIfExists('proxy', $data ?? [], null); + $this->setIfExists('proxy_confidence', $data ?? [], null); + $this->setIfExists('proxy_details', $data ?? [], null); + $this->setIfExists('vpn', $data ?? [], null); + $this->setIfExists('vpn_confidence', $data ?? [], null); + $this->setIfExists('vpn_methods', $data ?? [], null); + $this->setIfExists('source', $data ?? [], null); + } + + /** + * Gets the string presentation of the object. + * + */ + public function __toString(): string + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Array of property to type mappings. Used for (de)serialization. + * + */ + public static function openAPITypes(): array + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization. + */ + public static function openAPIFormats(): array + { + return self::$openAPIFormats; + } + + /** + * Checks if a property is nullable. + * + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * 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::$openAPIModelName; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties(): array + { + $invalidProperties = []; + + if (null === $this->container['event_id']) { + $invalidProperties[] = "'event_id' can't be null"; + } + if (null === $this->container['timestamp']) { + $invalidProperties[] = "'timestamp' can't be null"; + } + if (null === $this->container['ip_info']) { + $invalidProperties[] = "'ip_info' can't be null"; + } + if (null === $this->container['source']) { + $invalidProperties[] = "'source' 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 event_id. + * + */ + public function getEventId(): ?string + { + return $this->container['event_id']; + } + + /** + * Sets event_id. + * + * @param string $event_id Unique identifier of the user's request. The first portion of the event_id is a unix epoch milliseconds timestamp. + * + */ + public function setEventId(string $event_id): self + { + $this->container['event_id'] = $event_id; + + return $this; + } + + /** + * Gets timestamp. + * + */ + public function getTimestamp(): ?int + { + return $this->container['timestamp']; + } + + /** + * Sets timestamp. + * + * @param int $timestamp timestamp of the event with millisecond precision in Unix time + * + */ + public function setTimestamp(int $timestamp): self + { + $this->container['timestamp'] = $timestamp; + + return $this; + } + + /** + * Gets linked_id. + * + */ + public function getLinkedId(): ?string + { + return $this->container['linked_id']; + } + + /** + * Sets linked_id. + * + * @param string $linked_id a customer-provided id that was sent with the request + * + */ + public function setLinkedId(string $linked_id): self + { + $this->container['linked_id'] = $linked_id; + + return $this; + } + + /** + * Gets tags. + * + * @return array|null + */ + public function getTags(): ?array + { + return $this->container['tags']; + } + + /** + * Sets tags. + * + * @param array $tags a customer-provided value or an object that was sent with the identification request or updated later + * + */ + public function setTags(array $tags): self + { + $this->container['tags'] = $tags; + + return $this; + } + + /** + * Gets url. + * + */ + public function getUrl(): ?string + { + return $this->container['url']; + } + + /** + * Sets url. + * + * @param string $url page URL from which the request was sent + * + */ + public function setUrl(string $url): self + { + $this->container['url'] = $url; + + return $this; + } + + /** + * Gets bot_info. + * + */ + public function getBotInfo(): ?BotInfo + { + return $this->container['bot_info']; + } + + /** + * Sets bot_info. + * + * @param BotInfo $bot_info bot_info + * + */ + public function setBotInfo(BotInfo $bot_info): self + { + $this->container['bot_info'] = $bot_info; + + return $this; + } + + /** + * Gets ip_info. + * + */ + public function getIpInfo(): ?IPInfo + { + return $this->container['ip_info']; + } + + /** + * Sets ip_info. + * + * @param IPInfo $ip_info ip_info + * + */ + public function setIpInfo(IPInfo $ip_info): self + { + $this->container['ip_info'] = $ip_info; + + return $this; + } + + /** + * Gets proxy. + * + */ + public function getProxy(): ?bool + { + return $this->container['proxy']; + } + + /** + * Sets proxy. + * + * @param bool $proxy IP address was used by a public proxy provider or belonged to a known recent residential proxy + * + */ + public function setProxy(bool $proxy): self + { + $this->container['proxy'] = $proxy; + + return $this; + } + + /** + * Gets proxy_confidence. + * + */ + public function getProxyConfidence(): ProxyConfidence|string|null + { + return $this->container['proxy_confidence']; + } + + /** + * Sets proxy_confidence. + * + * @param ProxyConfidence|string $proxy_confidence proxy_confidence + * + */ + public function setProxyConfidence(ProxyConfidence|string $proxy_confidence): self + { + $this->container['proxy_confidence'] = $proxy_confidence; + + return $this; + } + + /** + * Gets proxy_details. + * + */ + public function getProxyDetails(): ?ProxyDetails + { + return $this->container['proxy_details']; + } + + /** + * Sets proxy_details. + * + * @param ProxyDetails $proxy_details proxy_details + * + */ + public function setProxyDetails(ProxyDetails $proxy_details): self + { + $this->container['proxy_details'] = $proxy_details; + + return $this; + } + + /** + * Gets vpn. + * + */ + public function getVpn(): ?bool + { + return $this->container['vpn']; + } + + /** + * Sets vpn. + * + * @param bool $vpn VPN or other anonymizing service has been used when sending the request + * + */ + public function setVpn(bool $vpn): self + { + $this->container['vpn'] = $vpn; + + return $this; + } + + /** + * Gets vpn_confidence. + * + */ + public function getVpnConfidence(): string|VpnConfidence|null + { + return $this->container['vpn_confidence']; + } + + /** + * Sets vpn_confidence. + * + * @param VpnConfidence|string $vpn_confidence vpn_confidence + * + */ + public function setVpnConfidence(string|VpnConfidence $vpn_confidence): self + { + $this->container['vpn_confidence'] = $vpn_confidence; + + return $this; + } + + /** + * Gets vpn_methods. + * + */ + public function getVpnMethods(): ?VpnMethods + { + return $this->container['vpn_methods']; + } + + /** + * Sets vpn_methods. + * + * @param VpnMethods $vpn_methods vpn_methods + * + */ + public function setVpnMethods(VpnMethods $vpn_methods): self + { + $this->container['vpn_methods'] = $vpn_methods; + + return $this; + } + + /** + * Gets source. + * + */ + public function getSource(): EventSource|string|null + { + return $this->container['source']; + } + + /** + * Sets source. + * + * @param EventSource|string $source source + * + */ + public function setSource(EventSource|string $source): self + { + $this->container['source'] = $source; + + return $this; + } + + /** + * Returns true if offset exists. False otherwise. + * + * @param int|string $offset Offset + * + */ + public function offsetExists(mixed $offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param int|string $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet(mixed $offset): mixed + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param int|string $offset Offset + * + */ + public function offsetUnset(mixed $offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * + * @see https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource + */ + #[\ReturnTypeWillChange] + public function jsonSerialize(): mixed + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets a header-safe presentation of the object. + * + */ + public function toHeaderValue(): string + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } + + /** + * Array of nullable properties. + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null. + * + * @return bool[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null. + * + * @param bool[] $openAPINullablesSetToNull + * + * @codeCoverageIgnore + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array. + * + * @noinspection PhpSameParameterValueInspection + */ + private function setIfExists(string $variableName, array $fields, mixed $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; // @codeCoverageIgnore + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } +} diff --git a/src/ObjectSerializer.php b/src/ObjectSerializer.php index c3a5a822c..c06d00b49 100644 --- a/src/ObjectSerializer.php +++ b/src/ObjectSerializer.php @@ -29,6 +29,7 @@ namespace Fingerprint\ServerSdk; +use Fingerprint\ServerSdk\Model\Event; use Fingerprint\ServerSdk\Model\ModelInterface; /** @@ -54,6 +55,46 @@ public static function setDateTimeFormat(string $format): void self::$dateTimeFormat = $format; } + /** + * Treat a missing, null, or empty Event `source` as `device`. + * Unknown non-empty values fail. Never rewrites `edge`. + */ + public static function hydrateEmptyEventSource(mixed $data): mixed + { + if (null === $data) { + return ['source' => 'device']; + } + + if (is_array($data)) { + $source = $data['source'] ?? null; + if (!array_key_exists('source', $data) || null === $source || '' === $source) { + $data['source'] = 'device'; + + return $data; + } + $value = $source instanceof \BackedEnum ? $source->value : $source; + if (!is_string($value) || !in_array($value, ['device', 'edge'], true)) { + throw new \InvalidArgumentException('unknown Event source: '.json_encode($value)); + } + + return $data; + } + + if (is_object($data)) { + if (!property_exists($data, 'source') || null === $data->source || '' === $data->source) { + $data->source = 'device'; + + return $data; + } + $value = $data->source instanceof \BackedEnum ? $data->source->value : $data->source; + if (!is_string($value) || !in_array($value, ['device', 'edge'], true)) { + throw new \InvalidArgumentException('unknown Event source: '.json_encode($value)); + } + } + + return $data; + } + /** * Serialize data. * @@ -421,7 +462,14 @@ public static function deserialize(mixed $data, string $class): mixed $data = (object) $data; } + if (is_object($data) && (Event::class === $class || '\\'.Event::class === $class)) { + $data = self::hydrateEmptyEventSource($data); + } + // If a discriminator is defined and points to a valid subclass, use it. + // Event::DISCRIMINATOR is `source`. For source=device this looks up + // \Fingerprint\ServerSdk\Model\device, which is not a subclass of Event, + // so deserialization stays on the flat Event class. $discriminator = defined("$class::DISCRIMINATOR") ? $class::DISCRIMINATOR : null; if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { $subclass = '\Fingerprint\ServerSdk\Model\\'.$data->{$discriminator}; diff --git a/template/ObjectSerializer.mustache b/template/ObjectSerializer.mustache index 2f5207b3b..5458dd2f4 100644 --- a/template/ObjectSerializer.mustache +++ b/template/ObjectSerializer.mustache @@ -19,6 +19,7 @@ namespace {{invokerPackage}}; use GuzzleHttp\Psr7\Utils; +use {{modelPackage}}\Event; use {{modelPackage}}\ModelInterface; /** @@ -43,6 +44,43 @@ class ObjectSerializer self::$dateTimeFormat = $format; } + /** + * Treat a missing, null, or empty Event `source` as `device`. + * Unknown non-empty values fail. Never rewrites `edge`. + */ + public static function hydrateEmptyEventSource(mixed $data): mixed + { + if ($data === null) { + return ['source' => 'device']; + } + + if (is_array($data)) { + $source = $data['source'] ?? null; + if (!array_key_exists('source', $data) || $source === null || $source === '') { + $data['source'] = 'device'; + return $data; + } + $value = $source instanceof \BackedEnum ? $source->value : $source; + if (!is_string($value) || !in_array($value, ['device', 'edge'], true)) { + throw new \InvalidArgumentException('unknown Event source: ' . json_encode($value)); + } + return $data; + } + + if (is_object($data)) { + if (!property_exists($data, 'source') || $data->source === null || $data->source === '') { + $data->source = 'device'; + return $data; + } + $value = $data->source instanceof \BackedEnum ? $data->source->value : $data->source; + if (!is_string($value) || !in_array($value, ['device', 'edge'], true)) { + throw new \InvalidArgumentException('unknown Event source: ' . json_encode($value)); + } + } + + return $data; + } + /** * Serialize data * @@ -434,6 +472,10 @@ class ObjectSerializer $data = (object)$data; } + if (is_object($data) && ($class === Event::class || $class === '\\' . Event::class)) { + $data = self::hydrateEmptyEventSource($data); + } + // If a discriminator is defined and points to a valid subclass, use it. $discriminator = defined("$class::DISCRIMINATOR") ? $class::DISCRIMINATOR : null; if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { diff --git a/test/Api/FingerprintApiTest.php b/test/Api/FingerprintApiTest.php index d08c461ec..4a67eeba5 100644 --- a/test/Api/FingerprintApiTest.php +++ b/test/Api/FingerprintApiTest.php @@ -1562,6 +1562,7 @@ private function assertEvent(Event $event, \stdClass $actual): void $this->assertEquals($actual->replayed, $event->getReplayed()); + // SPIKE INTER-2457 — This still works. PHP did not split Event, so getIdentification() remains. $identification = $event->getIdentification(); $actualIdentification = $actual->identification; $this->assertEquals(Identification::class, get_class($identification)); diff --git a/test/Model/EdgeRequestHeadersInnerTest.php b/test/Model/EdgeRequestHeadersInnerTest.php new file mode 100644 index 000000000..260144371 --- /dev/null +++ b/test/Model/EdgeRequestHeadersInnerTest.php @@ -0,0 +1,99 @@ +assertFalse($emptyModel->valid()); $this->assertNotEmpty($emptyModel->listInvalidProperties()); - $validModel = new Event(self::EXAMPLE); - $this->assertTrue($validModel->valid()); - $this->assertEmpty($validModel->listInvalidProperties()); + $model = new Event(self::EXAMPLE); + $this->assertSame(EventSource::DEVICE->value, $model->getSource()); + $this->assertContains("'ip_info' can't be null", $model->listInvalidProperties()); } /** @@ -192,7 +192,7 @@ public function testDeserializationWithSource(): void } /** - * Source is optional, so an event payload without it should deserialize with a null source. + * A missing `source` key hydrates to device. `source: edge` is left alone. * * @throws \DateMalformedStringException */ @@ -203,13 +203,33 @@ public function testDeserializationWithoutSource(): void /** @var Event $model */ $model = ObjectSerializer::deserialize(json_decode($json), Event::class); - $this->assertNull($model->getSource()); - $this->assertTrue($model->valid()); + $this->assertSame(EventSource::DEVICE, $model->getSource()); + + /** @var Event $fromArray */ + $fromArray = ObjectSerializer::deserialize(self::EXAMPLE, Event::class); + $this->assertSame(EventSource::DEVICE, $fromArray->getSource()); + + $edgeJson = json_encode(self::EXAMPLE + ['source' => EventSource::EDGE->value]); + + /** @var Event $edge */ + $edge = ObjectSerializer::deserialize(json_decode($edgeJson), Event::class); + $this->assertSame(EventSource::EDGE, $edge->getSource()); } /** - * Deserializing a JSON response with an unknown source should not throw. - * The unknown value should be preserved through deserialization and re-serialization. + * Constructor without `source` hydrates to device. Explicit edge is kept. + */ + public function testConstructorHydratesMissingSourceToDevice(): void + { + $omitted = new Event(self::EXAMPLE); + $this->assertSame(EventSource::DEVICE->value, $omitted->getSource()); + + $edge = new Event(self::EXAMPLE + ['source' => EventSource::EDGE]); + $this->assertSame(EventSource::EDGE, $edge->getSource()); + } + + /** + * Unknown non-empty source cannot pick an Event variant. * * @throws \DateMalformedStringException */ @@ -217,16 +237,9 @@ public function testDeserializationWithUnknownSource(): void { $json = json_encode(self::EXAMPLE + ['source' => 'unknown-value']); - /** @var Event $model */ - $model = ObjectSerializer::deserialize(json_decode($json), Event::class); - - $this->assertEquals('unknown-value', $model->getSource()); - $this->assertTrue($model->valid()); - - // Re-serialization should preserve the unknown value - $reserialized = json_encode(ObjectSerializer::sanitizeForSerialization($model)); - $decoded = json_decode($reserialized, true); - $this->assertEquals('unknown-value', $decoded['source']); + $this->expectException(\InvalidArgumentException::class); + $this->expectExceptionMessage('unknown Event source'); + ObjectSerializer::deserialize(json_decode($json), Event::class); } /**