diff --git a/.changeset/device-details-signal.md b/.changeset/device-details-signal.md new file mode 100644 index 000000000..e74f10d68 --- /dev/null +++ b/.changeset/device-details-signal.md @@ -0,0 +1,5 @@ +--- +'@fingerprint/php-sdk': minor +--- + +**events**: Add `device_details` smart signal to `Event` diff --git a/.changeset/sync-koala-v3-schema.md b/.changeset/sync-koala-v3-schema.md new file mode 100644 index 000000000..0f01ccfcb --- /dev/null +++ b/.changeset/sync-koala-v3-schema.md @@ -0,0 +1,5 @@ +--- +'@fingerprint/php-sdk': patch +--- + +**events**: Fix descriptions to use ID rather than Id. Clarify descriptions for Labels. diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index d117e72db..83218ebc9 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -8,6 +8,7 @@ docs/Model/BotInfoIdentity.md docs/Model/BotResult.md docs/Model/BrowserDetails.md docs/Model/Canvas.md +docs/Model/DeviceDetails.md docs/Model/Emoji.md docs/Model/Error.md docs/Model/ErrorCode.md @@ -74,6 +75,7 @@ src/Model/BotInfoIdentity.php src/Model/BotResult.php src/Model/BrowserDetails.php src/Model/Canvas.php +src/Model/DeviceDetails.php src/Model/Emoji.php src/Model/Error.php src/Model/ErrorCode.php diff --git a/.schema-version b/.schema-version index ac47b4361..ea535dc59 100644 --- a/.schema-version +++ b/.schema-version @@ -1 +1 @@ -v3.7.0 \ No newline at end of file +v3.8.0 \ No newline at end of file diff --git a/README.md b/README.md index 88d1b2285..8c1028baf 100644 --- a/README.md +++ b/README.md @@ -254,6 +254,7 @@ Class | Method | HTTP request | Description - [BotResult](docs/Model/BotResult.md) - [BrowserDetails](docs/Model/BrowserDetails.md) - [Canvas](docs/Model/Canvas.md) + - [DeviceDetails](docs/Model/DeviceDetails.md) - [Emoji](docs/Model/Emoji.md) - [Error](docs/Model/Error.md) - [ErrorCode](docs/Model/ErrorCode.md) diff --git a/docs/Api/FingerprintApi.md b/docs/Api/FingerprintApi.md index d53244a9d..2e2d23dfb 100644 --- a/docs/Api/FingerprintApi.md +++ b/docs/Api/FingerprintApi.md @@ -67,7 +67,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 +83,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 @@ -133,7 +133,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 +151,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 @@ -227,7 +227,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 +238,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. @@ -295,7 +295,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 +306,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] | @@ -400,7 +400,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 +417,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/DeviceDetails.md b/docs/Model/DeviceDetails.md new file mode 100644 index 000000000..a27d1b1bd --- /dev/null +++ b/docs/Model/DeviceDetails.md @@ -0,0 +1,13 @@ +# DeviceDetails Class + +Native, SDK-collected mobile device identification signals (manufacturer, model, and OS version). Structurally separate from the top-level `device`, `os`, and `os_version` fields and from `browser_details`, all of which are derived from user-agent parsing rather than native SDK signals. + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**device_manufacturer** | **string** | Raw device manufacturer string as reported by the device OS. Not normalized: casing is vendor-defined (samsung, Xiaomi, OPPO, HUAWEI). Always `Apple` on iOS. | [optional] +**device_model** | **string** | Raw device model identifier, as reported by the mobile OS. | [optional] +**os_version** | **string** | Mobile operating system version. Component count is not fixed and must not be assumed by consumers: iOS always reports `major.minor.patch` (e.g. `17.4.1`), while Android's precision varies by OS era and which raw signal resolved it — `major` only (`9`, `13`) since Android 10 dropped point releases, `major.minor` (`16.1`) from Android 16 (API 36+) reintroducing a minor component, or a genuine `major.minor.patch` (`8.1.0`) on pre-Android 10 devices that shipped real point releases. Never a fabricated/zero-padded component. | [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/Event.md b/docs/Model/Event.md index a64b4f6d2..7db731ace 100644 --- a/docs/Model/Event.md +++ b/docs/Model/Event.md @@ -10,16 +10,16 @@ Name | Type | Description | Notes **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] -**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] +**linked_id** | **string** | A customer-provided ID that was sent with the request. | [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] **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] +**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] @@ -35,6 +35,7 @@ Name | Type | Description | Notes **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] +**device_details** | [**\Fingerprint\ServerSdk\Model\DeviceDetails**](DeviceDetails.md) | | [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] diff --git a/docs/Model/LabelsInner.md b/docs/Model/LabelsInner.md index a7c8ec016..ea1778661 100644 --- a/docs/Model/LabelsInner.md +++ b/docs/Model/LabelsInner.md @@ -4,8 +4,8 @@ Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- -**label** | **string** | | +**label** | **string** | Customer-facing label name defined by the customer. | **prediction** | **bool** | | [optional] -**ml_score** | **float** | | [optional] +**ml_score** | **float** | Raw model score between 0 and 1. | [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/Velocity.md b/docs/Model/Velocity.md index 45aecc836..ec17dd86d 100644 --- a/docs/Model/Velocity.md +++ b/docs/Model/Velocity.md @@ -3,17 +3,17 @@ Sums key data points for a specific `visitor_id`, `ip_address` and `linked_id` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: -- Number of distinct IP addresses associated to the visitor Id. -- Number of distinct linked Ids associated with the visitor Id. -- Number of distinct countries associated with the visitor Id. -- Number of identification events associated with the visitor Id. +- Number of distinct IP addresses associated to the visitor ID. +- Number of distinct linked IDs associated with the visitor ID. +- Number of distinct countries associated with the visitor ID. +- Number of identification events associated with the visitor ID. - Number of identification events associated with the detected IP address. -- Number of distinct IP addresses associated with the provided linked Id. -- Number of distinct visitor Ids associated with the provided linked Id. +- Number of distinct IP addresses associated with the provided linked ID. +- Number of distinct visitor IDs associated with the provided linked ID. The `24_hours` interval of `distinct_ip`, `distinct_linked_id`, `distinct_country`, `distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will be omitted -if the number of `events` for the visitor Id in the last 24 +if the number of `events` for the visitor ID in the last 24 hours (`events.['24_hours']`) is higher than 20.000. All will not necessarily be returned in a response, some may be omitted if the diff --git a/docs/Model/VelocityData.md b/docs/Model/VelocityData.md index ef990f683..43656598c 100644 --- a/docs/Model/VelocityData.md +++ b/docs/Model/VelocityData.md @@ -1,6 +1,6 @@ # VelocityData Class -Is absent if the velocity data could not be generated for the visitor Id. +Is absent if the velocity data could not be generated for the visitor ID. ## Properties diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index 5e7a37ba8..c71de8939 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -61,7 +61,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 @@ -86,7 +86,7 @@ paths: schema: $ref: '#/components/schemas/Event' '400': - description: Bad request. The event Id provided is not valid. + description: Bad request. The event ID provided is not valid. content: application/json: schema: @@ -98,7 +98,7 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' '404': - description: Not found. The event Id cannot be found in this workspace's data. + description: Not found. The event ID cannot be found in this workspace's data. content: application/json: schema: @@ -165,7 +165,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: @@ -188,7 +188,7 @@ paths: schema: $ref: '#/components/schemas/ErrorResponse' '404': - description: Not found. The event Id cannot be found in this workspace's data. + description: Not found. The event ID cannot be found in this workspace's data. content: application/json: schema: @@ -317,7 +317,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,9 +492,9 @@ 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 + 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. - name: url @@ -1110,7 +1110,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': @@ -1155,7 +1155,7 @@ components: type: string examples: - somelinkedId - description: A customer-provided id that was sent with the request. + description: A customer-provided ID that was sent with the request. Tags: type: object description: >- @@ -1709,13 +1709,13 @@ components: type: string examples: - ae_47abaca3db2c7c43 - description: Environment Id of the event. + description: Environment ID of the event. Suspect: type: boolean 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: [] @@ -1894,7 +1894,7 @@ components: examples: - com.foo.app description: > - Bundle Id of the iOS application integrated with the Fingerprint SDK for + Bundle ID of the iOS application integrated with the Fingerprint SDK for the event. PackageName: type: string @@ -2065,6 +2065,48 @@ components: description: > `true` if the browser has DevTools open (Chrome, Firefox) or the Android/iOS device has Developer Tools enabled, `false` otherwise. + DeviceDetails: + type: object + description: >- + Native, SDK-collected mobile device identification signals + (manufacturer, model, and OS version). Structurally separate from the + top-level `device`, `os`, and `os_version` fields and from + `browser_details`, all of which are derived from user-agent parsing + rather than native SDK signals. + required: [] + properties: + device_manufacturer: + type: string + examples: + - samsung + - Apple + description: >- + Raw device manufacturer string as reported by the device OS. Not + normalized: casing is vendor-defined (samsung, Xiaomi, OPPO, + HUAWEI). Always `Apple` on iOS. + device_model: + type: string + examples: + - SM-G991U + - iPhone14,5 + description: Raw device model identifier, as reported by the mobile OS. + os_version: + type: string + examples: + - '9' + - '16.1' + - 8.1.0 + - 17.4.1 + description: >- + Mobile operating system version. Component count is not fixed and + must not be assumed by consumers: iOS always reports + `major.minor.patch` (e.g. `17.4.1`), while Android's precision + varies by OS era and which raw signal resolved it — `major` only + (`9`, `13`) since Android 10 dropped point releases, `major.minor` + (`16.1`) from Android 16 (API 36+) reintroducing a minor component, + or a genuine `major.minor.patch` (`8.1.0`) on pre-Android 10 devices + that shipped real point releases. Never a fabricated/zero-padded + component. Emulator: type: boolean description: > @@ -2416,7 +2458,7 @@ components: type: object description: > Is absent if the velocity data could not be generated for the visitor - Id. + ID. required: - 5_minutes - 1_hour @@ -2451,21 +2493,21 @@ components: intervals: 5 minutes, 1 hour, and 24 hours as follows: - - Number of distinct IP addresses associated to the visitor Id. + - Number of distinct IP addresses associated to the visitor ID. - - Number of distinct linked Ids associated with the visitor Id. + - Number of distinct linked IDs associated with the visitor ID. - - Number of distinct countries associated with the visitor Id. + - Number of distinct countries associated with the visitor ID. - - Number of identification events associated with the visitor Id. + - Number of identification events associated with the visitor ID. - Number of identification events associated with the detected IP address. - Number of distinct IP addresses associated with the provided linked - Id. + ID. - - Number of distinct visitor Ids associated with the provided linked Id. + - Number of distinct visitor IDs associated with the provided linked ID. The `24_hours` interval of `distinct_ip`, `distinct_linked_id`, @@ -2474,7 +2516,7 @@ components: `distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will be omitted - if the number of `events` for the visitor Id in the last 24 + if the number of `events` for the visitor ID in the last 24 hours (`events.['24_hours']`) is higher than 20.000. @@ -3066,6 +3108,7 @@ components: type: string examples: - automation_tool + description: Customer-facing label name defined by the customer. prediction: type: boolean ml_score: @@ -3075,6 +3118,7 @@ components: - 0.95 minimum: 0 maximum: 1 + description: Raw model score between 0 and 1. description: > Each label returns a prediction (true or false) for a specific use case (label field) based on a machine learning score. The machine learning @@ -3248,6 +3292,11 @@ components: - browser - android - ios + device_details: + $ref: '#/components/schemas/DeviceDetails' + x-platforms: + - android + - ios emulator: $ref: '#/components/schemas/Emulator' x-platforms: @@ -3399,6 +3448,7 @@ components: x-platforms: - android - ios + - browser vpn_methods: $ref: '#/components/schemas/VpnMethods' x-platforms: diff --git a/src/Api/FingerprintApi.php b/src/Api/FingerprintApi.php index 178774026..dd55c3934 100644 --- a/src/Api/FingerprintApi.php +++ b/src/Api/FingerprintApi.php @@ -110,7 +110,7 @@ public function getConfig(): Configuration * * 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 +129,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 +190,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 +213,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 +262,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 +309,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 @@ -331,7 +331,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 +397,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 +421,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 +477,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 +537,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 +548,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) @@ -609,7 +609,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 +620,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) @@ -725,7 +725,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 +736,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) @@ -799,7 +799,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 +810,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) @@ -905,7 +905,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 +916,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) @@ -1479,7 +1479,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 +1499,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 +1561,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 +1585,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 +1635,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 diff --git a/src/Model/DeviceDetails.php b/src/Model/DeviceDetails.php new file mode 100644 index 000000000..dec2a042d --- /dev/null +++ b/src/Model/DeviceDetails.php @@ -0,0 +1,448 @@ + + * + * @noinspection GrazieInspection + * @noinspection RedundantSuppression + */ +class DeviceDetails implements ModelInterface, \ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + */ + protected static string $openAPIModelName = 'DeviceDetails'; + + /** + * Array of property to type mappings. Used for (de)serialization. + * + * @var string[] + */ + protected static array $openAPITypes = [ + 'device_manufacturer' => 'string', + 'device_model' => 'string', + 'os_version' => 'string', + ]; + + /** + * Array of property to format mappings. Used for (de)serialization. + * + * @var string[] + * + * @phpstan-var array + * + * @psalm-var array + */ + protected static array $openAPIFormats = [ + 'device_manufacturer' => null, + 'device_model' => null, + 'os_version' => null, + ]; + + /** + * Array of nullable properties. Used for (de)serialization. + * + * @var bool[] + */ + protected static array $openAPINullables = [ + 'device_manufacturer' => false, + 'device_model' => false, + 'os_version' => 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 = [ + 'device_manufacturer' => 'device_manufacturer', + 'device_model' => 'device_model', + 'os_version' => 'os_version', + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses). + * + * @var string[] + */ + protected static array $setters = [ + 'device_manufacturer' => 'setDeviceManufacturer', + 'device_model' => 'setDeviceModel', + 'os_version' => 'setOsVersion', + ]; + + /** + * Array of attributes to getter functions (for serialization of requests). + * + * @var string[] + */ + protected static array $getters = [ + 'device_manufacturer' => 'getDeviceManufacturer', + 'device_model' => 'getDeviceModel', + 'os_version' => 'getOsVersion', + ]; + + /** + * 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('device_manufacturer', $data ?? [], null); + $this->setIfExists('device_model', $data ?? [], null); + $this->setIfExists('os_version', $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 + { + return []; + } + + /** + * Validate all the properties in the model + * return true if all passed. + * + * @return bool True if all properties are valid + */ + public function valid(): bool + { + return 0 === count($this->listInvalidProperties()); + } + + /** + * Gets device_manufacturer. + * + */ + public function getDeviceManufacturer(): ?string + { + return $this->container['device_manufacturer']; + } + + /** + * Sets device_manufacturer. + * + * @param string $device_manufacturer Raw device manufacturer string as reported by the device OS. Not normalized: casing is vendor-defined (samsung, Xiaomi, OPPO, HUAWEI). Always `Apple` on iOS. + * + */ + public function setDeviceManufacturer(string $device_manufacturer): self + { + $this->container['device_manufacturer'] = $device_manufacturer; + + return $this; + } + + /** + * Gets device_model. + * + */ + public function getDeviceModel(): ?string + { + return $this->container['device_model']; + } + + /** + * Sets device_model. + * + * @param string $device_model raw device model identifier, as reported by the mobile OS + * + */ + public function setDeviceModel(string $device_model): self + { + $this->container['device_model'] = $device_model; + + return $this; + } + + /** + * Gets os_version. + * + */ + public function getOsVersion(): ?string + { + return $this->container['os_version']; + } + + /** + * Sets os_version. + * + * @param string $os_version Mobile operating system version. Component count is not fixed and must not be assumed by consumers: iOS always reports `major.minor.patch` (e.g. `17.4.1`), while Android's precision varies by OS era and which raw signal resolved it — `major` only (`9`, `13`) since Android 10 dropped point releases, `major.minor` (`16.1`) from Android 16 (API 36+) reintroducing a minor component, or a genuine `major.minor.patch` (`8.1.0`) on pre-Android 10 devices that shipped real point releases. Never a fabricated/zero-padded component. + * + */ + public function setOsVersion(string $os_version): self + { + $this->container['os_version'] = $os_version; + + 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..750f09324 100644 --- a/src/Model/Event.php +++ b/src/Model/Event.php @@ -92,6 +92,7 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'bot_info' => '\Fingerprint\ServerSdk\Model\BotInfo', 'cloned_app' => 'bool', 'developer_tools' => 'bool', + 'device_details' => '\Fingerprint\ServerSdk\Model\DeviceDetails', 'emulator' => 'bool', 'factory_reset_timestamp' => 'int', 'frida' => 'bool', @@ -169,6 +170,7 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'bot_info' => null, 'cloned_app' => null, 'developer_tools' => null, + 'device_details' => null, 'emulator' => null, 'factory_reset_timestamp' => 'int64', 'frida' => null, @@ -242,6 +244,7 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'bot_info' => false, 'cloned_app' => false, 'developer_tools' => false, + 'device_details' => false, 'emulator' => false, 'factory_reset_timestamp' => false, 'frida' => false, @@ -323,6 +326,7 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'bot_info' => 'bot_info', 'cloned_app' => 'cloned_app', 'developer_tools' => 'developer_tools', + 'device_details' => 'device_details', 'emulator' => 'emulator', 'factory_reset_timestamp' => 'factory_reset_timestamp', 'frida' => 'frida', @@ -396,6 +400,7 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'bot_info' => 'setBotInfo', 'cloned_app' => 'setClonedApp', 'developer_tools' => 'setDeveloperTools', + 'device_details' => 'setDeviceDetails', 'emulator' => 'setEmulator', 'factory_reset_timestamp' => 'setFactoryResetTimestamp', 'frida' => 'setFrida', @@ -469,6 +474,7 @@ class Event implements ModelInterface, \ArrayAccess, \JsonSerializable 'bot_info' => 'getBotInfo', 'cloned_app' => 'getClonedApp', 'developer_tools' => 'getDeveloperTools', + 'device_details' => 'getDeviceDetails', 'emulator' => 'getEmulator', 'factory_reset_timestamp' => 'getFactoryResetTimestamp', 'frida' => 'getFrida', @@ -551,6 +557,7 @@ public function __construct(?array $data = null) $this->setIfExists('bot_info', $data ?? [], null); $this->setIfExists('cloned_app', $data ?? [], null); $this->setIfExists('developer_tools', $data ?? [], null); + $this->setIfExists('device_details', $data ?? [], null); $this->setIfExists('emulator', $data ?? [], null); $this->setIfExists('factory_reset_timestamp', $data ?? [], null); $this->setIfExists('frida', $data ?? [], null); @@ -834,7 +841,7 @@ public function getLinkedId(): ?string /** * Sets linked_id. * - * @param string $linked_id a customer-provided id that was sent with the request + * @param string $linked_id a customer-provided ID that was sent with the request * */ public function setLinkedId(string $linked_id): self @@ -856,7 +863,7 @@ public function getEnvironmentId(): ?string /** * Sets environment_id. * - * @param string $environment_id environment Id of the event + * @param string $environment_id environment ID of the event * */ public function setEnvironmentId(string $environment_id): self @@ -878,7 +885,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 @@ -1033,7 +1040,7 @@ public function getBundleId(): ?string /** * Sets bundle_id. * - * @param string $bundle_id bundle Id of the iOS application integrated with the Fingerprint SDK for the event + * @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 @@ -1373,6 +1380,28 @@ public function setDeveloperTools(bool $developer_tools): self return $this; } + /** + * Gets device_details. + * + */ + public function getDeviceDetails(): ?DeviceDetails + { + return $this->container['device_details']; + } + + /** + * Sets device_details. + * + * @param DeviceDetails $device_details device_details + * + */ + public function setDeviceDetails(DeviceDetails $device_details): self + { + $this->container['device_details'] = $device_details; + + return $this; + } + /** * Gets emulator. * diff --git a/src/Model/LabelsInner.php b/src/Model/LabelsInner.php index ecaeb3f28..6e6748bcb 100644 --- a/src/Model/LabelsInner.php +++ b/src/Model/LabelsInner.php @@ -283,7 +283,7 @@ public function getLabel(): ?string /** * Sets label. * - * @param string $label label + * @param string $label customer-facing label name defined by the customer * */ public function setLabel(string $label): self @@ -327,7 +327,7 @@ public function getMlScore(): ?float /** * Sets ml_score. * - * @param float $ml_score ml_score + * @param float $ml_score raw model score between 0 and 1 * */ public function setMlScore(float $ml_score): self diff --git a/src/Model/Velocity.php b/src/Model/Velocity.php index cab252941..da20f2f0f 100644 --- a/src/Model/Velocity.php +++ b/src/Model/Velocity.php @@ -35,17 +35,17 @@ * Sums key data points for a specific `visitor_id`, `ip_address` and `linked_id` at three distinct time * intervals: 5 minutes, 1 hour, and 24 hours as follows: * - * - Number of distinct IP addresses associated to the visitor Id. - * - Number of distinct linked Ids associated with the visitor Id. - * - Number of distinct countries associated with the visitor Id. - * - Number of identification events associated with the visitor Id. + * - Number of distinct IP addresses associated to the visitor ID. + * - Number of distinct linked IDs associated with the visitor ID. + * - Number of distinct countries associated with the visitor ID. + * - Number of identification events associated with the visitor ID. * - Number of identification events associated with the detected IP address. - * - Number of distinct IP addresses associated with the provided linked Id. - * - Number of distinct visitor Ids associated with the provided linked Id. + * - Number of distinct IP addresses associated with the provided linked ID. + * - Number of distinct visitor IDs associated with the provided linked ID. * * The `24_hours` interval of `distinct_ip`, `distinct_linked_id`, `distinct_country`, * `distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will be omitted - * if the number of `events` for the visitor Id in the last 24 + * if the number of `events` for the visitor ID in the last 24 * hours (`events.['24_hours']`) is higher than 20.000. * * All will not necessarily be returned in a response, some may be omitted if the @@ -53,7 +53,7 @@ * * @category Class * - * @description Sums key data points for a specific `visitor_id`, `ip_address` and `linked_id` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: - Number of distinct IP addresses associated to the visitor Id. - Number of distinct linked Ids associated with the visitor Id. - Number of distinct countries associated with the visitor Id. - Number of identification events associated with the visitor Id. - Number of identification events associated with the detected IP address. - Number of distinct IP addresses associated with the provided linked Id. - Number of distinct visitor Ids associated with the provided linked Id. The `24_hours` interval of `distinct_ip`, `distinct_linked_id`, `distinct_country`, `distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will be omitted if the number of `events` for the visitor Id in the last 24 hours (`events.['24_hours']`) is higher than 20.000. All will not necessarily be returned in a response, some may be omitted if the associated event does not have the required data, such as a linked_id. + * @description Sums key data points for a specific `visitor_id`, `ip_address` and `linked_id` at three distinct time intervals: 5 minutes, 1 hour, and 24 hours as follows: - Number of distinct IP addresses associated to the visitor ID. - Number of distinct linked IDs associated with the visitor ID. - Number of distinct countries associated with the visitor ID. - Number of identification events associated with the visitor ID. - Number of identification events associated with the detected IP address. - Number of distinct IP addresses associated with the provided linked ID. - Number of distinct visitor IDs associated with the provided linked ID. The `24_hours` interval of `distinct_ip`, `distinct_linked_id`, `distinct_country`, `distinct_ip_by_linked_id` and `distinct_visitor_id_by_linked_id` will be omitted if the number of `events` for the visitor ID in the last 24 hours (`events.['24_hours']`) is higher than 20.000. All will not necessarily be returned in a response, some may be omitted if the associated event does not have the required data, such as a linked_id. * * @author Fingerprint * diff --git a/src/Model/VelocityData.php b/src/Model/VelocityData.php index 381fa7173..9dd5e4e74 100644 --- a/src/Model/VelocityData.php +++ b/src/Model/VelocityData.php @@ -32,11 +32,11 @@ use Fingerprint\ServerSdk\ObjectSerializer; /** - * Is absent if the velocity data could not be generated for the visitor Id. + * Is absent if the velocity data could not be generated for the visitor ID. * * @category Class * - * @description Is absent if the velocity data could not be generated for the visitor Id. + * @description Is absent if the velocity data could not be generated for the visitor ID. * * @author Fingerprint * diff --git a/test/Model/DeviceDetailsTest.php b/test/Model/DeviceDetailsTest.php new file mode 100644 index 000000000..2676ce2ca --- /dev/null +++ b/test/Model/DeviceDetailsTest.php @@ -0,0 +1,188 @@ + 'samsung', + 'device_model' => 'SM-G991U', + 'os_version' => '13', + ]; + + /** + * Constructor without arguments should initialize all properties to null. + */ + public function testConstructorDefaults(): void + { + $model = new DeviceDetails(); + + $this->assertNull($model->getDeviceManufacturer()); + $this->assertNull($model->getDeviceModel()); + $this->assertNull($model->getOsVersion()); + } + + /** + * Constructor should accept an array and populate the properties. + */ + public function testConstructorWithData(): void + { + $model = new DeviceDetails(self::EXAMPLE); + + $this->assertEquals(self::EXAMPLE['device_manufacturer'], $model->getDeviceManufacturer()); + $this->assertEquals(self::EXAMPLE['device_model'], $model->getDeviceModel()); + $this->assertEquals(self::EXAMPLE['os_version'], $model->getOsVersion()); + } + + /** + * Setters should return the model instance for chaining. + */ + public function testSettersReturnSelf(): void + { + $model = new DeviceDetails(); + + $this->assertSame($model, $model->setDeviceManufacturer(self::EXAMPLE['device_manufacturer'])); + $this->assertSame($model, $model->setDeviceModel(self::EXAMPLE['device_model'])); + $this->assertSame($model, $model->setOsVersion(self::EXAMPLE['os_version'])); + } + + /** + * Serialization should preserve all property values through a round-trip. + * + * @throws \DateMalformedStringException + */ + public function testSerialization(): void + { + $model = new DeviceDetails(self::EXAMPLE); + + $json = json_encode(ObjectSerializer::sanitizeForSerialization($model)); + $deserialized = ObjectSerializer::deserialize(json_decode($json), DeviceDetails::class); + + $this->assertEquals($model->getDeviceManufacturer(), $deserialized->getDeviceManufacturer()); + $this->assertEquals($model->getDeviceModel(), $deserialized->getDeviceModel()); + $this->assertEquals($model->getOsVersion(), $deserialized->getOsVersion()); + } + + /** + * ArrayAccess interface should allow bracket notation for getting and setting properties. + * + * @noinspection PhpConditionAlreadyCheckedInspection + */ + public function testArrayAccess(): void + { + $model = new DeviceDetails(); + + $model['device_model'] = self::EXAMPLE['device_model']; + $this->assertEquals(self::EXAMPLE['device_model'], $model['device_model']); + $this->assertTrue(isset($model['device_model'])); + + unset($model['device_model']); + $this->assertNull($model['device_model']); + } + + /** + * DeviceDetails has no required properties so an empty model should always be valid. + */ + public function testValidation(): void + { + $emptyModel = new DeviceDetails(); + $this->assertTrue($emptyModel->valid()); + $this->assertEmpty($emptyModel->listInvalidProperties()); + + $validModel = new DeviceDetails(self::EXAMPLE); + $this->assertTrue($validModel->valid()); + $this->assertEmpty($validModel->listInvalidProperties()); + } + + /** + * __toString should return a pretty-printed JSON representation. + */ + public function testToString(): void + { + $model = new DeviceDetails(self::EXAMPLE); + $string = (string) $model; + + $decoded = json_decode($string, true); + $this->assertEquals(self::EXAMPLE['device_manufacturer'], $decoded['device_manufacturer']); + $this->assertEquals(self::EXAMPLE['device_model'], $decoded['device_model']); + } + + /** + * getModelName should return the OpenAPI model name. + */ + public function testGetModelName(): void + { + $model = new DeviceDetails(); + + $this->assertEquals('DeviceDetails', $model->getModelName()); + } + + /** + * offsetSet with null offset should append the value to the container. + */ + public function testOffsetSetWithNullKey(): void + { + $model = new DeviceDetails(); + + $model[] = 'appended_value'; + $this->assertEquals('appended_value', $model[0]); + } + + /** + * jsonSerialize should return the sanitized representation used by json_encode. + */ + public function testJsonSerialize(): void + { + $model = new DeviceDetails(self::EXAMPLE); + $serialized = $model->jsonSerialize(); + + $this->assertIsObject($serialized); + $this->assertEquals(self::EXAMPLE['device_manufacturer'], $serialized->device_manufacturer); + $this->assertEquals(self::EXAMPLE['os_version'], $serialized->os_version); + } + + /** + * toHeaderValue should return a compact JSON string without newlines. + */ + public function testToHeaderValue(): void + { + $model = new DeviceDetails(self::EXAMPLE); + $header = $model->toHeaderValue(); + + $decoded = json_decode($header, true); + $this->assertIsArray($decoded); + $this->assertEquals(self::EXAMPLE['device_model'], $decoded['device_model']); + $this->assertStringNotContainsString("\n", $header); + } + + /** + * os_version is a free-form string: component count varies by platform and OS era + * and must survive a round-trip verbatim, without normalization or zero-padding. + */ + public function testOsVersionKeepsVariableComponentCount(): void + { + foreach (['17.4.1', '13', '16.1', '8.1.0'] as $version) { + $model = new DeviceDetails(['os_version' => $version]); + + $json = json_encode(ObjectSerializer::sanitizeForSerialization($model)); + $deserialized = ObjectSerializer::deserialize(json_decode($json), DeviceDetails::class); + + $this->assertSame($version, $deserialized->getOsVersion()); + } + } + + public function testIsNullableSetToNullPath(): void + { + $model = new DeviceDetails(); + $this->assertIsBool($model->isNullableSetToNull('device_model')); + } +} diff --git a/test/mocks/errors/400_edge_ip_required.json b/test/mocks/errors/400_edge_ip_required.json new file mode 100644 index 000000000..8f055f8f6 --- /dev/null +++ b/test/mocks/errors/400_edge_ip_required.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "request_cannot_be_parsed", + "message": "at least one of ipv4_address or ipv6_address is required" + } +} diff --git a/test/mocks/errors/400_edge_unknown_field.json b/test/mocks/errors/400_edge_unknown_field.json new file mode 100644 index 000000000..c0a153ef3 --- /dev/null +++ b/test/mocks/errors/400_edge_unknown_field.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "request_cannot_be_parsed", + "message": "request body contains an unknown field \"unknown\"" + } +} \ No newline at end of file diff --git a/test/mocks/errors/400_request_read_timeout.json b/test/mocks/errors/400_request_read_timeout.json new file mode 100644 index 000000000..89daaca82 --- /dev/null +++ b/test/mocks/errors/400_request_read_timeout.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "request_read_timeout", + "message": "request read timeout" + } +} \ No newline at end of file diff --git a/test/mocks/errors/413_payload_too_large.json b/test/mocks/errors/413_payload_too_large.json new file mode 100644 index 000000000..00a1c6f94 --- /dev/null +++ b/test/mocks/errors/413_payload_too_large.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "payload_too_large", + "message": "payload too large" + } +} diff --git a/test/mocks/errors/429_too_many_search_requests.json b/test/mocks/errors/429_too_many_search_requests.json new file mode 100644 index 000000000..bc42b32a5 --- /dev/null +++ b/test/mocks/errors/429_too_many_search_requests.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "too_many_requests", + "message": "too many search requests" + } +} diff --git a/test/mocks/events/get_event_200.json b/test/mocks/events/get_event_200.json index 72f12f444..e3446c047 100644 --- a/test/mocks/events/get_event_200.json +++ b/test/mocks/events/get_event_200.json @@ -185,6 +185,11 @@ } }, "developer_tools": false, + "device_details": { + "device_manufacturer": "samsung", + "device_model": "SM-G991U", + "os_version": "13" + }, "mitm_attack": false, "sdk": { "platform": "js", diff --git a/test/mocks/events/get_event_200_with_unknown_field.json b/test/mocks/events/get_event_200_with_unknown_field.json index e6712e39e..39bc63243 100644 --- a/test/mocks/events/get_event_200_with_unknown_field.json +++ b/test/mocks/events/get_event_200_with_unknown_field.json @@ -186,6 +186,11 @@ } }, "developer_tools": false, + "device_details": { + "device_manufacturer": "samsung", + "device_model": "SM-G991U", + "os_version": "13" + }, "mitm_attack": false, "sdk": { "platform": "js", diff --git a/test/mocks/events/get_event_ruleset_200.json b/test/mocks/events/get_event_ruleset_200.json index f775f7d9d..94863ac3a 100644 --- a/test/mocks/events/get_event_ruleset_200.json +++ b/test/mocks/events/get_event_ruleset_200.json @@ -185,6 +185,11 @@ } }, "developer_tools": false, + "device_details": { + "device_manufacturer": "samsung", + "device_model": "SM-G991U", + "os_version": "13" + }, "mitm_attack": false, "sdk": { "platform": "js", diff --git a/test/mocks/events/get_event_with_bot_info_200.json b/test/mocks/events/get_event_with_bot_info_200.json index 98ca7d5c9..c346afff6 100644 --- a/test/mocks/events/get_event_with_bot_info_200.json +++ b/test/mocks/events/get_event_with_bot_info_200.json @@ -191,6 +191,11 @@ } }, "developer_tools": false, + "device_details": { + "device_manufacturer": "samsung", + "device_model": "SM-G991U", + "os_version": "13" + }, "mitm_attack": false, "sdk": { "platform": "js", diff --git a/test/mocks/events/get_event_with_edge_200.json b/test/mocks/events/get_event_with_edge_200.json new file mode 100644 index 000000000..387c86eb3 --- /dev/null +++ b/test/mocks/events/get_event_with_edge_200.json @@ -0,0 +1,51 @@ +{ + "event_id": "1758130560902.8tRtrH", + "timestamp": 1758130560902, + "source": "edge", + "url": "https://example.com/login?foo=bar", + "bot_info": { + "category": "ai_agent", + "provider": "OpenAI", + "provider_url": "https://openai.com", + "name": "ChatGPT Agent", + "identity": "signed", + "confidence": "high" + }, + "ip_info": { + "v4": { + "address": "104.210.139.192", + "geolocation": { + "accuracy_radius": 20, + "latitude": 29.42412, + "longitude": -98.49363, + "postal_code": "78205", + "timezone": "America/Chicago", + "city_name": "San Antonio", + "country_code": "US", + "country_name": "United States", + "continent_code": "NA", + "continent_name": "North America", + "subdivisions": [ + { + "iso_code": "TX", + "name": "Texas" + } + ] + }, + "asn": "8075", + "asn_name": "Microsoft Corporation", + "asn_network": "104.208.0.0/13", + "asn_type": "hosting", + "datacenter_result": true, + "datacenter_name": "Microsoft Azure" + } + }, + "proxy": false, + "proxy_confidence": "high", + "vpn": false, + "vpn_confidence": "medium", + "vpn_methods": { + "public_vpn": false, + "relay": false + } +} \ No newline at end of file diff --git a/test/mocks/events/search/get_event_search_200.json b/test/mocks/events/search/get_event_search_200.json index 8e9dbdc81..5729c37db 100644 --- a/test/mocks/events/search/get_event_search_200.json +++ b/test/mocks/events/search/get_event_search_200.json @@ -187,6 +187,11 @@ } }, "developer_tools": false, + "device_details": { + "device_manufacturer": "samsung", + "device_model": "SM-G991U", + "os_version": "13" + }, "mitm_attack": false, "sdk": { "platform": "js",