diff --git a/.github/workflows/functional.yml b/.github/workflows/functional.yml index a3b7a750..14e7cc57 100644 --- a/.github/workflows/functional.yml +++ b/.github/workflows/functional.yml @@ -20,17 +20,14 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - java: [ '11', '17', '21' ] + java: [ '11', '17', '21', '25' ] steps: - uses: actions/checkout@v4 with: ref: ${{ github.event.pull_request.head.sha }} - - uses: actions/setup-java@v4 - with: - distribution: 'zulu' - java-version: '${{ matrix.java }}' - - run: ./gradlew runFunctionalTests + # Gradle will detect the JVM installation from the ubuntu-latest image and use it + - run: ./gradlew runFunctionalTests -PjavaVersion=${{ matrix.java }} --stacktrace env: FPJS_API_SECRET: "${{ secrets.FPJS_API_SECRET }}" FPJS_API_REGION: "${{ secrets.FPJS_API_REGION }}" diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 65890cfd..2631448b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -6,18 +6,22 @@ on: - main jobs: + format-check: + runs-on: ubuntu-latest + name: Check source code formatting + steps: + - uses: actions/checkout@v4 + - run: ./gradlew :sdk:checkFormat :examples:checkFormat --continue + test: runs-on: ubuntu-latest - name: Java ${{ matrix.Java }} + name: Java ${{ matrix.java }} strategy: matrix: - java: [ '11', '17', '21' ] + java: [ '11', '17', '21', '25' ] steps: - uses: actions/checkout@v4 - - uses: actions/setup-java@v4 - with: - distribution: 'zulu' - java-version: '${{ matrix.java }}' + # Gradle will detect the JVM installation from the ubuntu-latest image and use it # includes execution of unit tests - - run: ./gradlew build + - run: ./gradlew build -PjavaVersion=${{ matrix.java }} --stacktrace diff --git a/LICENSE b/LICENSE index 73787fef..39cbe4f6 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2023 FingerprintJS +Copyright (c) 2026 FingerprintJS Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index df58d049..f5bed707 100644 --- a/README.md +++ b/README.md @@ -107,12 +107,12 @@ Then manually install the following JARs: Please follow the [installation](#installation) instruction and execute the following Java code: ```java -package main; +package com.fingerprint.example; import com.fingerprint.v4.api.FingerprintApi; -import com.fingerprint.v4.model.Events; -import com.fingerprint.v4.model.UpdateEvents; -import com.fingerprint.v4.model.VisitorsGetResponse; +import com.fingerprint.v4.model.Event; +import com.fingerprint.v4.model.EventSearch; +import com.fingerprint.v4.model.EventUpdate; import com.fingerprint.v4.sdk.ApiClient; import com.fingerprint.v4.sdk.ApiException; import com.fingerprint.v4.sdk.Configuration; @@ -146,9 +146,9 @@ public class FingerprintApiExample { FingerprintApi api = new FingerprintApi(client); // Get an event with a given requestId try { - // Fetch the event with a given requestId - Event response = api.getEvent(FPJS_EVENT_ID); - System.out.println(response.getProducts().toString()); + // Fetch the event with a given eventId + Event event = api.getEvent(FPJS_EVENT_ID); + System.out.println(event.getIdentification().getVisitorId()); } catch (ApiException e) { System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage()); } @@ -156,14 +156,14 @@ public class FingerprintApiExample { // Search events with custom filters try { // By visitorId - SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setVisitorId(FPJS_VISITOR_ID)); + EventSearch response = api.searchEvents(new FingerprintApi.SearchEventsOptionalParams().setLimit(LIMIT).setVisitorId(FPJS_VISITOR_ID)); // Next page - // SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setPaginationKey(response.getPaginationKey()).setVisitorId(FPJS_VISITOR_ID)); + // EventSearch response = api.searchEvents(new FingerprintApi.SearchEventsOptionalParams().setLimit(LIMIT).setPaginationKey(PAGINATION_KEY).setVisitorId(FPJS_VISITOR_ID)); // Bad bot - // SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setBot("bad")); + // EventSearch response = api.searchEvents(new FingerprintApi.SearchEventsOptionalParams().setLimit(LIMIT).setBot(SearchEventsBot.BAD)); // Filtered by IP - // SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setIpAddress("192.168.0.1/32")); - System.out.println(response.getEvents().toString()); + // EventSearch response = api.searchEvents(new FingerprintApi.SearchEventsOptionalParams().setLimit(LIMIT).setIpAddress("192.168.0.1/32")); + System.out.println(response.getEvents()); } catch (ApiException e) { System.err.println("Exception when calling FingerprintApi.searchEvents:" + e.getMessage()); } @@ -171,7 +171,7 @@ public class FingerprintApiExample { // Update an event with a given requestId try { EventUpdate request = new EventUpdate(); - request.setLinkedId("myNewLinkedId"); + request.setLinkedId(FPJS_LINKED_ID); api.updateEvent(FPJS_EVENT_ID, request); } catch (ApiException e) { System.err.println("Exception when calling FingerprintApi.updateEvent:" + e.getMessage()); @@ -191,10 +191,10 @@ public class FingerprintApiExample { This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results). ```java -package com.fingerprint.v4.example; +package com.fingerprint.example; import com.fingerprint.v4.Sealed; -import com.fingerprint.v4.model.EventsGetResponse; +import com.fingerprint.v4.model.Event; import java.util.Base64; @@ -206,7 +206,7 @@ public class SealedResults { // Base64 encoded key generated in the dashboard. String SEALED_KEY = System.getenv("BASE64_KEY"); - final EventsGetResponse event = Sealed.unsealEventResponse( + final Event event = Sealed.unsealEventResponse( Base64.getDecoder().decode(SEALED_RESULT), // You can provide more than one key to support key rotation. The SDK will try to decrypt the result with each key. new Sealed.DecryptionKey[]{ @@ -220,7 +220,6 @@ public class SealedResults { // Do something with unsealed response, e.g: send it back to the frontend. } } - ``` To learn more, see the [Sealed results example](/examples/src/main/java/com/fingerprint/example/SealedResults.java). @@ -229,6 +228,8 @@ This SDK provides utility method for verifying the HMAC signature of the incomin Here is an example implementation using Spring Boot: ```java +package com.fingerprint.example; + import com.fingerprint.v4.sdk.WebhookValidation; @RestController @@ -319,15 +320,6 @@ Class | Method | HTTP request | Description - [WebGlExtensions](docs/WebGlExtensions.md) -## Documentation for Authorization - -Authentication schemes defined for the API: -### bearerAuth - - -- **Type**: HTTP basic authentication - - ## Documentation for sealed results - [Sealed](docs/Sealed.md) diff --git a/build.gradle.kts b/build.gradle.kts index 6186c441..be3b220c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,7 @@ +import java.net.URL +import java.nio.file.Files +import java.nio.file.StandardCopyOption + val projectVersion: String by project allprojects { @@ -5,3 +9,128 @@ allprojects { version = projectVersion } +plugins { + alias(libs.plugins.google.osdetector) +} + +// Register formatting tasks for each subproject + +val googleJavaFormatExeFile = layout.buildDirectory.file("google-java-format.exe") +val googleJavaFormatOsSuffixMap = mapOf( + "osx" to "darwin", + "linux" to "linux", + "windows" to "windows", +) +val googleJavaFormatArchSuffixMap = mapOf( + "x86_64" to "x86-64", + "aarch_64" to "arm64" +) +val googleJavaFormatBinarySuffixMap = mapOf( + "osx" to "", + "linux" to "", + "windows" to ".exe" +) + +tasks.register("downloadGoogleJavaFormat") { + val osSuffix = googleJavaFormatOsSuffixMap[osdetector.os] + val archSuffix = googleJavaFormatArchSuffixMap[osdetector.arch] + val binarySuffix = googleJavaFormatBinarySuffixMap[osdetector.os] + val googleJavaFormatVersion = libs.versions.google.java.format.get() + val downloadUrl = "https://github.com/google/google-java-format/releases/download/v$googleJavaFormatVersion/google-java-format_${osSuffix}-${archSuffix}${binarySuffix}" + outputs.file(googleJavaFormatExeFile) + + doLast { + val file = googleJavaFormatExeFile.get().asFile + if (!file.exists()) { + println("Downloading google-java-format for $osSuffix-$archSuffix") + URL(downloadUrl).openStream().use { input -> + Files.copy(input, file.toPath(), StandardCopyOption.REPLACE_EXISTING) + } + file.setExecutable(true) + } else { + println("google-java-format already downloaded") + } + } +} + + +fun Project.registerFormatTasks() { + val inputFiles = fileTree("src") { + include("**/*.java") + }.files.map { it.absolutePath } + + tasks.register("format") { + dependsOn(rootProject.tasks.named("downloadGoogleJavaFormat")) + + doLast { + // First, fix the imports + exec { + executable = googleJavaFormatExeFile.get().asFile.toPath().toString() + args = listOf("--replace", "--fix-imports-only") + inputFiles + } + + // Second, format the code. This ensures that the removal of unused imports does not + // introduce the need to run another formatting pass to pass the formatting checks. + exec { + executable = googleJavaFormatExeFile.get().asFile.toPath().toString() + args = listOf("--replace", "--skip-javadoc-formatting", "--skip-reflowing-long-strings") + inputFiles + } + } + } + + tasks.register("checkFormat") { + dependsOn(rootProject.tasks.named("downloadGoogleJavaFormat")) + + doFirst { + println("The following source files need to be formatted:") + } + + executable = googleJavaFormatExeFile.get().asFile.toPath().toString() + args = listOf("--dry-run", "--set-exit-if-changed", "--skip-javadoc-formatting", "--skip-reflowing-long-strings") + inputFiles + } +} + +subprojects { + registerFormatTasks() + + plugins.withType { + tasks.withType { + // Target java 11 + options.release = 11 + + // Enable all warnings and fail the build for any warnings + options.compilerArgs.addAll(listOf("-Xlint:all", "-Werror")) + } + + // Print Java toolchain for compilation + tasks.withType().configureEach { + doFirst { + println("Compiling with Java: ${javaCompiler.get().metadata.installationPath} (version: ${javaCompiler.get().metadata.languageVersion})") + } + } + + // Print Java toolchain used for running tests + tasks.withType().configureEach { + doFirst { + val launcher = javaLauncher.orNull + if (launcher != null) { + println("Testing with Java: ${launcher.metadata.installationPath} (version: ${launcher.metadata.languageVersion})") + } else { + println("Testing with Java: launcher not set") + } + } + } + + // Print Java toolchain used for running + tasks.withType().configureEach { + doFirst { + val launcher = javaLauncher.orNull + if (launcher != null) { + println("Running JavaExec with Java: ${launcher.metadata.installationPath} (version: ${launcher.metadata.languageVersion})") + } else { + println("Running JavaExec with Java: launcher not set") + } + } + } + } +} diff --git a/docs/BotInfo.md b/docs/BotInfo.md index 3464090e..86e33c55 100644 --- a/docs/BotInfo.md +++ b/docs/BotInfo.md @@ -25,6 +25,7 @@ Extended bot information. | SIGNED | "signed" | | SPOOFED | "spoofed" | | UNKNOWN | "unknown" | +| UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED | "unsupported_value_sdk_upgrade_required" | @@ -35,6 +36,7 @@ Extended bot information. | LOW | "low" | | MEDIUM | "medium" | | HIGH | "high" | +| UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED | "unsupported_value_sdk_upgrade_required" | diff --git a/docs/BotResult.md b/docs/BotResult.md index cdbc0a41..736a0de5 100644 --- a/docs/BotResult.md +++ b/docs/BotResult.md @@ -16,5 +16,7 @@ Bot detection result: * `NOT_DETECTED` (value: `"not_detected"`) +* `UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED` (value: `"unsupported_value_sdk_upgrade_required"`) + diff --git a/docs/ErrorCode.md b/docs/ErrorCode.md index 6d22a8ce..bcad66b0 100644 --- a/docs/ErrorCode.md +++ b/docs/ErrorCode.md @@ -66,5 +66,7 @@ Error code: * `RULESET_NOT_FOUND` (value: `"ruleset_not_found"`) +* `UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED` (value: `"unsupported_value_sdk_upgrade_required"`) + diff --git a/docs/Event.md b/docs/Event.md index 143395fc..b5a93437 100644 --- a/docs/Event.md +++ b/docs/Event.md @@ -12,12 +12,12 @@ Contains results from Fingerprint Identification and all active Smart Signals. |**timestamp** | **Long** | Timestamp of the event with millisecond precision in Unix time. | | |**linkedId** | **String** | A customer-provided id that was sent with the request. | [optional] | |**environmentId** | **String** | Environment Id of the event. For example: `ae_47abaca3db2c7c43` | [optional] | -|**suspect** | **Boolean** | Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent). | [optional] | +|**suspect** | **Boolean** | 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] | |**sdk** | [**SDK**](SDK.md) | | [optional] | |**replayed** | **Boolean** | `true` if we determined that this payload was replayed, `false` otherwise. | [optional] | |**identification** | [**Identification**](Identification.md) | | [optional] | |**supplementaryIdHighRecall** | [**SupplementaryIDHighRecall**](SupplementaryIDHighRecall.md) | | [optional] | -|**tags** | **Object** | A customer-provided value or an object that was sent with the identification request or updated later. | [optional] | +|**tags** | **Map<String, Object>** | 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. For example `https://example.com/` | [optional] | |**bundleId** | **String** | Bundle Id of the iOS application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` | [optional] | |**packageName** | **String** | Package name of the Android application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` | [optional] | @@ -32,7 +32,7 @@ Contains results from Fingerprint Identification and all active Smart Signals. |**clonedApp** | **Boolean** | 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] | |**developerTools** | **Boolean** | `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. | [optional] | |**emulator** | **Boolean** | 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] | -|**factoryResetTimestamp** | **Long** | 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://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. | [optional] | +|**factoryResetTimestamp** | **Long** | 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** | **Boolean** | [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] | |**ipBlocklist** | [**IPBlockList**](IPBlockList.md) | | [optional] | |**ipInfo** | [**IPInfo**](IPInfo.md) | | [optional] | @@ -42,11 +42,11 @@ Contains results from Fingerprint Identification and all active Smart Signals. |**incognito** | **Boolean** | `true` if we detected incognito mode used in the browser, `false` otherwise. | [optional] | |**jailbroken** | **Boolean** | iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. | [optional] | |**locationSpoofing** | **Boolean** | Flag indicating whether the request came from a mobile device with location spoofing enabled. | [optional] | -|**mitmAttack** | **Boolean** | * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. | [optional] | +|**mitmAttack** | **Boolean** | * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://docs.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. | [optional] | |**privacySettings** | **Boolean** | `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. | [optional] | |**rootApps** | **Boolean** | Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. | [optional] | |**ruleAction** | [**EventRuleAction**](EventRuleAction.md) | | [optional] | -|**suspectScore** | **Integer** | Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score | [optional] | +|**suspectScore** | **Integer** | Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://docs.fingerprint.com/docs/suspect-score | [optional] | |**tampering** | **Boolean** | Flag indicating browser tampering was detected. This happens when either: * There are inconsistencies in the browser configuration that cross internal tampering thresholds (see `tampering_details.anomaly_score`). * The browser signature resembles an \"anti-detect\" browser specifically designed to evade fingerprinting (see `tampering_details.anti_detect_browser`). | [optional] | |**tamperingDetails** | [**TamperingDetails**](TamperingDetails.md) | | [optional] | |**velocity** | [**Velocity**](Velocity.md) | | [optional] | diff --git a/docs/EventUpdate.md b/docs/EventUpdate.md index d88cb7e4..ba5dd259 100644 --- a/docs/EventUpdate.md +++ b/docs/EventUpdate.md @@ -8,7 +8,7 @@ | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**linkedId** | **String** | Linked Id value to assign to the existing event | [optional] | -|**tags** | **Object** | A customer-provided value or an object that was sent with the identification request or updated later. | [optional] | +|**tags** | **Map<String, Object>** | A customer-provided value or an object that was sent with the identification request or updated later. | [optional] | |**suspect** | **Boolean** | Suspect flag indicating observed suspicious or fraudulent event | [optional] | diff --git a/docs/FingerprintApi.md b/docs/FingerprintApi.md index 9fef22c2..88f1d647 100644 --- a/docs/FingerprintApi.md +++ b/docs/FingerprintApi.md @@ -25,10 +25,10 @@ Request deleting all data associated with the specified visitor ID. This API is #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. -- Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). +- Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://docs.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) -- Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). +- Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://docs.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. @@ -36,7 +36,7 @@ Request deleting all data associated with the specified visitor ID. This API is ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. -- If you request [`/v4/events` API](https://dev.fingerprint.com/reference/getevent) with an `event_id` that was made outside of the 10 days, you will still receive a valid response. +- If you request [`/v4/events` API](https://docs.fingerprint.com/reference/server-api-v4-get-event) with an `event_id` that was made outside of the 10 days, you will still receive a valid response. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. @@ -47,8 +47,10 @@ Please [contact our support team](https://fingerprint.com/support/) to enable it ```java package main; +import java.util.*; + import com.fingerprint.v4.api.FingerprintApi; -import com.fingerprint.v4.sdk.model.*; +import com.fingerprint.v4.model.*; import com.fingerprint.v4.sdk.ApiClient; import com.fingerprint.v4.sdk.ApiException; import com.fingerprint.v4.sdk.Region; @@ -67,7 +69,7 @@ public class FingerprintApiExample { Region.ASIA */ FingerprintApi api = new FingerprintApi(FPJS_API_SECRET, Region.EUROPE); - String visitorId = "visitorId_example"; // String | The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. + String visitorId = "visitorId_example"; // String | The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. try { api.deleteVisitorData(visitorId); } catch (ApiException e) { @@ -83,7 +85,7 @@ public class FingerprintApiExample { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **visitorId** | **String**| The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. | | +| **visitorId** | **String**| The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. | | ### Return type @@ -124,8 +126,10 @@ Use `event_id` as the URL path parameter. This API method is scoped to a request ```java package main; +import java.util.*; + import com.fingerprint.v4.api.FingerprintApi; -import com.fingerprint.v4.sdk.model.*; +import com.fingerprint.v4.model.*; import com.fingerprint.v4.sdk.ApiClient; import com.fingerprint.v4.sdk.ApiException; import com.fingerprint.v4.sdk.Region; @@ -144,7 +148,7 @@ public class FingerprintApiExample { Region.ASIA */ FingerprintApi api = new FingerprintApi(FPJS_API_SECRET, Region.EUROPE); - String eventId = "eventId_example"; // String | The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request (`requestId` can be used in its place). + String eventId = "eventId_example"; // 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). String rulesetId = "rulesetId_example"; // 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 { Event result = api.getEvent(eventId, new FingerprintApi.GetEventOptionalParams() @@ -163,7 +167,7 @@ public class FingerprintApiExample { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **eventId** | **String**| The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request (`requestId` can be used in its place). | | +| **eventId** | **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). | | | **getEventOptionalParams** | [**FingerprintApi.GetEventOptionalParams**](#fingerprintapigeteventoptionalparams) | | [optional] | #### FingerprintApi.GetEventOptionalParams @@ -232,8 +236,10 @@ Smart Signals not activated for your workspace or are not included in the respon ```java package main; +import java.util.*; + import com.fingerprint.v4.api.FingerprintApi; -import com.fingerprint.v4.sdk.model.*; +import com.fingerprint.v4.model.*; import com.fingerprint.v4.sdk.ApiClient; import com.fingerprint.v4.sdk.ApiException; import com.fingerprint.v4.sdk.Region; @@ -254,11 +260,11 @@ public class FingerprintApiExample { FingerprintApi api = new FingerprintApi(FPJS_API_SECRET, Region.EUROPE); Integer limit = 10; // Integer | Limit the number of events returned. String paginationKey = "paginationKey_example"; // 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 200 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=1740815825085` - String visitorId = "visitorId_example"; // String | Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. - SearchEventsBot bot = SearchEventsBot.fromValue("all"); // 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 `botd.bot` property set to a valid value are returned. Events without a `botd` Smart Signal result are left out of the response. + String visitorId = "visitorId_example"; // 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 for events matching this `visitor_id`. + SearchEventsBot bot = SearchEventsBot.fromValue("all"); // 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. String ipAddress = "ipAddress_example"; // 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 String asn = "asn_example"; // 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. - String linkedId = "linkedId_example"; // String | Filter events by your custom identifier. You can use [linked Ids](https://dev.fingerprint.com/reference/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. + String linkedId = "linkedId_example"; // 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. String url = "url_example"; // String | Filter events by the URL (`url` property) associated with the event. String bundleId = "bundleId_example"; // String | Filter events by the Bundle ID (iOS) associated with the event. String packageName = "packageName_example"; // String | Filter events by the Package Name (Android) associated with the event. @@ -266,7 +272,7 @@ public class FingerprintApiExample { Long start = 56L; // Long | Filter events with a timestamp greater than the start time, in Unix time (milliseconds). Long end = 56L; // Long | Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). Boolean reverse = true; // Boolean | Sort events in reverse timestamp order. - Boolean suspect = true; // Boolean | Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. + Boolean suspect = true; // Boolean | Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. Boolean vpn = true; // Boolean | Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. Boolean virtualMachine = true; // Boolean | Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. Boolean tampering = true; // Boolean | Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. @@ -356,11 +362,11 @@ Object containing optional parameters for API method. Supports a fluent interfac |------------- | ------------- | ------------- | -------------| | **limit** | **Integer**| Limit the number of events returned. | [optional] [default to 10] | | **paginationKey** | **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 200 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=1740815825085` | [optional] | -| **visitorId** | **String**| Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. | [optional] | -| **bot** | **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 `botd.bot` property set to a valid value are returned. Events without a `botd` Smart Signal result are left out of the response. | [optional] [enum: all, good, bad, none] | +| **visitorId** | **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 for events matching this `visitor_id`. | [optional] | +| **bot** | **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. | [optional] [enum: all, good, bad, none] | | **ipAddress** | **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] | -| **linkedId** | **String**| Filter events by your custom identifier. You can use [linked Ids](https://dev.fingerprint.com/reference/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] | +| **linkedId** | **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] | | **url** | **String**| Filter events by the URL (`url` property) associated with the event. | [optional] | | **bundleId** | **String**| Filter events by the Bundle ID (iOS) associated with the event. | [optional] | | **packageName** | **String**| Filter events by the Package Name (Android) associated with the event. | [optional] | @@ -368,7 +374,7 @@ Object containing optional parameters for API method. Supports a fluent interfac | **start** | **Long**| Filter events with a timestamp greater than the start time, in Unix time (milliseconds). | [optional] | | **end** | **Long**| Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). | [optional] | | **reverse** | **Boolean**| Sort events in reverse timestamp order. | [optional] | -| **suspect** | **Boolean**| Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. | [optional] | +| **suspect** | **Boolean**| Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. | [optional] | | **vpn** | **Boolean**| Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. | [optional] | | **virtualMachine** | **Boolean**| Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. | [optional] | | **tampering** | **Boolean**| Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. | [optional] | @@ -438,8 +444,10 @@ error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully p ```java package main; +import java.util.*; + import com.fingerprint.v4.api.FingerprintApi; -import com.fingerprint.v4.sdk.model.*; +import com.fingerprint.v4.model.*; import com.fingerprint.v4.sdk.ApiClient; import com.fingerprint.v4.sdk.ApiException; import com.fingerprint.v4.sdk.Region; @@ -458,7 +466,7 @@ public class FingerprintApiExample { Region.ASIA */ FingerprintApi api = new FingerprintApi(FPJS_API_SECRET, Region.EUROPE); - String eventId = "eventId_example"; // String | The unique event [identifier](https://dev.fingerprint.com/reference/get-function#event_id). + String eventId = "eventId_example"; // String | The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). EventUpdate eventUpdate = new EventUpdate(); // EventUpdate | try { api.updateEvent(eventId, eventUpdate); @@ -475,7 +483,7 @@ public class FingerprintApiExample { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| -| **eventId** | **String**| The unique event [identifier](https://dev.fingerprint.com/reference/get-function#event_id). | | +| **eventId** | **String**| The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). | | | **eventUpdate** | [**EventUpdate**](EventUpdate.md)| | | ### Return type diff --git a/docs/Proximity.md b/docs/Proximity.md index b9a3126f..972576a9 100644 --- a/docs/Proximity.md +++ b/docs/Proximity.md @@ -27,6 +27,7 @@ Proximity ID represents a fixed geographical zone in a discrete global grid with | NUMBER_3300 | 3300 | | NUMBER_8500 | 8500 | | NUMBER_22500 | 22500 | +| UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED | Integer.MAX_VALUE | diff --git a/docs/ProxyConfidence.md b/docs/ProxyConfidence.md index f3329de5..d5ad4e49 100644 --- a/docs/ProxyConfidence.md +++ b/docs/ProxyConfidence.md @@ -13,5 +13,7 @@ Confidence level of the proxy detection. If a proxy is not detected, confidence * `HIGH` (value: `"high"`) +* `UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED` (value: `"unsupported_value_sdk_upgrade_required"`) + diff --git a/docs/ProxyDetails.md b/docs/ProxyDetails.md index 8e1876f3..85a60f19 100644 --- a/docs/ProxyDetails.md +++ b/docs/ProxyDetails.md @@ -20,6 +20,7 @@ Proxy detection details (present if `proxy` is `true`) |---- | -----| | RESIDENTIAL | "residential" | | DATA_CENTER | "data_center" | +| UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED | "unsupported_value_sdk_upgrade_required" | diff --git a/docs/RuleActionType.md b/docs/RuleActionType.md index 4257e1ae..99978996 100644 --- a/docs/RuleActionType.md +++ b/docs/RuleActionType.md @@ -10,5 +10,7 @@ Describes the action to take with the request. * `BLOCK` (value: `"block"`) +* `UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED` (value: `"unsupported_value_sdk_upgrade_required"`) + diff --git a/docs/SDK.md b/docs/SDK.md index 3a42f60b..3a902aef 100644 --- a/docs/SDK.md +++ b/docs/SDK.md @@ -22,6 +22,7 @@ Contains information about the SDK used to perform the request. | ANDROID | "android" | | IOS | "ios" | | UNKNOWN | "unknown" | +| UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED | "unsupported_value_sdk_upgrade_required" | diff --git a/docs/SearchEventsBot.md b/docs/SearchEventsBot.md index 35ae3ab7..ee96b431 100644 --- a/docs/SearchEventsBot.md +++ b/docs/SearchEventsBot.md @@ -6,7 +6,7 @@ Filter events by the Bot Detection result, specifically: `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 `botd.bot` property set to a valid value are returned. Events without a `botd` Smart Signal result are left out of the response. +> 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. ## Enum @@ -20,5 +20,7 @@ Filter events by the Bot Detection result, specifically: * `NONE` (value: `"none"`) +* `UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED` (value: `"unsupported_value_sdk_upgrade_required"`) + diff --git a/docs/SearchEventsSdkPlatform.md b/docs/SearchEventsSdkPlatform.md index f183a343..20316e1a 100644 --- a/docs/SearchEventsSdkPlatform.md +++ b/docs/SearchEventsSdkPlatform.md @@ -16,5 +16,7 @@ Filter events by the SDK Platform associated with the identification event (`sdk * `IOS` (value: `"ios"`) +* `UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED` (value: `"unsupported_value_sdk_upgrade_required"`) + diff --git a/docs/SearchEventsVpnConfidence.md b/docs/SearchEventsVpnConfidence.md index 3ad6e805..8fd1b8c7 100644 --- a/docs/SearchEventsVpnConfidence.md +++ b/docs/SearchEventsVpnConfidence.md @@ -17,5 +17,7 @@ Filter events by VPN Detection result confidence level. * `LOW` (value: `"low"`) +* `UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED` (value: `"unsupported_value_sdk_upgrade_required"`) + diff --git a/docs/VpnConfidence.md b/docs/VpnConfidence.md index f0d0d9ef..1495ee5e 100644 --- a/docs/VpnConfidence.md +++ b/docs/VpnConfidence.md @@ -12,5 +12,7 @@ A confidence rating for the VPN detection result — "low", "medium", or "high". * `HIGH` (value: `"high"`) +* `UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED` (value: `"unsupported_value_sdk_upgrade_required"`) + diff --git a/examples/examples.gradle.kts b/examples/examples.gradle.kts index e99389c9..2227d930 100644 --- a/examples/examples.gradle.kts +++ b/examples/examples.gradle.kts @@ -8,6 +8,14 @@ plugins { java } +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of( + findProperty("javaVersion")?.toString() ?: "11" + )) + } +} + repositories { mavenLocal() mavenCentral() @@ -48,6 +56,11 @@ tasks.register("runFunctionalTests") { classpath = sourceSets["main"].runtimeClasspath environment(loadEnv()) jvmArgs("-ea") + javaLauncher.set( + javaToolchains.launcherFor { + languageVersion.set(JavaLanguageVersion.of(findProperty("javaVersion")?.toString() ?: "11")) + } + ) } tasks.named("runFunctionalTests") { diff --git a/examples/src/main/java/com/fingerprint/example/FunctionalTests.java b/examples/src/main/java/com/fingerprint/example/FunctionalTests.java index d81b833d..4a048b5a 100644 --- a/examples/src/main/java/com/fingerprint/example/FunctionalTests.java +++ b/examples/src/main/java/com/fingerprint/example/FunctionalTests.java @@ -1,10 +1,14 @@ package com.fingerprint.example; import com.fingerprint.v4.api.FingerprintApi; -import com.fingerprint.v4.model.*; +import com.fingerprint.v4.model.Event; +import com.fingerprint.v4.model.EventRuleActionAllow; +import com.fingerprint.v4.model.EventRuleActionBlock; +import com.fingerprint.v4.model.EventSearch; +import com.fingerprint.v4.model.EventUpdate; +import com.fingerprint.v4.model.RequestHeaderModifications; import com.fingerprint.v4.sdk.ApiException; import com.fingerprint.v4.sdk.Configuration; - import java.sql.Timestamp; import java.time.Instant; import java.time.temporal.ChronoUnit; @@ -14,108 +18,159 @@ public class FunctionalTests { - public static void main(String... args) { - final String apiSecret = System.getenv("FPJS_API_SECRET"); - if (apiSecret == null || apiSecret.isBlank()) { - System.err.println("Missing required environment variable: FPJS_API_SECRET"); - System.exit(1); - } + public static void main(String... args) { + final String apiSecret = System.getenv("FPJS_API_SECRET"); + if (apiSecret == null || apiSecret.isBlank()) { + System.err.println("Missing required environment variable: FPJS_API_SECRET"); + System.exit(1); + } - final String regionEnv = System.getenv("FPJS_API_REGION"); - final String region = regionEnv != null ? regionEnv.toLowerCase(Locale.getDefault()).trim() : "us"; - - final FingerprintApi api = new FingerprintApi(Configuration.getDefaultApiClient(apiSecret, region)); - - long end = Instant.now().toEpochMilli(); - long start = Instant.now().minus(90L, ChronoUnit.DAYS).toEpochMilli(); - - String eventId = ""; - - // Search events - try { - final EventSearch events = api.searchEvents(new FingerprintApi.SearchEventsOptionalParams() - .setLimit(2) - .setStart(start) - .setEnd(end)); - assert events.getEvents() != null; - if (events.getEvents().isEmpty()) { - System.err.println("FingerprintApi.searchEvents: is empty"); - System.exit(1); - } - final Event firstEvent = events.getEvents().get(0); - assert firstEvent != null; - eventId = firstEvent.getEventId(); - System.out.println(events.getEvents()); - } catch (ApiException e) { - System.err.println("Exception when calling FingerprintApi.searchEvents:" + e.getMessage()); - System.exit(1); - } + final String regionEnv = System.getenv("FPJS_API_REGION"); + final String region = + regionEnv != null ? regionEnv.toLowerCase(Locale.getDefault()).trim() : "us"; + + final FingerprintApi api = + new FingerprintApi(Configuration.getDefaultApiClient(apiSecret, region)); + + long end = Instant.now().toEpochMilli(); + long start = Instant.now().minus(90L, ChronoUnit.DAYS).toEpochMilli(); + + String eventId = ""; + + // Search events + try { + final EventSearch events = + api.searchEvents( + new FingerprintApi.SearchEventsOptionalParams() + .setLimit(2) + .setStart(start) + .setEnd(end)); + assert events.getEvents() != null; + if (events.getEvents().isEmpty()) { + System.err.println("FingerprintApi.searchEvents: is empty"); + System.exit(1); + } + final Event firstEvent = events.getEvents().get(0); + assert firstEvent != null; + eventId = firstEvent.getEventId(); + System.out.println(events.getEvents()); + } catch (ApiException e) { + System.err.println("Exception when calling FingerprintApi.searchEvents:" + e.getMessage()); + System.exit(1); + } - // Get identification event - try { - final Event event = api.getEvent(eventId); - System.out.println(event); - } catch (ApiException e) { - System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage()); - System.exit(1); - } + // Get identification event + try { + final Event event = api.getEvent(eventId); + System.out.println(event); + } catch (ApiException e) { + System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage()); + System.exit(1); + } - // Update identification event - final String requestIdToUpdate = System.getenv("FPJS_REQUEST_ID_TO_UPDATE"); - if (requestIdToUpdate != null) { - try { - final HashMap tags = new HashMap<>() { - { - put("timestamp", new Timestamp(new Date().getTime())); - } - }; - api.updateEvent(requestIdToUpdate, new EventUpdate().tags(tags)); - } catch (ApiException e) { - System.err.println("Exception when calling FingerprintApi.updateEvent:" + e.getMessage()); - System.exit(1); - } - } + // Update identification event + final String requestIdToUpdate = System.getenv("FPJS_REQUEST_ID_TO_UPDATE"); + if (requestIdToUpdate != null) { + try { + final HashMap tags = + new HashMap<>() { + { + put("timestamp", new Timestamp(new Date().getTime())); + } + }; + api.updateEvent(requestIdToUpdate, new EventUpdate().tags(tags)); + } catch (ApiException e) { + System.err.println("Exception when calling FingerprintApi.updateEvent:" + e.getMessage()); + System.exit(1); + } + } - // Delete visitor data - final String visitorIdToDelete = System.getenv("FPJS_VISITOR_ID_TO_DELETE"); - if (visitorIdToDelete != null) { - try { - api.deleteVisitorData(visitorIdToDelete); - } catch (ApiException e) { - System.err.println("Exception when calling FingerprintApi.deleteVisitor:" + e.getMessage()); - System.exit(1); - } - } + // Delete visitor data + final String visitorIdToDelete = System.getenv("FPJS_VISITOR_ID_TO_DELETE"); + if (visitorIdToDelete != null) { + try { + api.deleteVisitorData(visitorIdToDelete); + } catch (ApiException e) { + System.err.println("Exception when calling FingerprintApi.deleteVisitor:" + e.getMessage()); + System.exit(1); + } + } - // Check that old events are still match expected format - try { - final EventSearch oldEvents = api.searchEvents(new FingerprintApi.SearchEventsOptionalParams() - .setLimit(2) - .setStart(start) - .setEnd(end) - .setReverse(true)); - assert oldEvents.getEvents() != null; - if (oldEvents.getEvents().isEmpty()) { - System.err.println("FingerprintApi.searchEvents: is empty for old events"); - System.exit(1); - } - final Event oldEvent = oldEvents.getEvents().get(0); - assert oldEvent != null; - String oldRequestId = oldEvent.getEventId(); - - if (eventId.equals(oldRequestId)) { - System.err.println("Old events are identical to new"); - System.exit(1); - } - - api.getEvent(oldRequestId); - System.out.println("Old events are good"); - } catch (ApiException e) { - System.err.println("Exception when trying to read old data:" + e.getMessage()); - System.exit(1); - } + // Check that old events are still match expected format + try { + final EventSearch oldEvents = + api.searchEvents( + new FingerprintApi.SearchEventsOptionalParams() + .setLimit(2) + .setStart(start) + .setEnd(end) + .setReverse(true)); + assert oldEvents.getEvents() != null; + if (oldEvents.getEvents().isEmpty()) { + System.err.println("FingerprintApi.searchEvents: is empty for old events"); + System.exit(1); + } + final Event oldEvent = oldEvents.getEvents().get(0); + assert oldEvent != null; + String oldRequestId = oldEvent.getEventId(); + + if (eventId.equals(oldRequestId)) { + System.err.println("Old events are identical to new"); + System.exit(1); + } + + api.getEvent(oldRequestId); + System.out.println("Old events are good"); + } catch (ApiException e) { + System.err.println("Exception when trying to read old data:" + e.getMessage()); + System.exit(1); + } - System.out.println("Checks Passed"); - System.exit(0); + // Evaluate a ruleset + final String rulesetId = System.getenv("FPJS_RULESET_ID"); + if (rulesetId != null) { + try { + final Event event = + api.getEvent( + eventId, new FingerprintApi.GetEventOptionalParams().setRulesetId(rulesetId)); + if (event.getRuleAction() instanceof EventRuleActionAllow) { + EventRuleActionAllow allow = (EventRuleActionAllow) event.getRuleAction(); + System.out.printf( + "Rule action is allow\nRule id: %s\nRule expression: %s\n", + allow.getRuleId(), allow.getRuleExpression()); + if (allow.getRequestHeaderModifications() != null) { + RequestHeaderModifications requestHeaderModifications = + allow.getRequestHeaderModifications(); + System.out.printf( + "Request header modifications to set %s, to append %s, to remove %s\n", + requestHeaderModifications.getSet(), + requestHeaderModifications.getAppend(), + requestHeaderModifications.getRemove()); + } + } else if (event.getRuleAction() instanceof EventRuleActionBlock) { + EventRuleActionBlock block = (EventRuleActionBlock) event.getRuleAction(); + System.out.printf( + "Rule action is block. Rule id: %s\nRule expression: %s\nStatus code: %d\nHeaders: %s\nBody: %s\n", + block.getRuleId(), + block.getRuleExpression(), + block.getStatusCode(), + block.getHeaders(), + block.getBody()); + } else if (event.getRuleAction() != null) { + System.out.println( + "Action type is unexpected (please make sure the library is at the latest version"); + } else { + System.err.println( + "Fingerprint.getEvent ruleset evaluation: failed to produce a rule action"); + System.exit(1); + } + } catch (ApiException e) { + System.err.println("Exception when trying to evaluate ruleset:" + e.getMessage()); + System.exit(1); + } } + + System.out.println("Checks Passed"); + System.exit(0); + } } diff --git a/examples/src/main/java/com/fingerprint/example/SealedResults.java b/examples/src/main/java/com/fingerprint/example/SealedResults.java index 8ffb02bb..8e4f0d37 100644 --- a/examples/src/main/java/com/fingerprint/example/SealedResults.java +++ b/examples/src/main/java/com/fingerprint/example/SealedResults.java @@ -1,26 +1,23 @@ package com.fingerprint.example; -import com.fingerprint.v4.model.Event; import com.fingerprint.v4.Sealed; - +import com.fingerprint.v4.model.Event; import java.util.Base64; public class SealedResults { - public static void main(String... args) throws Exception { - String SEALED_RESULT = System.getenv("BASE64_SEALED_RESULT"); - String SEALED_KEY = System.getenv("BASE64_KEY"); + public static void main(String... args) throws Exception { + String SEALED_RESULT = System.getenv("BASE64_SEALED_RESULT"); + String SEALED_KEY = System.getenv("BASE64_KEY"); - final Event event = Sealed.unsealEventResponse( - Base64.getDecoder().decode(SEALED_RESULT), - new Sealed.DecryptionKey[]{ - new Sealed.DecryptionKey( - Base64.getDecoder().decode(SEALED_KEY), - Sealed.DecryptionAlgorithm.AES_256_GCM - ) - } - ); + final Event event = + Sealed.unsealEventResponse( + Base64.getDecoder().decode(SEALED_RESULT), + new Sealed.DecryptionKey[] { + new Sealed.DecryptionKey( + Base64.getDecoder().decode(SEALED_KEY), Sealed.DecryptionAlgorithm.AES_256_GCM) + }); - System.out.println(event); - System.exit(0); - } + System.out.println(event); + System.exit(0); + } } diff --git a/examples/src/main/java/com/fingerprint/example/WebhookSignatureSample.java b/examples/src/main/java/com/fingerprint/example/WebhookSignatureSample.java index 62c3c341..dabe855e 100644 --- a/examples/src/main/java/com/fingerprint/example/WebhookSignatureSample.java +++ b/examples/src/main/java/com/fingerprint/example/WebhookSignatureSample.java @@ -1,31 +1,29 @@ package com.fingerprint.example; import com.fingerprint.v4.sdk.WebhookValidation; - import java.nio.charset.StandardCharsets; import java.security.NoSuchAlgorithmException; public class WebhookSignatureSample { - public static void main(String... args) { - final String header = "v1=1b2c16b75bd2a870c114153ccda5bcfca63314bc722fa160d690de133ccbb9db"; - final String secret = "secret"; - final byte[] data = "data".getBytes(StandardCharsets.UTF_8); + public static void main(String... args) { + final String header = "v1=1b2c16b75bd2a870c114153ccda5bcfca63314bc722fa160d690de133ccbb9db"; + final String secret = "secret"; + final byte[] data = "data".getBytes(StandardCharsets.UTF_8); - try { - boolean isSignatureValid = WebhookValidation.isSignatureValid(header, data, secret); - if (isSignatureValid) { - System.out.println("Webhook signature is valid"); - System.exit(0); - } else { - System.out.println("Webhook signature is not valid"); - System.exit(1); - } - } catch (NoSuchAlgorithmException e) { - System.err.println("Failed to validate webhook signature"); - e.printStackTrace(System.err); - System.exit(1); - } + try { + boolean isSignatureValid = WebhookValidation.isSignatureValid(header, data, secret); + if (isSignatureValid) { + System.out.println("Webhook signature is valid"); + System.exit(0); + } else { + System.out.println("Webhook signature is not valid"); + System.exit(1); + } + } catch (NoSuchAlgorithmException e) { + System.err.println("Failed to validate webhook signature"); + e.printStackTrace(System.err); + System.exit(1); } - + } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index f21cb15f..56ebe95b 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,4 +1,6 @@ [versions] +google-java-format = "1.34.1" +google-osdetector = "1.7.3" jackson = "2.17.2" jakarta-annotation-api = "2.0.0" jersey = "3.1.7" @@ -27,3 +29,4 @@ swagger-annotations = { module = "io.swagger.core.v3:swagger-annotations", versi [plugins] openapi-generator = { id = "org.openapi.generator", version.ref = "openapi" } +google-osdetector = { id = "com.google.osdetector", version.ref = "google-osdetector" } diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index c92fea00..db15fe10 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -23,7 +23,7 @@ tags: analysis events or event history of individual visitors. externalDocs: description: API documentation - url: https://dev.fingerprint.com/reference/pro-server-api + url: https://docs.fingerprint.com/reference/server-api servers: - url: https://api.fpjs.io/v4 description: Global @@ -55,7 +55,7 @@ paths: type: string description: >- The unique - [identifier](https://dev.fingerprint.com/reference/get-function#requestid) + [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id) of each identification request (`requestId` can be used in its place). - name: ruleset_id @@ -140,7 +140,7 @@ paths: type: string description: >- The unique event - [identifier](https://dev.fingerprint.com/reference/get-function#event_id). + [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). requestBody: required: true content: @@ -268,7 +268,7 @@ paths: type: string description: > Unique [visitor - identifier](https://dev.fingerprint.com/reference/get-function#visitorid) + identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. @@ -282,8 +282,8 @@ paths: `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 `botd.bot` - property set to a valid value are returned. Events without a `botd` + > 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. - name: ip_address in: query @@ -313,8 +313,8 @@ paths: You can use [linked - Ids](https://dev.fingerprint.com/reference/get-function#linkedid) to - associate identification requests with your own identifier, for + 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. @@ -372,7 +372,7 @@ paths: type: boolean description: > Filter events previously tagged as suspicious via the [Update - API](https://dev.fingerprint.com/reference/updateevent). + API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events @@ -688,7 +688,7 @@ paths: - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint - Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). + Workspace](https://docs.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) @@ -696,7 +696,7 @@ paths: - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data - Retention](https://dev.fingerprint.com/docs/regions#data-retention). + Retention](https://docs.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser @@ -711,9 +711,9 @@ paths: a different visitor ID. - If you request [`/v4/events` - API](https://dev.fingerprint.com/reference/getevent) with an `event_id` - that was made outside of the 10 days, you will still receive a valid - response. + API](https://docs.fingerprint.com/reference/server-api-v4-get-event) + with an `event_id` that was made outside of the 10 days, you will still + receive a valid response. ### Interested? @@ -728,7 +728,7 @@ paths: type: string description: >- The [visitor - ID](https://dev.fingerprint.com/reference/get-function#visitorid) + ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. responses: '200': @@ -791,7 +791,7 @@ components: description: >- Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event - endpoint](https://dev.fingerprint.com/reference/updateevent). + endpoint](https://docs.fingerprint.com/reference/server-api-v4-update-event). Integration: type: object properties: @@ -932,6 +932,7 @@ components: description: >- A customer-provided value or an object that was sent with the identification request or updated later. + additionalProperties: true Url: type: string description: > @@ -1112,7 +1113,7 @@ components: 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://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) + Detection](https://docs.fingerprint.com/docs/smart-signals-reference#factory-reset-detection) to learn more about this Smart Signal. Frida: type: boolean @@ -1308,7 +1309,7 @@ components: * `false` - Otherwise or when the request originated from a browser. See [MitM Attack - Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) + Detection](https://docs.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. PrivacySettings: type: boolean @@ -1451,7 +1452,7 @@ components: protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. - See more details here: https://dev.fingerprint.com/docs/suspect-score + See more details here: https://docs.fingerprint.com/docs/suspect-score Tampering: type: boolean description: > @@ -2311,6 +2312,7 @@ components: description: >- A customer-provided value or an object that was sent with the identification request or updated later. + additionalProperties: true suspect: type: boolean description: Suspect flag indicating observed suspicious or fraudulent event @@ -2352,9 +2354,9 @@ components: `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 `botd.bot` - property set to a valid value are returned. Events without a `botd` - Smart Signal result are left out of the response. + > 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. SearchEventsVpnConfidence: type: string enum: diff --git a/scripts/sync.sh b/scripts/sync.sh index 41a00147..23e78fff 100755 --- a/scripts/sync.sh +++ b/scripts/sync.sh @@ -7,6 +7,7 @@ curl -s -o ./res/fingerprint-server-api.yaml https://fingerprintjs.github.io/fin examplesList=( 'webhook/webhook_event.json' 'events/get_event_200.json' + 'events/get_event_ruleset_200.json' 'events/search/get_event_search_200.json' 'events/update_event_multiple_fields_request.json' 'events/update_event_one_field_request.json' @@ -19,6 +20,7 @@ examplesList=( 'errors/400_pagination_key_invalid.json' 'errors/400_request_body_invalid.json' 'errors/400_reverse_invalid.json' + 'errors/400_ruleset_not_found.json' 'errors/400_start_time_invalid.json' 'errors/400_visitor_id_invalid.json' 'errors/400_visitor_id_required.json' diff --git a/sdk/sdk.gradle.kts b/sdk/sdk.gradle.kts index afeea24a..77a58d65 100644 --- a/sdk/sdk.gradle.kts +++ b/sdk/sdk.gradle.kts @@ -1,3 +1,4 @@ + val projectVersion: String by project group = "com.github.fingerprintjs" @@ -9,6 +10,14 @@ plugins { `maven-publish` } +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of( + findProperty("javaVersion")?.toString() ?: "11" + )) + } +} + repositories { mavenLocal() mavenCentral() @@ -71,6 +80,7 @@ openApiGenerate { configOptions.put("openApiNullable", "false") configOptions.put("disallowAdditionalPropertiesIfNotPresent", "false") configOptions.put("useOneOfInterfaces", "true") + configOptions.put("enumUnknownDefaultCase", "true") } tasks.register("removeDocs") { @@ -96,6 +106,7 @@ tasks.register("copyOpenApiGeneratorIgnore") { } tasks.register("copyGeneratedArtifacts") { + finalizedBy("format") doLast { copy { from(layout.buildDirectory.dir("generated/docs")) diff --git a/sdk/src/main/java/com/fingerprint/v4/Sealed.java b/sdk/src/main/java/com/fingerprint/v4/Sealed.java index 435453db..208b151a 100644 --- a/sdk/src/main/java/com/fingerprint/v4/Sealed.java +++ b/sdk/src/main/java/com/fingerprint/v4/Sealed.java @@ -3,10 +3,6 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fingerprint.v4.model.Event; import com.fingerprint.v4.sdk.JSON; - -import javax.crypto.Cipher; -import javax.crypto.spec.GCMParameterSpec; -import javax.crypto.spec.SecretKeySpec; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; @@ -14,156 +10,171 @@ import java.util.Base64; import java.util.zip.Inflater; import java.util.zip.InflaterInputStream; +import javax.crypto.Cipher; +import javax.crypto.spec.GCMParameterSpec; +import javax.crypto.spec.SecretKeySpec; public class Sealed { - public enum DecryptionAlgorithm { - AES_256_GCM + public enum DecryptionAlgorithm { + AES_256_GCM + } + + public static class DecryptionKey { + private final byte[] key; + private final DecryptionAlgorithm algorithm; + + public DecryptionKey(byte[] key, DecryptionAlgorithm algorithm) { + this.key = key; + this.algorithm = algorithm; } - public static class DecryptionKey { - private final byte[] key; - private final DecryptionAlgorithm algorithm; - - public DecryptionKey(byte[] key, DecryptionAlgorithm algorithm) { - this.key = key; - this.algorithm = algorithm; - } - - @Override - public String toString() { - return "DecryptionKey{" + - "key=" + Base64.getEncoder().encodeToString(key) + - ", algorithm=" + algorithm + - '}'; - } + @Override + public String toString() { + return "DecryptionKey{" + + "key=" + + Base64.getEncoder().encodeToString(key) + + ", algorithm=" + + algorithm + + '}'; } + } - public static class UnsealAggregateException extends Exception { - public UnsealAggregateException() { - super("Failed to unseal with all decryption keys"); - } + public static class UnsealAggregateException extends Exception { + private static final long serialVersionUID = 2144464350313234299L; + + public UnsealAggregateException() { + super("Failed to unseal with all decryption keys"); } + } + + public static class InvalidSealedDataException extends IllegalArgumentException { + private static final long serialVersionUID = 7664915119162688449L; - public static class InvalidSealedDataException extends IllegalArgumentException { - public InvalidSealedDataException() { - super("Invalid sealed data"); - } + public InvalidSealedDataException() { + super("Invalid sealed data"); } + } + + public static class InvalidSealedDataHeaderException extends IllegalArgumentException { + private static final long serialVersionUID = 808199780881125013L; - public static class InvalidSealedDataHeaderException extends IllegalArgumentException { - public InvalidSealedDataHeaderException() { - super("Invalid sealed data header"); - } + public InvalidSealedDataHeaderException() { + super("Invalid sealed data header"); } + } - public static class UnsealException extends Exception { - public final String decryptionKeyDescription; - - public UnsealException(String message, Throwable cause, DecryptionKey decryptionKey) { - super(message, cause); - this.decryptionKeyDescription = decryptionKey.toString(); - } - - @Override - public String toString() { - return "UnsealException{" + - "decryptionKey=" + decryptionKeyDescription + - ", message=" + getMessage() + - ", cause=" + getCause() + - '}'; - } + public static class UnsealException extends Exception { + private static final long serialVersionUID = 9223372036854775807L; + + public final String decryptionKeyDescription; + + public UnsealException(String message, Throwable cause, DecryptionKey decryptionKey) { + super(message, cause); + this.decryptionKeyDescription = decryptionKey.toString(); } - private static final byte[] SEAL_HEADER = new byte[]{(byte) 0x9E, (byte) 0x85, (byte) 0xDC, (byte) 0xED}; - private static final int NONCE_LENGTH = 12; - private static final int AUTH_TAG_LENGTH = 16; - - public static byte[] unseal(byte[] sealed, DecryptionKey[] keys) throws IllegalArgumentException, UnsealAggregateException { - if (!Arrays.equals(Arrays.copyOf(sealed, SEAL_HEADER.length), SEAL_HEADER)) { - throw new InvalidSealedDataHeaderException(); - } - - UnsealAggregateException aggregateException = new UnsealAggregateException(); - - for (DecryptionKey key : keys) { - switch (key.algorithm) { - case AES_256_GCM: - try { - return decryptAes256Gcm(Arrays.copyOfRange(sealed, SEAL_HEADER.length, sealed.length), key.key); - } catch (Exception exception) { - aggregateException.addSuppressed( - new UnsealException( - "Failed to decrypt", - exception, - key - ) - ); - } - - break; - - default: - throw new IllegalArgumentException("Invalid decryption algorithm"); - } - } - - throw aggregateException; + @Override + public String toString() { + return "UnsealException{" + + "decryptionKey=" + + decryptionKeyDescription + + ", message=" + + getMessage() + + ", cause=" + + getCause() + + '}'; } + } + + private static final byte[] SEAL_HEADER = + new byte[] {(byte) 0x9E, (byte) 0x85, (byte) 0xDC, (byte) 0xED}; + private static final int NONCE_LENGTH = 12; + private static final int AUTH_TAG_LENGTH = 16; - /** - * decrypts the sealed response with the provided keys. - * - * @param sealed Base64 encoded sealed data - * @param keys Decryption keys. The SDK will try to decrypt the result with each key until it succeeds. - * @return the {@link Event} stored in the sealed data - * - * @throws IllegalArgumentException if invalid decryption algorithm is provided in any of the keys - * @throws UnsealAggregateException if the sealed data cannot be decrypted with any of the keys. The exception contains the list of exceptions thrown by each key. - * @throws IOException if the sealed data un-compression fails - */ - public static Event unsealEventResponse(byte[] sealed, DecryptionKey[] keys) throws IllegalArgumentException, UnsealAggregateException, IOException { - byte[] unsealed = unseal(sealed, keys); - - ObjectMapper mapper = JSON.getDefault().getMapper(); - - Event value = mapper.readValue(unsealed, Event.class); - - if (value.getEventId() == null) { - // The event ID must always be present so its absence indicates the - // sealed data is invalid. - throw new InvalidSealedDataException(); - } - - return value; + public static byte[] unseal(byte[] sealed, DecryptionKey[] keys) + throws IllegalArgumentException, UnsealAggregateException { + if (!Arrays.equals(Arrays.copyOf(sealed, SEAL_HEADER.length), SEAL_HEADER)) { + throw new InvalidSealedDataHeaderException(); } - private static byte[] decryptAes256Gcm(byte[] sealedData, byte[] decryptionKey) throws Exception { - byte[] nonce = Arrays.copyOfRange(sealedData, 0, NONCE_LENGTH); - byte[] ciphertext = Arrays.copyOfRange(sealedData, NONCE_LENGTH, sealedData.length); + UnsealAggregateException aggregateException = new UnsealAggregateException(); - Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); - GCMParameterSpec nonceSpec = new GCMParameterSpec(Byte.SIZE * AUTH_TAG_LENGTH, nonce); - SecretKeySpec keySpec = new SecretKeySpec(decryptionKey, "AES"); + for (DecryptionKey key : keys) { + switch (key.algorithm) { + case AES_256_GCM: + try { + return decryptAes256Gcm( + Arrays.copyOfRange(sealed, SEAL_HEADER.length, sealed.length), key.key); + } catch (Exception exception) { + aggregateException.addSuppressed( + new UnsealException("Failed to decrypt", exception, key)); + } - cipher.init(Cipher.DECRYPT_MODE, keySpec, nonceSpec); - byte[] decryptedData = cipher.doFinal(ciphertext); + break; - // Decompressing the decrypted data - return decompress(decryptedData); + default: + throw new IllegalArgumentException("Invalid decryption algorithm"); + } } - private static byte[] decompress(byte[] data) throws IOException { - Inflater inflater = new Inflater(true); // true for raw deflate data - InflaterInputStream inflaterInputStream = new InflaterInputStream(new ByteArrayInputStream(data), inflater); - ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + throw aggregateException; + } + + /** + * decrypts the sealed response with the provided keys. + * + * @param sealed Base64 encoded sealed data + * @param keys Decryption keys. The SDK will try to decrypt the result with each key until it succeeds. + * @return the {@link Event} stored in the sealed data + * + * @throws IllegalArgumentException if invalid decryption algorithm is provided in any of the keys + * @throws UnsealAggregateException if the sealed data cannot be decrypted with any of the keys. The exception contains the list of exceptions thrown by each key. + * @throws IOException if the sealed data un-compression fails + */ + public static Event unsealEventResponse(byte[] sealed, DecryptionKey[] keys) + throws IllegalArgumentException, UnsealAggregateException, IOException { + byte[] unsealed = unseal(sealed, keys); + + ObjectMapper mapper = JSON.getDefault().getMapper(); + + Event value = mapper.readValue(unsealed, Event.class); + + if (value.getEventId() == null) { + // The event ID must always be present so its absence indicates the + // sealed data is invalid. + throw new InvalidSealedDataException(); + } + + return value; + } + + private static byte[] decryptAes256Gcm(byte[] sealedData, byte[] decryptionKey) throws Exception { + byte[] nonce = Arrays.copyOfRange(sealedData, 0, NONCE_LENGTH); + byte[] ciphertext = Arrays.copyOfRange(sealedData, NONCE_LENGTH, sealedData.length); - int nRead; - byte[] temp = new byte[1024]; - while ((nRead = inflaterInputStream.read(temp, 0, temp.length)) != -1) { - buffer.write(temp, 0, nRead); - } + Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); + GCMParameterSpec nonceSpec = new GCMParameterSpec(Byte.SIZE * AUTH_TAG_LENGTH, nonce); + SecretKeySpec keySpec = new SecretKeySpec(decryptionKey, "AES"); - return buffer.toByteArray(); + cipher.init(Cipher.DECRYPT_MODE, keySpec, nonceSpec); + byte[] decryptedData = cipher.doFinal(ciphertext); + + // Decompressing the decrypted data + return decompress(decryptedData); + } + + private static byte[] decompress(byte[] data) throws IOException { + Inflater inflater = new Inflater(true); // true for raw deflate data + InflaterInputStream inflaterInputStream = + new InflaterInputStream(new ByteArrayInputStream(data), inflater); + ByteArrayOutputStream buffer = new ByteArrayOutputStream(); + + int nRead; + byte[] temp = new byte[1024]; + while ((nRead = inflaterInputStream.read(temp, 0, temp.length)) != -1) { + buffer.write(temp, 0, nRead); } -} + return buffer.toByteArray(); + } +} diff --git a/sdk/src/main/java/com/fingerprint/v4/api/FingerprintApi.java b/sdk/src/main/java/com/fingerprint/v4/api/FingerprintApi.java index d850428c..2cb7cca8 100644 --- a/sdk/src/main/java/com/fingerprint/v4/api/FingerprintApi.java +++ b/sdk/src/main/java/com/fingerprint/v4/api/FingerprintApi.java @@ -1,28 +1,27 @@ package com.fingerprint.v4.api; -import com.fingerprint.v4.sdk.ApiException; -import com.fingerprint.v4.sdk.ApiClient; -import com.fingerprint.v4.sdk.ApiResponse; -import com.fingerprint.v4.sdk.Configuration; -import com.fingerprint.v4.sdk.Pair; -import com.fingerprint.v4.sdk.Region; - -import jakarta.ws.rs.core.GenericType; - -import com.fingerprint.v4.model.ErrorResponse; import com.fingerprint.v4.model.Event; import com.fingerprint.v4.model.EventSearch; import com.fingerprint.v4.model.EventUpdate; import com.fingerprint.v4.model.SearchEventsBot; import com.fingerprint.v4.model.SearchEventsSdkPlatform; import com.fingerprint.v4.model.SearchEventsVpnConfidence; - +import com.fingerprint.v4.sdk.ApiClient; +import com.fingerprint.v4.sdk.ApiException; +import com.fingerprint.v4.sdk.ApiResponse; +import com.fingerprint.v4.sdk.Configuration; +import com.fingerprint.v4.sdk.Pair; +import com.fingerprint.v4.sdk.Region; +import jakarta.ws.rs.core.GenericType; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0")public class FingerprintApi { +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") +public class FingerprintApi { public static final String INTEGRATION_INFO = "fingerprint-pro-server-java-sdk/8.0.0-rc.0"; private ApiClient apiClient; @@ -62,18 +61,18 @@ public void setApiClient(ApiClient apiClient) { /** * Delete data by visitor ID - * Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/v4/events` API](https://dev.fingerprint.com/reference/getevent) with an `event_id` that was made outside of the 10 days, you will still receive a valid response. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. - * @param visitorId The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. (required) + * Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://docs.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://docs.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/v4/events` API](https://docs.fingerprint.com/reference/server-api-v4-get-event) with an `event_id` that was made outside of the 10 days, you will still receive a valid response. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + * @param visitorId The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. (required) * @throws ApiException if fails to make API call * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 OK. The visitor ID is scheduled for deletion. -
400 Bad request. The visitor ID parameter is missing or in the wrong format. -
403 Forbidden. Access to this API is denied. -
404 Not found. The visitor ID cannot be found in this workspace's data. -
429 Too Many Requests. The request is throttled. -
+ * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK. The visitor ID is scheduled for deletion. -
400 Bad request. The visitor ID parameter is missing or in the wrong format. -
403 Forbidden. Access to this API is denied. -
404 Not found. The visitor ID cannot be found in this workspace's data. -
429 Too Many Requests. The request is throttled. -
*/ public void deleteVisitorData(String visitorId) throws ApiException { deleteVisitorDataWithHttpInfo(visitorId); @@ -81,31 +80,33 @@ public void deleteVisitorData(String visitorId) throws ApiException { /** * Delete data by visitor ID - * Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://dev.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://dev.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/v4/events` API](https://dev.fingerprint.com/reference/getevent) with an `event_id` that was made outside of the 10 days, you will still receive a valid response. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. - * @param visitorId The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. (required) + * Request deleting all data associated with the specified visitor ID. This API is useful for compliance with privacy regulations. ### Which data is deleted? - Browser (or device) properties - Identification requests made from this browser (or device) #### Browser (or device) properties - Represents the data that Fingerprint collected from this specific browser (or device) and everything inferred and derived from it. - Upon request to delete, this data is deleted asynchronously (typically within a few minutes) and it will no longer be used to identify this browser (or device) for your [Fingerprint Workspace](https://docs.fingerprint.com/docs/glossary#fingerprint-workspace). #### Identification requests made from this browser (or device) - Fingerprint stores the identification requests made from a browser (or device) for up to 30 (or 90) days depending on your plan. To learn more, see [Data Retention](https://docs.fingerprint.com/docs/regions#data-retention). - Upon request to delete, the identification requests that were made by this browser - Within the past 10 days are deleted within 24 hrs. - Outside of 10 days are allowed to purge as per your data retention period. ### Corollary After requesting to delete a visitor ID, - If the same browser (or device) requests to identify, it will receive a different visitor ID. - If you request [`/v4/events` API](https://docs.fingerprint.com/reference/server-api-v4-get-event) with an `event_id` that was made outside of the 10 days, you will still receive a valid response. ### Interested? Please [contact our support team](https://fingerprint.com/support/) to enable it for you. Otherwise, you will receive a 403. + * @param visitorId The [visitor ID](https://docs.fingerprint.com/reference/js-agent-v4-get-function#visitor_id) you want to delete. (required) * @return ApiResponse * @throws ApiException if fails to make API call * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 OK. The visitor ID is scheduled for deletion. -
400 Bad request. The visitor ID parameter is missing or in the wrong format. -
403 Forbidden. Access to this API is denied. -
404 Not found. The visitor ID cannot be found in this workspace's data. -
429 Too Many Requests. The request is throttled. -
+ * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK. The visitor ID is scheduled for deletion. -
400 Bad request. The visitor ID parameter is missing or in the wrong format. -
403 Forbidden. Access to this API is denied. -
404 Not found. The visitor ID cannot be found in this workspace's data. -
429 Too Many Requests. The request is throttled. -
*/ public ApiResponse deleteVisitorDataWithHttpInfo(String visitorId) throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'visitorId' is set if (visitorId == null) { - throw new ApiException(400, "Missing the required parameter 'visitorId' when calling deleteVisitorData"); + throw new ApiException( + 400, "Missing the required parameter 'visitorId' when calling deleteVisitorData"); } - + // create path and map variables - String localVarPath = "/visitors/{visitor_id}" - .replaceAll("\\{" + "visitor_id" + "\\}", apiClient.escapeString(visitorId.toString())); + String localVarPath = + "/visitors/{visitor_id}" + .replaceAll("\\{" + "visitor_id" + "\\}", apiClient.escapeString(visitorId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -117,49 +118,60 @@ public ApiResponse deleteVisitorDataWithHttpInfo(String visitorId) throws final String localVarAccept = apiClient.selectHeaderAccept("application/json"); final String localVarContentType = apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] { "bearerAuth" }; - - return apiClient.invokeAPI("FingerprintApi.deleteVisitorData", localVarPath, "DELETE", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String[] localVarAuthNames = new String[] {"bearerAuth"}; + + return apiClient.invokeAPI( + "FingerprintApi.deleteVisitorData", + localVarPath, + "DELETE", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false); } + public static class GetEventOptionalParams { - + private String rulesetId; /** - * getter for rulesetId - 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. + * getter for rulesetId - 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. */ public String getRulesetId() { return rulesetId; } /** - * setter for rulesetId - 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. + * setter for rulesetId - 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. */ public GetEventOptionalParams setRulesetId(String rulesetId) { this.rulesetId = rulesetId; return this; } - } /** * Get an event by event ID - * Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. - * @param eventId The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request (`requestId` can be used in its place). (required) + * Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. + * @param eventId 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) * @return Event * @throws ApiException if fails to make API call * @http.response.details - - - - - - - - -
Status Code Description Response Headers
200 OK. -
400 Bad request. The event Id provided is not valid. -
403 Forbidden. Access to this API is denied. -
404 Not found. The event Id cannot be found in this workspace's data. -
429 Too Many Requests. The request is throttled. -
500 Workspace error. -
+ * + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK. -
400 Bad request. The event Id provided is not valid. -
403 Forbidden. Access to this API is denied. -
404 Not found. The event Id cannot be found in this workspace's data. -
429 Too Many Requests. The request is throttled. -
500 Workspace error. -
*/ public Event getEvent(String eventId) throws ApiException { return getEventWithHttpInfo(eventId, null).getData(); @@ -167,55 +179,58 @@ public Event getEvent(String eventId) throws ApiException { /** * Get an event by event ID - * Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. - * @param eventId The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request (`requestId` can be used in its place). (required) + * Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. + * @param eventId 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 getEventOptionalParams Object containing optional parameters for API method. (optional) * @return Event * @throws ApiException if fails to make API call * @http.response.details - - - - - - - - -
Status Code Description Response Headers
200 OK. -
400 Bad request. The event Id provided is not valid. -
403 Forbidden. Access to this API is denied. -
404 Not found. The event Id cannot be found in this workspace's data. -
429 Too Many Requests. The request is throttled. -
500 Workspace error. -
+ * + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK. -
400 Bad request. The event Id provided is not valid. -
403 Forbidden. Access to this API is denied. -
404 Not found. The event Id cannot be found in this workspace's data. -
429 Too Many Requests. The request is throttled. -
500 Workspace error. -
*/ - public Event getEvent(String eventId, GetEventOptionalParams getEventOptionalParams) throws ApiException { + public Event getEvent(String eventId, GetEventOptionalParams getEventOptionalParams) + throws ApiException { return getEventWithHttpInfo(eventId, getEventOptionalParams).getData(); } /** * Get an event by event ID - * Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. - * @param eventId The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request (`requestId` can be used in its place). (required) + * Get a detailed analysis of an individual identification event, including Smart Signals. Use `event_id` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `event_id`. + * @param eventId 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 getEventOptionalParams Object containing optional parameters for API method. (optional) * @return ApiResponse * @throws ApiException if fails to make API call * @http.response.details - - - - - - - - -
Status Code Description Response Headers
200 OK. -
400 Bad request. The event Id provided is not valid. -
403 Forbidden. Access to this API is denied. -
404 Not found. The event Id cannot be found in this workspace's data. -
429 Too Many Requests. The request is throttled. -
500 Workspace error. -
+ * + * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK. -
400 Bad request. The event Id provided is not valid. -
403 Forbidden. Access to this API is denied. -
404 Not found. The event Id cannot be found in this workspace's data. -
429 Too Many Requests. The request is throttled. -
500 Workspace error. -
*/ - public ApiResponse getEventWithHttpInfo(String eventId, GetEventOptionalParams getEventOptionalParams) throws ApiException { + public ApiResponse getEventWithHttpInfo( + String eventId, GetEventOptionalParams getEventOptionalParams) throws ApiException { Object localVarPostBody = null; - + // verify the required parameter 'eventId' is set if (eventId == null) { throw new ApiException(400, "Missing the required parameter 'eventId' when calling getEvent"); } - + // create path and map variables - String localVarPath = "/events/{event_id}" - .replaceAll("\\{" + "event_id" + "\\}", apiClient.escapeString(eventId.toString())); + String localVarPath = + "/events/{event_id}" + .replaceAll("\\{" + "event_id" + "\\}", apiClient.escapeString(eventId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -225,19 +240,32 @@ public ApiResponse getEventWithHttpInfo(String eventId, GetEventOptionalP localVarQueryParams.add(new Pair("ii", INTEGRATION_INFO)); if (getEventOptionalParams != null) { - localVarQueryParams.addAll(apiClient.parameterToPairs("", "ruleset_id", getEventOptionalParams.getRulesetId())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "ruleset_id", getEventOptionalParams.getRulesetId())); } final String localVarAccept = apiClient.selectHeaderAccept("application/json"); final String localVarContentType = apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] { "bearerAuth" }; + String[] localVarAuthNames = new String[] {"bearerAuth"}; GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("FingerprintApi.getEvent", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "FingerprintApi.getEvent", + localVarPath, + "GET", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); } + public static class SearchEventsOptionalParams { private Integer limit; private String paginationKey; @@ -280,14 +308,14 @@ public static class SearchEventsOptionalParams { private Boolean torNode; /** - * getter for limit - Limit the number of events returned. + * getter for limit - Limit the number of events returned. */ public Integer getLimit() { return limit; } /** - * setter for limit - Limit the number of events returned. + * setter for limit - Limit the number of events returned. */ public SearchEventsOptionalParams setLimit(Integer limit) { this.limit = limit; @@ -295,14 +323,14 @@ public SearchEventsOptionalParams setLimit(Integer limit) { } /** - * getter for paginationKey - 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 200 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=1740815825085` + * getter for paginationKey - 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 200 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=1740815825085` */ public String getPaginationKey() { return paginationKey; } /** - * setter for paginationKey - 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 200 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=1740815825085` + * setter for paginationKey - 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 200 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=1740815825085` */ public SearchEventsOptionalParams setPaginationKey(String paginationKey) { this.paginationKey = paginationKey; @@ -310,14 +338,14 @@ public SearchEventsOptionalParams setPaginationKey(String paginationKey) { } /** - * getter for visitorId - Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. + * getter for visitorId - 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 for events matching this `visitor_id`. */ public String getVisitorId() { return visitorId; } /** - * setter for visitorId - Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Identification and all active Smart Signals. Filter for events matching this `visitor_id`. + * setter for visitorId - 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 for events matching this `visitor_id`. */ public SearchEventsOptionalParams setVisitorId(String visitorId) { this.visitorId = visitorId; @@ -325,14 +353,14 @@ public SearchEventsOptionalParams setVisitorId(String visitorId) { } /** - * getter for 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 `botd.bot` property set to a valid value are returned. Events without a `botd` Smart Signal result are left out of the response. + * getter for 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. */ public SearchEventsBot getBot() { return bot; } /** - * setter for 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 `botd.bot` property set to a valid value are returned. Events without a `botd` Smart Signal result are left out of the response. + * setter for 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. */ public SearchEventsOptionalParams setBot(SearchEventsBot bot) { this.bot = bot; @@ -340,14 +368,14 @@ public SearchEventsOptionalParams setBot(SearchEventsBot bot) { } /** - * getter for ipAddress - 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 + * getter for ipAddress - 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 */ public String getIpAddress() { return ipAddress; } /** - * setter for ipAddress - 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 + * setter for ipAddress - 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 */ public SearchEventsOptionalParams setIpAddress(String ipAddress) { this.ipAddress = ipAddress; @@ -355,14 +383,14 @@ public SearchEventsOptionalParams setIpAddress(String ipAddress) { } /** - * getter for 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. + * getter for 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. */ public String getAsn() { return asn; } /** - * setter for 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. + * setter for 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. */ public SearchEventsOptionalParams setAsn(String asn) { this.asn = asn; @@ -370,14 +398,14 @@ public SearchEventsOptionalParams setAsn(String asn) { } /** - * getter for linkedId - Filter events by your custom identifier. You can use [linked Ids](https://dev.fingerprint.com/reference/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. + * getter for linkedId - 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. */ public String getLinkedId() { return linkedId; } /** - * setter for linkedId - Filter events by your custom identifier. You can use [linked Ids](https://dev.fingerprint.com/reference/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. + * setter for linkedId - 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. */ public SearchEventsOptionalParams setLinkedId(String linkedId) { this.linkedId = linkedId; @@ -385,14 +413,14 @@ public SearchEventsOptionalParams setLinkedId(String linkedId) { } /** - * getter for url - Filter events by the URL (`url` property) associated with the event. + * getter for url - Filter events by the URL (`url` property) associated with the event. */ public String getUrl() { return url; } /** - * setter for url - Filter events by the URL (`url` property) associated with the event. + * setter for url - Filter events by the URL (`url` property) associated with the event. */ public SearchEventsOptionalParams setUrl(String url) { this.url = url; @@ -400,14 +428,14 @@ public SearchEventsOptionalParams setUrl(String url) { } /** - * getter for bundleId - Filter events by the Bundle ID (iOS) associated with the event. + * getter for bundleId - Filter events by the Bundle ID (iOS) associated with the event. */ public String getBundleId() { return bundleId; } /** - * setter for bundleId - Filter events by the Bundle ID (iOS) associated with the event. + * setter for bundleId - Filter events by the Bundle ID (iOS) associated with the event. */ public SearchEventsOptionalParams setBundleId(String bundleId) { this.bundleId = bundleId; @@ -415,14 +443,14 @@ public SearchEventsOptionalParams setBundleId(String bundleId) { } /** - * getter for packageName - Filter events by the Package Name (Android) associated with the event. + * getter for packageName - Filter events by the Package Name (Android) associated with the event. */ public String getPackageName() { return packageName; } /** - * setter for packageName - Filter events by the Package Name (Android) associated with the event. + * setter for packageName - Filter events by the Package Name (Android) associated with the event. */ public SearchEventsOptionalParams setPackageName(String packageName) { this.packageName = packageName; @@ -430,14 +458,14 @@ public SearchEventsOptionalParams setPackageName(String packageName) { } /** - * getter for origin - Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) + * getter for origin - Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) */ public String getOrigin() { return origin; } /** - * setter for origin - Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) + * setter for origin - Filter events by the origin field of the event. This is applicable to web events only (e.g., https://example.com) */ public SearchEventsOptionalParams setOrigin(String origin) { this.origin = origin; @@ -445,14 +473,14 @@ public SearchEventsOptionalParams setOrigin(String origin) { } /** - * getter for start - Filter events with a timestamp greater than the start time, in Unix time (milliseconds). + * getter for start - Filter events with a timestamp greater than the start time, in Unix time (milliseconds). */ public Long getStart() { return start; } /** - * setter for start - Filter events with a timestamp greater than the start time, in Unix time (milliseconds). + * setter for start - Filter events with a timestamp greater than the start time, in Unix time (milliseconds). */ public SearchEventsOptionalParams setStart(Long start) { this.start = start; @@ -460,14 +488,14 @@ public SearchEventsOptionalParams setStart(Long start) { } /** - * getter for end - Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). + * getter for end - Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). */ public Long getEnd() { return end; } /** - * setter for end - Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). + * setter for end - Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). */ public SearchEventsOptionalParams setEnd(Long end) { this.end = end; @@ -475,14 +503,14 @@ public SearchEventsOptionalParams setEnd(Long end) { } /** - * getter for reverse - Sort events in reverse timestamp order. + * getter for reverse - Sort events in reverse timestamp order. */ public Boolean getReverse() { return reverse; } /** - * setter for reverse - Sort events in reverse timestamp order. + * setter for reverse - Sort events in reverse timestamp order. */ public SearchEventsOptionalParams setReverse(Boolean reverse) { this.reverse = reverse; @@ -490,14 +518,14 @@ public SearchEventsOptionalParams setReverse(Boolean reverse) { } /** - * getter for suspect - Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. + * getter for suspect - Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. */ public Boolean getSuspect() { return suspect; } /** - * setter for suspect - Filter events previously tagged as suspicious via the [Update API](https://dev.fingerprint.com/reference/updateevent). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. + * setter for suspect - Filter events previously tagged as suspicious via the [Update API](https://docs.fingerprint.com/reference/server-api-v4-update-event). > Note: When using this parameter, only events with the `suspect` property explicitly set to `true` or `false` are returned. Events with undefined `suspect` property are left out of the response. */ public SearchEventsOptionalParams setSuspect(Boolean suspect) { this.suspect = suspect; @@ -505,14 +533,14 @@ public SearchEventsOptionalParams setSuspect(Boolean suspect) { } /** - * getter for vpn - Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. + * getter for vpn - Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. */ public Boolean getVpn() { return vpn; } /** - * setter for vpn - Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. + * setter for vpn - Filter events by VPN Detection result. > Note: When using this parameter, only events with the `vpn` property set to `true` or `false` are returned. Events without a `vpn` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setVpn(Boolean vpn) { this.vpn = vpn; @@ -520,14 +548,14 @@ public SearchEventsOptionalParams setVpn(Boolean vpn) { } /** - * getter for virtualMachine - Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. + * getter for virtualMachine - Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. */ public Boolean getVirtualMachine() { return virtualMachine; } /** - * setter for virtualMachine - Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. + * setter for virtualMachine - Filter events by Virtual Machine Detection result. > Note: When using this parameter, only events with the `virtual_machine` property set to `true` or `false` are returned. Events without a `virtual_machine` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setVirtualMachine(Boolean virtualMachine) { this.virtualMachine = virtualMachine; @@ -535,14 +563,14 @@ public SearchEventsOptionalParams setVirtualMachine(Boolean virtualMachine) { } /** - * getter for tampering - Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. + * getter for tampering - Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. */ public Boolean getTampering() { return tampering; } /** - * setter for tampering - Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. + * setter for tampering - Filter events by Browser Tampering Detection result. > Note: When using this parameter, only events with the `tampering.result` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setTampering(Boolean tampering) { this.tampering = tampering; @@ -550,14 +578,14 @@ public SearchEventsOptionalParams setTampering(Boolean tampering) { } /** - * getter for antiDetectBrowser - Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. + * getter for antiDetectBrowser - Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. */ public Boolean getAntiDetectBrowser() { return antiDetectBrowser; } /** - * setter for antiDetectBrowser - Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. + * setter for antiDetectBrowser - Filter events by Anti-detect Browser Detection result. > Note: When using this parameter, only events with the `tampering.anti_detect_browser` property set to `true` or `false` are returned. Events without a `tampering` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setAntiDetectBrowser(Boolean antiDetectBrowser) { this.antiDetectBrowser = antiDetectBrowser; @@ -565,14 +593,14 @@ public SearchEventsOptionalParams setAntiDetectBrowser(Boolean antiDetectBrowser } /** - * getter for incognito - Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. + * getter for incognito - Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. */ public Boolean getIncognito() { return incognito; } /** - * setter for incognito - Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. + * setter for incognito - Filter events by Browser Incognito Detection result. > Note: When using this parameter, only events with the `incognito` property set to `true` or `false` are returned. Events without an `incognito` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setIncognito(Boolean incognito) { this.incognito = incognito; @@ -580,14 +608,14 @@ public SearchEventsOptionalParams setIncognito(Boolean incognito) { } /** - * getter for privacySettings - Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. + * getter for privacySettings - Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. */ public Boolean getPrivacySettings() { return privacySettings; } /** - * setter for privacySettings - Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. + * setter for privacySettings - Filter events by Privacy Settings Detection result. > Note: When using this parameter, only events with the `privacy_settings` property set to `true` or `false` are returned. Events without a `privacy_settings` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setPrivacySettings(Boolean privacySettings) { this.privacySettings = privacySettings; @@ -595,14 +623,14 @@ public SearchEventsOptionalParams setPrivacySettings(Boolean privacySettings) { } /** - * getter for jailbroken - Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. + * getter for jailbroken - Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. */ public Boolean getJailbroken() { return jailbroken; } /** - * setter for jailbroken - Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. + * setter for jailbroken - Filter events by Jailbroken Device Detection result. > Note: When using this parameter, only events with the `jailbroken` property set to `true` or `false` are returned. Events without a `jailbroken` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setJailbroken(Boolean jailbroken) { this.jailbroken = jailbroken; @@ -610,14 +638,14 @@ public SearchEventsOptionalParams setJailbroken(Boolean jailbroken) { } /** - * getter for frida - Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. + * getter for frida - Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. */ public Boolean getFrida() { return frida; } /** - * setter for frida - Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. + * setter for frida - Filter events by Frida Detection result. > Note: When using this parameter, only events with the `frida` property set to `true` or `false` are returned. Events without a `frida` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setFrida(Boolean frida) { this.frida = frida; @@ -625,14 +653,14 @@ public SearchEventsOptionalParams setFrida(Boolean frida) { } /** - * getter for factoryReset - Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. + * getter for factoryReset - Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. */ public Boolean getFactoryReset() { return factoryReset; } /** - * setter for factoryReset - Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. + * setter for factoryReset - Filter events by Factory Reset Detection result. > Note: When using this parameter, only events with a `factory_reset` time. Events without a `factory_reset` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setFactoryReset(Boolean factoryReset) { this.factoryReset = factoryReset; @@ -640,14 +668,14 @@ public SearchEventsOptionalParams setFactoryReset(Boolean factoryReset) { } /** - * getter for clonedApp - Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. + * getter for clonedApp - Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. */ public Boolean getClonedApp() { return clonedApp; } /** - * setter for clonedApp - Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. + * setter for clonedApp - Filter events by Cloned App Detection result. > Note: When using this parameter, only events with the `cloned_app` property set to `true` or `false` are returned. Events without a `cloned_app` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setClonedApp(Boolean clonedApp) { this.clonedApp = clonedApp; @@ -655,14 +683,14 @@ public SearchEventsOptionalParams setClonedApp(Boolean clonedApp) { } /** - * getter for emulator - Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. + * getter for emulator - Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. */ public Boolean getEmulator() { return emulator; } /** - * setter for emulator - Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. + * setter for emulator - Filter events by Android Emulator Detection result. > Note: When using this parameter, only events with the `emulator` property set to `true` or `false` are returned. Events without an `emulator` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setEmulator(Boolean emulator) { this.emulator = emulator; @@ -670,14 +698,14 @@ public SearchEventsOptionalParams setEmulator(Boolean emulator) { } /** - * getter for rootApps - Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. + * getter for rootApps - Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. */ public Boolean getRootApps() { return rootApps; } /** - * setter for rootApps - Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. + * setter for rootApps - Filter events by Rooted Device Detection result. > Note: When using this parameter, only events with the `root_apps` property set to `true` or `false` are returned. Events without a `root_apps` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setRootApps(Boolean rootApps) { this.rootApps = rootApps; @@ -685,14 +713,14 @@ public SearchEventsOptionalParams setRootApps(Boolean rootApps) { } /** - * getter for vpnConfidence - Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. + * getter for vpnConfidence - Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. */ public SearchEventsVpnConfidence getVpnConfidence() { return vpnConfidence; } /** - * setter for vpnConfidence - Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. + * setter for vpnConfidence - Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setVpnConfidence(SearchEventsVpnConfidence vpnConfidence) { this.vpnConfidence = vpnConfidence; @@ -700,14 +728,14 @@ public SearchEventsOptionalParams setVpnConfidence(SearchEventsVpnConfidence vpn } /** - * getter for minSuspectScore - Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. + * getter for minSuspectScore - Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. */ public Float getMinSuspectScore() { return minSuspectScore; } /** - * setter for minSuspectScore - Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. + * setter for minSuspectScore - Filter events with Suspect Score result above a provided minimum threshold. > Note: When using this parameter, only events where the `suspect_score` property set to a value exceeding your threshold are returned. Events without a `suspect_score` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setMinSuspectScore(Float minSuspectScore) { this.minSuspectScore = minSuspectScore; @@ -715,14 +743,14 @@ public SearchEventsOptionalParams setMinSuspectScore(Float minSuspectScore) { } /** - * getter for developerTools - Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. + * getter for developerTools - Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. */ public Boolean getDeveloperTools() { return developerTools; } /** - * setter for developerTools - Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. + * setter for developerTools - Filter events by Developer Tools detection result. > Note: When using this parameter, only events with the `developer_tools` property set to `true` or `false` are returned. Events without a `developer_tools` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setDeveloperTools(Boolean developerTools) { this.developerTools = developerTools; @@ -730,14 +758,14 @@ public SearchEventsOptionalParams setDeveloperTools(Boolean developerTools) { } /** - * getter for locationSpoofing - Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. + * getter for locationSpoofing - Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. */ public Boolean getLocationSpoofing() { return locationSpoofing; } /** - * setter for locationSpoofing - Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. + * setter for locationSpoofing - Filter events by Location Spoofing detection result. > Note: When using this parameter, only events with the `location_spoofing` property set to `true` or `false` are returned. Events without a `location_spoofing` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setLocationSpoofing(Boolean locationSpoofing) { this.locationSpoofing = locationSpoofing; @@ -745,14 +773,14 @@ public SearchEventsOptionalParams setLocationSpoofing(Boolean locationSpoofing) } /** - * getter for mitmAttack - Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. + * getter for mitmAttack - Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. */ public Boolean getMitmAttack() { return mitmAttack; } /** - * setter for mitmAttack - Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. + * setter for mitmAttack - Filter events by MITM (Man-in-the-Middle) Attack detection result. > Note: When using this parameter, only events with the `mitm_attack` property set to `true` or `false` are returned. Events without a `mitm_attack` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setMitmAttack(Boolean mitmAttack) { this.mitmAttack = mitmAttack; @@ -760,14 +788,14 @@ public SearchEventsOptionalParams setMitmAttack(Boolean mitmAttack) { } /** - * getter for proxy - Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. + * getter for proxy - Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. */ public Boolean getProxy() { return proxy; } /** - * setter for proxy - Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. + * setter for proxy - Filter events by Proxy detection result. > Note: When using this parameter, only events with the `proxy` property set to `true` or `false` are returned. Events without a `proxy` Smart Signal result are left out of the response. */ public SearchEventsOptionalParams setProxy(Boolean proxy) { this.proxy = proxy; @@ -775,14 +803,14 @@ public SearchEventsOptionalParams setProxy(Boolean proxy) { } /** - * getter for sdkVersion - Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` + * getter for sdkVersion - Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` */ public String getSdkVersion() { return sdkVersion; } /** - * setter for sdkVersion - Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` + * setter for sdkVersion - Filter events by a specific SDK version associated with the identification event (`sdk.version` property). Example: `3.11.14` */ public SearchEventsOptionalParams setSdkVersion(String sdkVersion) { this.sdkVersion = sdkVersion; @@ -790,14 +818,14 @@ public SearchEventsOptionalParams setSdkVersion(String sdkVersion) { } /** - * getter for sdkPlatform - Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. + * getter for sdkPlatform - Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. */ public SearchEventsSdkPlatform getSdkPlatform() { return sdkPlatform; } /** - * setter for sdkPlatform - Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. + * setter for sdkPlatform - Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. */ public SearchEventsOptionalParams setSdkPlatform(SearchEventsSdkPlatform sdkPlatform) { this.sdkPlatform = sdkPlatform; @@ -805,14 +833,14 @@ public SearchEventsOptionalParams setSdkPlatform(SearchEventsSdkPlatform sdkPlat } /** - * getter for environment - Filter for events by providing one or more environment IDs (`environment_id` property). + * getter for environment - Filter for events by providing one or more environment IDs (`environment_id` property). */ public List getEnvironment() { return environment; } /** - * setter for environment - Filter for events by providing one or more environment IDs (`environment_id` property). + * setter for environment - Filter for events by providing one or more environment IDs (`environment_id` property). */ public SearchEventsOptionalParams setEnvironment(List environment) { this.environment = environment; @@ -820,14 +848,14 @@ public SearchEventsOptionalParams setEnvironment(List environment) { } /** - * getter for proximityId - Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `proximity.id` property matching the provided ID are returned. Events without a `proximity` result are left out of the response. + * getter for proximityId - Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `proximity.id` property matching the provided ID are returned. Events without a `proximity` result are left out of the response. */ public String getProximityId() { return proximityId; } /** - * setter for proximityId - Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `proximity.id` property matching the provided ID are returned. Events without a `proximity` result are left out of the response. + * setter for proximityId - Filter events by the most precise Proximity ID provided by default. > Note: When using this parameter, only events with the `proximity.id` property matching the provided ID are returned. Events without a `proximity` result are left out of the response. */ public SearchEventsOptionalParams setProximityId(String proximityId) { this.proximityId = proximityId; @@ -835,14 +863,14 @@ public SearchEventsOptionalParams setProximityId(String proximityId) { } /** - * getter for totalHits - When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. + * getter for totalHits - When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. */ public Long getTotalHits() { return totalHits; } /** - * setter for totalHits - When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. + * setter for totalHits - When set, the response will include a `total_hits` property with a count of total query matches across all pages, up to the specified limit. */ public SearchEventsOptionalParams setTotalHits(Long totalHits) { this.totalHits = totalHits; @@ -850,58 +878,60 @@ public SearchEventsOptionalParams setTotalHits(Long totalHits) { } /** - * getter for torNode - Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. + * getter for torNode - Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. */ public Boolean getTorNode() { return torNode; } /** - * setter for torNode - Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. + * setter for torNode - Filter events by Tor Node detection result. > Note: When using this parameter, only events with the `tor_node` property set to `true` or `false` are returned. Events without a `tor_node` detection result are left out of the response. */ public SearchEventsOptionalParams setTorNode(Boolean torNode) { this.torNode = torNode; return this; } - } + /** * Search events - * ## Search The `/v4/events` endpoint provides a convenient way to search for past events based on specific parameters. Typical use cases and queries include: - Searching for events associated with a single `visitor_id` within a time range to get historical behavior of a visitor. - Searching for events associated with a single `linked_id` within a time range to get all events associated with your internal account identifier. - Excluding all bot traffic from the query (`good` and `bad` bots) If you don't provide `start` or `end` parameters, the default search range is the **last 7 days**. ### Filtering events with the `suspect` flag The `/v4/events` endpoint unlocks a powerful method for fraud protection analytics. The `suspect` flag is exposed in all events where it was previously set by the update API. You can also apply the `suspect` query parameter as a filter to find all potentially fraudulent activity that you previously marked as `suspect`. This helps identify patterns of fraudulent behavior. ### Environment scoping If you use a secret key that is scoped to an environment, you will only get events associated with the same environment. With a workspace-scoped environment, you will get events from all environments. Smart Signals not activated for your workspace or are not included in the response. + * ## Search The `/v4/events` endpoint provides a convenient way to search for past events based on specific parameters. Typical use cases and queries include: - Searching for events associated with a single `visitor_id` within a time range to get historical behavior of a visitor. - Searching for events associated with a single `linked_id` within a time range to get all events associated with your internal account identifier. - Excluding all bot traffic from the query (`good` and `bad` bots) If you don't provide `start` or `end` parameters, the default search range is the **last 7 days**. ### Filtering events with the `suspect` flag The `/v4/events` endpoint unlocks a powerful method for fraud protection analytics. The `suspect` flag is exposed in all events where it was previously set by the update API. You can also apply the `suspect` query parameter as a filter to find all potentially fraudulent activity that you previously marked as `suspect`. This helps identify patterns of fraudulent behavior. ### Environment scoping If you use a secret key that is scoped to an environment, you will only get events associated with the same environment. With a workspace-scoped environment, you will get events from all environments. Smart Signals not activated for your workspace or are not included in the response. * @param searchEventsOptionalParams Object containing optional parameters for API method. (optional) * @return EventSearch * @throws ApiException if fails to make API call * @http.response.details - - - - - - -
Status Code Description Response Headers
200 Events matching the filter(s). -
400 Bad request. One or more supplied search parameters are invalid, or a required parameter is missing. -
403 Forbidden. Access to this API is denied. -
500 Workspace error. -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 Events matching the filter(s). -
400 Bad request. One or more supplied search parameters are invalid, or a required parameter is missing. -
403 Forbidden. Access to this API is denied. -
500 Workspace error. -
*/ - public EventSearch searchEvents(SearchEventsOptionalParams searchEventsOptionalParams) throws ApiException { + public EventSearch searchEvents(SearchEventsOptionalParams searchEventsOptionalParams) + throws ApiException { return searchEventsWithHttpInfo(searchEventsOptionalParams).getData(); } /** * Search events - * ## Search The `/v4/events` endpoint provides a convenient way to search for past events based on specific parameters. Typical use cases and queries include: - Searching for events associated with a single `visitor_id` within a time range to get historical behavior of a visitor. - Searching for events associated with a single `linked_id` within a time range to get all events associated with your internal account identifier. - Excluding all bot traffic from the query (`good` and `bad` bots) If you don't provide `start` or `end` parameters, the default search range is the **last 7 days**. ### Filtering events with the `suspect` flag The `/v4/events` endpoint unlocks a powerful method for fraud protection analytics. The `suspect` flag is exposed in all events where it was previously set by the update API. You can also apply the `suspect` query parameter as a filter to find all potentially fraudulent activity that you previously marked as `suspect`. This helps identify patterns of fraudulent behavior. ### Environment scoping If you use a secret key that is scoped to an environment, you will only get events associated with the same environment. With a workspace-scoped environment, you will get events from all environments. Smart Signals not activated for your workspace or are not included in the response. + * ## Search The `/v4/events` endpoint provides a convenient way to search for past events based on specific parameters. Typical use cases and queries include: - Searching for events associated with a single `visitor_id` within a time range to get historical behavior of a visitor. - Searching for events associated with a single `linked_id` within a time range to get all events associated with your internal account identifier. - Excluding all bot traffic from the query (`good` and `bad` bots) If you don't provide `start` or `end` parameters, the default search range is the **last 7 days**. ### Filtering events with the `suspect` flag The `/v4/events` endpoint unlocks a powerful method for fraud protection analytics. The `suspect` flag is exposed in all events where it was previously set by the update API. You can also apply the `suspect` query parameter as a filter to find all potentially fraudulent activity that you previously marked as `suspect`. This helps identify patterns of fraudulent behavior. ### Environment scoping If you use a secret key that is scoped to an environment, you will only get events associated with the same environment. With a workspace-scoped environment, you will get events from all environments. Smart Signals not activated for your workspace or are not included in the response. * @param searchEventsOptionalParams Object containing optional parameters for API method. (optional) * @return ApiResponse * @throws ApiException if fails to make API call * @http.response.details - - - - - - -
Status Code Description Response Headers
200 Events matching the filter(s). -
400 Bad request. One or more supplied search parameters are invalid, or a required parameter is missing. -
403 Forbidden. Access to this API is denied. -
500 Workspace error. -
+ * + * + * + * + * + * + *
Status Code Description Response Headers
200 Events matching the filter(s). -
400 Bad request. One or more supplied search parameters are invalid, or a required parameter is missing. -
403 Forbidden. Access to this API is denied. -
500 Workspace error. -
*/ - public ApiResponse searchEventsWithHttpInfo(SearchEventsOptionalParams searchEventsOptionalParams) throws ApiException { + public ApiResponse searchEventsWithHttpInfo( + SearchEventsOptionalParams searchEventsOptionalParams) throws ApiException { Object localVarPostBody = null; - + // create path and map variables String localVarPath = "/events"; @@ -913,72 +943,138 @@ public ApiResponse searchEventsWithHttpInfo(SearchEventsOptionalPar localVarQueryParams.add(new Pair("ii", INTEGRATION_INFO)); if (searchEventsOptionalParams != null) { - localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", searchEventsOptionalParams.getLimit())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "pagination_key", searchEventsOptionalParams.getPaginationKey())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "visitor_id", searchEventsOptionalParams.getVisitorId())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "bot", searchEventsOptionalParams.getBot())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "ip_address", searchEventsOptionalParams.getIpAddress())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "asn", searchEventsOptionalParams.getAsn())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "linked_id", searchEventsOptionalParams.getLinkedId())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "url", searchEventsOptionalParams.getUrl())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "bundle_id", searchEventsOptionalParams.getBundleId())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "package_name", searchEventsOptionalParams.getPackageName())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "origin", searchEventsOptionalParams.getOrigin())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", searchEventsOptionalParams.getStart())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", searchEventsOptionalParams.getEnd())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "reverse", searchEventsOptionalParams.getReverse())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "suspect", searchEventsOptionalParams.getSuspect())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "vpn", searchEventsOptionalParams.getVpn())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "virtual_machine", searchEventsOptionalParams.getVirtualMachine())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "tampering", searchEventsOptionalParams.getTampering())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "anti_detect_browser", searchEventsOptionalParams.getAntiDetectBrowser())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "incognito", searchEventsOptionalParams.getIncognito())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "privacy_settings", searchEventsOptionalParams.getPrivacySettings())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "jailbroken", searchEventsOptionalParams.getJailbroken())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "frida", searchEventsOptionalParams.getFrida())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "factory_reset", searchEventsOptionalParams.getFactoryReset())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "cloned_app", searchEventsOptionalParams.getClonedApp())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "emulator", searchEventsOptionalParams.getEmulator())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "root_apps", searchEventsOptionalParams.getRootApps())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "vpn_confidence", searchEventsOptionalParams.getVpnConfidence())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "min_suspect_score", searchEventsOptionalParams.getMinSuspectScore())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "developer_tools", searchEventsOptionalParams.getDeveloperTools())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "location_spoofing", searchEventsOptionalParams.getLocationSpoofing())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "mitm_attack", searchEventsOptionalParams.getMitmAttack())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "proxy", searchEventsOptionalParams.getProxy())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sdk_version", searchEventsOptionalParams.getSdkVersion())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "sdk_platform", searchEventsOptionalParams.getSdkPlatform())); - localVarQueryParams.addAll(apiClient.parameterToPairs("multi", "environment", searchEventsOptionalParams.getEnvironment())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "proximity_id", searchEventsOptionalParams.getProximityId())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "total_hits", searchEventsOptionalParams.getTotalHits())); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "tor_node", searchEventsOptionalParams.getTorNode())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "limit", searchEventsOptionalParams.getLimit())); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "pagination_key", searchEventsOptionalParams.getPaginationKey())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "visitor_id", searchEventsOptionalParams.getVisitorId())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "bot", searchEventsOptionalParams.getBot())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "ip_address", searchEventsOptionalParams.getIpAddress())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "asn", searchEventsOptionalParams.getAsn())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "linked_id", searchEventsOptionalParams.getLinkedId())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "url", searchEventsOptionalParams.getUrl())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "bundle_id", searchEventsOptionalParams.getBundleId())); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "package_name", searchEventsOptionalParams.getPackageName())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "origin", searchEventsOptionalParams.getOrigin())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "start", searchEventsOptionalParams.getStart())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "end", searchEventsOptionalParams.getEnd())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "reverse", searchEventsOptionalParams.getReverse())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "suspect", searchEventsOptionalParams.getSuspect())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "vpn", searchEventsOptionalParams.getVpn())); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "virtual_machine", searchEventsOptionalParams.getVirtualMachine())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "tampering", searchEventsOptionalParams.getTampering())); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "anti_detect_browser", searchEventsOptionalParams.getAntiDetectBrowser())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "incognito", searchEventsOptionalParams.getIncognito())); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "privacy_settings", searchEventsOptionalParams.getPrivacySettings())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "jailbroken", searchEventsOptionalParams.getJailbroken())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "frida", searchEventsOptionalParams.getFrida())); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "factory_reset", searchEventsOptionalParams.getFactoryReset())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "cloned_app", searchEventsOptionalParams.getClonedApp())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "emulator", searchEventsOptionalParams.getEmulator())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "root_apps", searchEventsOptionalParams.getRootApps())); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "vpn_confidence", searchEventsOptionalParams.getVpnConfidence())); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "min_suspect_score", searchEventsOptionalParams.getMinSuspectScore())); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "developer_tools", searchEventsOptionalParams.getDeveloperTools())); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "location_spoofing", searchEventsOptionalParams.getLocationSpoofing())); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "mitm_attack", searchEventsOptionalParams.getMitmAttack())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "proxy", searchEventsOptionalParams.getProxy())); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "sdk_version", searchEventsOptionalParams.getSdkVersion())); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "sdk_platform", searchEventsOptionalParams.getSdkPlatform())); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "multi", "environment", searchEventsOptionalParams.getEnvironment())); + localVarQueryParams.addAll( + apiClient.parameterToPairs( + "", "proximity_id", searchEventsOptionalParams.getProximityId())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "total_hits", searchEventsOptionalParams.getTotalHits())); + localVarQueryParams.addAll( + apiClient.parameterToPairs("", "tor_node", searchEventsOptionalParams.getTorNode())); } final String localVarAccept = apiClient.selectHeaderAccept("application/json"); final String localVarContentType = apiClient.selectHeaderContentType(); - String[] localVarAuthNames = new String[] { "bearerAuth" }; + String[] localVarAuthNames = new String[] {"bearerAuth"}; GenericType localVarReturnType = new GenericType() {}; - return apiClient.invokeAPI("FingerprintApi.searchEvents", localVarPath, "GET", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, localVarReturnType, false); + return apiClient.invokeAPI( + "FingerprintApi.searchEvents", + localVarPath, + "GET", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + localVarReturnType, + false); } + /** * Update an event - * Change information in existing events specified by `event_id` or *flag suspicious events*. When an event is created, it can be assigned `linked_id` and `tags` submitted through the JS agent parameters. This information might not have been available on the client initially, so the Server API permits updating these attributes after the fact. **Warning** It's not possible to update events older than one month. **Warning** Trying to update an event immediately after creation may temporarily result in an error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully propagated across our systems. In such a case, simply retry the request. - * @param eventId The unique event [identifier](https://dev.fingerprint.com/reference/get-function#event_id). (required) + * Change information in existing events specified by `event_id` or *flag suspicious events*. When an event is created, it can be assigned `linked_id` and `tags` submitted through the JS agent parameters. This information might not have been available on the client initially, so the Server API permits updating these attributes after the fact. **Warning** It's not possible to update events older than one month. **Warning** Trying to update an event immediately after creation may temporarily result in an error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully propagated across our systems. In such a case, simply retry the request. + * @param eventId The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). (required) * @param eventUpdate (required) * @throws ApiException if fails to make API call * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 OK. -
400 Bad request. The request payload is not valid. -
403 Forbidden. Access to this API is denied. -
404 Not found. The event Id cannot be found in this workspace's data. -
409 Conflict. The event is not mutable yet. -
+ * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK. -
400 Bad request. The request payload is not valid. -
403 Forbidden. Access to this API is denied. -
404 Not found. The event Id cannot be found in this workspace's data. -
409 Conflict. The event is not mutable yet. -
*/ public void updateEvent(String eventId, EventUpdate eventUpdate) throws ApiException { updateEventWithHttpInfo(eventId, eventUpdate); @@ -986,37 +1082,41 @@ public void updateEvent(String eventId, EventUpdate eventUpdate) throws ApiExcep /** * Update an event - * Change information in existing events specified by `event_id` or *flag suspicious events*. When an event is created, it can be assigned `linked_id` and `tags` submitted through the JS agent parameters. This information might not have been available on the client initially, so the Server API permits updating these attributes after the fact. **Warning** It's not possible to update events older than one month. **Warning** Trying to update an event immediately after creation may temporarily result in an error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully propagated across our systems. In such a case, simply retry the request. - * @param eventId The unique event [identifier](https://dev.fingerprint.com/reference/get-function#event_id). (required) + * Change information in existing events specified by `event_id` or *flag suspicious events*. When an event is created, it can be assigned `linked_id` and `tags` submitted through the JS agent parameters. This information might not have been available on the client initially, so the Server API permits updating these attributes after the fact. **Warning** It's not possible to update events older than one month. **Warning** Trying to update an event immediately after creation may temporarily result in an error (HTTP 409 Conflict. The event is not mutable yet.) as the event is fully propagated across our systems. In such a case, simply retry the request. + * @param eventId The unique event [identifier](https://docs.fingerprint.com/reference/js-agent-v4-get-function#event_id). (required) * @param eventUpdate (required) * @return ApiResponse * @throws ApiException if fails to make API call * @http.response.details - - - - - - - -
Status Code Description Response Headers
200 OK. -
400 Bad request. The request payload is not valid. -
403 Forbidden. Access to this API is denied. -
404 Not found. The event Id cannot be found in this workspace's data. -
409 Conflict. The event is not mutable yet. -
+ * + * + * + * + * + * + * + *
Status Code Description Response Headers
200 OK. -
400 Bad request. The request payload is not valid. -
403 Forbidden. Access to this API is denied. -
404 Not found. The event Id cannot be found in this workspace's data. -
409 Conflict. The event is not mutable yet. -
*/ - public ApiResponse updateEventWithHttpInfo(String eventId, EventUpdate eventUpdate) throws ApiException { + public ApiResponse updateEventWithHttpInfo(String eventId, EventUpdate eventUpdate) + throws ApiException { Object localVarPostBody = eventUpdate; - + // verify the required parameter 'eventId' is set if (eventId == null) { - throw new ApiException(400, "Missing the required parameter 'eventId' when calling updateEvent"); + throw new ApiException( + 400, "Missing the required parameter 'eventId' when calling updateEvent"); } - + // verify the required parameter 'eventUpdate' is set if (eventUpdate == null) { - throw new ApiException(400, "Missing the required parameter 'eventUpdate' when calling updateEvent"); + throw new ApiException( + 400, "Missing the required parameter 'eventUpdate' when calling updateEvent"); } - + // create path and map variables - String localVarPath = "/events/{event_id}" - .replaceAll("\\{" + "event_id" + "\\}", apiClient.escapeString(eventId.toString())); + String localVarPath = + "/events/{event_id}" + .replaceAll("\\{" + "event_id" + "\\}", apiClient.escapeString(eventId.toString())); // query params List localVarQueryParams = new ArrayList(); @@ -1028,10 +1128,21 @@ public ApiResponse updateEventWithHttpInfo(String eventId, EventUpdate eve final String localVarAccept = apiClient.selectHeaderAccept("application/json"); final String localVarContentType = apiClient.selectHeaderContentType("application/json"); - String[] localVarAuthNames = new String[] { "bearerAuth" }; - - return apiClient.invokeAPI("FingerprintApi.updateEvent", localVarPath, "PATCH", localVarQueryParams, localVarPostBody, - localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, - localVarAuthNames, null, false); + String[] localVarAuthNames = new String[] {"bearerAuth"}; + + return apiClient.invokeAPI( + "FingerprintApi.updateEvent", + localVarPath, + "PATCH", + localVarQueryParams, + localVarPostBody, + localVarHeaderParams, + localVarCookieParams, + localVarFormParams, + localVarAccept, + localVarContentType, + localVarAuthNames, + null, + false); } } diff --git a/sdk/src/main/java/com/fingerprint/v4/model/BotInfo.java b/sdk/src/main/java/com/fingerprint/v4/model/BotInfo.java index abefa983..9e6e359f 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/BotInfo.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/BotInfo.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,22 +10,14 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; /** * Extended bot information. @@ -38,35 +30,35 @@ BotInfo.JSON_PROPERTY_IDENTITY, BotInfo.JSON_PROPERTY_CONFIDENCE }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class BotInfo { public static final String JSON_PROPERTY_CATEGORY = "category"; - @jakarta.annotation.Nonnull - private String category; + @jakarta.annotation.Nonnull private String category; public static final String JSON_PROPERTY_PROVIDER = "provider"; - @jakarta.annotation.Nonnull - private String provider; + @jakarta.annotation.Nonnull private String provider; public static final String JSON_PROPERTY_PROVIDER_URL = "provider_url"; - @jakarta.annotation.Nullable - private String providerUrl; + @jakarta.annotation.Nullable private String providerUrl; public static final String JSON_PROPERTY_NAME = "name"; - @jakarta.annotation.Nonnull - private String name; + @jakarta.annotation.Nonnull private String name; /** - * The verification status of the bot's identity: * `verified` - well-known bot with publicly verifiable identity, directed by the bot provider. * `signed` - bot that signs its platform via Web Bot Auth, directed by the bot provider’s customers. * `spoofed` - bot that claims a public identity but fails verification. * `unknown` - bot that does not publish a verifiable identity. + * The verification status of the bot's identity: * `verified` - well-known bot with publicly verifiable identity, directed by the bot provider. * `signed` - bot that signs its platform via Web Bot Auth, directed by the bot provider’s customers. * `spoofed` - bot that claims a public identity but fails verification. * `unknown` - bot that does not publish a verifiable identity. */ public enum IdentityEnum { VERIFIED(String.valueOf("verified")), - + SIGNED(String.valueOf("signed")), - + SPOOFED(String.valueOf("spoofed")), - - UNKNOWN(String.valueOf("unknown")); + + UNKNOWN(String.valueOf("unknown")), + + UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED("unsupported_value_sdk_upgrade_required"); private String value; @@ -91,23 +83,24 @@ public static IdentityEnum fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED; } } public static final String JSON_PROPERTY_IDENTITY = "identity"; - @jakarta.annotation.Nonnull - private IdentityEnum identity; + @jakarta.annotation.Nonnull private IdentityEnum identity; /** * Confidence level of the bot identification. */ public enum ConfidenceEnum { LOW(String.valueOf("low")), - + MEDIUM(String.valueOf("medium")), - - HIGH(String.valueOf("high")); + + HIGH(String.valueOf("high")), + + UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED("unsupported_value_sdk_upgrade_required"); private String value; @@ -132,16 +125,14 @@ public static ConfidenceEnum fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED; } } public static final String JSON_PROPERTY_CONFIDENCE = "confidence"; - @jakarta.annotation.Nonnull - private ConfidenceEnum confidence; + @jakarta.annotation.Nonnull private ConfidenceEnum confidence; - public BotInfo() { - } + public BotInfo() {} public BotInfo category(@jakarta.annotation.Nonnull String category) { this.category = category; @@ -155,19 +146,16 @@ public BotInfo category(@jakarta.annotation.Nonnull String category) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getCategory() { return category; } - @JsonProperty(value = JSON_PROPERTY_CATEGORY, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setCategory(@jakarta.annotation.Nonnull String category) { this.category = category; } - public BotInfo provider(@jakarta.annotation.Nonnull String provider) { this.provider = provider; return this; @@ -180,19 +168,16 @@ public BotInfo provider(@jakarta.annotation.Nonnull String provider) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_PROVIDER, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getProvider() { return provider; } - @JsonProperty(value = JSON_PROPERTY_PROVIDER, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setProvider(@jakarta.annotation.Nonnull String provider) { this.provider = provider; } - public BotInfo providerUrl(@jakarta.annotation.Nullable String providerUrl) { this.providerUrl = providerUrl; return this; @@ -205,19 +190,16 @@ public BotInfo providerUrl(@jakarta.annotation.Nullable String providerUrl) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PROVIDER_URL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getProviderUrl() { return providerUrl; } - @JsonProperty(value = JSON_PROPERTY_PROVIDER_URL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProviderUrl(@jakarta.annotation.Nullable String providerUrl) { this.providerUrl = providerUrl; } - public BotInfo name(@jakarta.annotation.Nonnull String name) { this.name = name; return this; @@ -230,44 +212,38 @@ public BotInfo name(@jakarta.annotation.Nonnull String name) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { return name; } - @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setName(@jakarta.annotation.Nonnull String name) { this.name = name; } - public BotInfo identity(@jakarta.annotation.Nonnull IdentityEnum identity) { this.identity = identity; return this; } /** - * The verification status of the bot's identity: * `verified` - well-known bot with publicly verifiable identity, directed by the bot provider. * `signed` - bot that signs its platform via Web Bot Auth, directed by the bot provider’s customers. * `spoofed` - bot that claims a public identity but fails verification. * `unknown` - bot that does not publish a verifiable identity. + * The verification status of the bot's identity: * `verified` - well-known bot with publicly verifiable identity, directed by the bot provider. * `signed` - bot that signs its platform via Web Bot Auth, directed by the bot provider’s customers. * `spoofed` - bot that claims a public identity but fails verification. * `unknown` - bot that does not publish a verifiable identity. * @return identity */ @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_IDENTITY, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public IdentityEnum getIdentity() { return identity; } - @JsonProperty(value = JSON_PROPERTY_IDENTITY, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setIdentity(@jakarta.annotation.Nonnull IdentityEnum identity) { this.identity = identity; } - public BotInfo confidence(@jakarta.annotation.Nonnull ConfidenceEnum confidence) { this.confidence = confidence; return this; @@ -280,19 +256,16 @@ public BotInfo confidence(@jakarta.annotation.Nonnull ConfidenceEnum confidence) @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CONFIDENCE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ConfidenceEnum getConfidence() { return confidence; } - @JsonProperty(value = JSON_PROPERTY_CONFIDENCE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setConfidence(@jakarta.annotation.Nonnull ConfidenceEnum confidence) { this.confidence = confidence; } - /** * Return true if this BotInfo object is equal to o. */ @@ -305,12 +278,12 @@ public boolean equals(Object o) { return false; } BotInfo botInfo = (BotInfo) o; - return Objects.equals(this.category, botInfo.category) && - Objects.equals(this.provider, botInfo.provider) && - Objects.equals(this.providerUrl, botInfo.providerUrl) && - Objects.equals(this.name, botInfo.name) && - Objects.equals(this.identity, botInfo.identity) && - Objects.equals(this.confidence, botInfo.confidence); + return Objects.equals(this.category, botInfo.category) + && Objects.equals(this.provider, botInfo.provider) + && Objects.equals(this.providerUrl, botInfo.providerUrl) + && Objects.equals(this.name, botInfo.name) + && Objects.equals(this.identity, botInfo.identity) + && Objects.equals(this.confidence, botInfo.confidence); } @Override @@ -342,6 +315,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/BotResult.java b/sdk/src/main/java/com/fingerprint/v4/model/BotResult.java index c927ea04..6fc37756 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/BotResult.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/BotResult.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,31 +10,22 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Locale; /** - * Bot detection result: * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on * `not_detected` - the visitor is not a bot + * Bot detection result: * `bad` - bad bot detected, such as Selenium, Puppeteer, Playwright, headless browsers, and so on * `good` - good bot detected, such as Google bot, Baidu Spider, AlexaBot and so on * `not_detected` - the visitor is not a bot */ public enum BotResult { - BAD("bad"), - + GOOD("good"), - - NOT_DETECTED("not_detected"); + + NOT_DETECTED("not_detected"), + + UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED("unsupported_value_sdk_upgrade_required"); private String value; @@ -59,7 +50,6 @@ public static BotResult fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED; } } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/BrowserDetails.java b/sdk/src/main/java/com/fingerprint/v4/model/BrowserDetails.java index e97fde78..43101738 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/BrowserDetails.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/BrowserDetails.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,22 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * BrowserDetails @@ -38,34 +28,29 @@ BrowserDetails.JSON_PROPERTY_OS_VERSION, BrowserDetails.JSON_PROPERTY_DEVICE }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class BrowserDetails { public static final String JSON_PROPERTY_BROWSER_NAME = "browser_name"; - @jakarta.annotation.Nonnull - private String browserName; + @jakarta.annotation.Nonnull private String browserName; public static final String JSON_PROPERTY_BROWSER_MAJOR_VERSION = "browser_major_version"; - @jakarta.annotation.Nonnull - private String browserMajorVersion; + @jakarta.annotation.Nonnull private String browserMajorVersion; public static final String JSON_PROPERTY_BROWSER_FULL_VERSION = "browser_full_version"; - @jakarta.annotation.Nonnull - private String browserFullVersion; + @jakarta.annotation.Nonnull private String browserFullVersion; public static final String JSON_PROPERTY_OS = "os"; - @jakarta.annotation.Nonnull - private String os; + @jakarta.annotation.Nonnull private String os; public static final String JSON_PROPERTY_OS_VERSION = "os_version"; - @jakarta.annotation.Nonnull - private String osVersion; + @jakarta.annotation.Nonnull private String osVersion; public static final String JSON_PROPERTY_DEVICE = "device"; - @jakarta.annotation.Nonnull - private String device; + @jakarta.annotation.Nonnull private String device; - public BrowserDetails() { - } + public BrowserDetails() {} public BrowserDetails browserName(@jakarta.annotation.Nonnull String browserName) { this.browserName = browserName; @@ -79,20 +64,18 @@ public BrowserDetails browserName(@jakarta.annotation.Nonnull String browserName @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_BROWSER_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getBrowserName() { return browserName; } - @JsonProperty(value = JSON_PROPERTY_BROWSER_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setBrowserName(@jakarta.annotation.Nonnull String browserName) { this.browserName = browserName; } - - public BrowserDetails browserMajorVersion(@jakarta.annotation.Nonnull String browserMajorVersion) { + public BrowserDetails browserMajorVersion( + @jakarta.annotation.Nonnull String browserMajorVersion) { this.browserMajorVersion = browserMajorVersion; return this; } @@ -104,19 +87,16 @@ public BrowserDetails browserMajorVersion(@jakarta.annotation.Nonnull String bro @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_BROWSER_MAJOR_VERSION, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getBrowserMajorVersion() { return browserMajorVersion; } - @JsonProperty(value = JSON_PROPERTY_BROWSER_MAJOR_VERSION, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setBrowserMajorVersion(@jakarta.annotation.Nonnull String browserMajorVersion) { this.browserMajorVersion = browserMajorVersion; } - public BrowserDetails browserFullVersion(@jakarta.annotation.Nonnull String browserFullVersion) { this.browserFullVersion = browserFullVersion; return this; @@ -129,19 +109,16 @@ public BrowserDetails browserFullVersion(@jakarta.annotation.Nonnull String brow @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_BROWSER_FULL_VERSION, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getBrowserFullVersion() { return browserFullVersion; } - @JsonProperty(value = JSON_PROPERTY_BROWSER_FULL_VERSION, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setBrowserFullVersion(@jakarta.annotation.Nonnull String browserFullVersion) { this.browserFullVersion = browserFullVersion; } - public BrowserDetails os(@jakarta.annotation.Nonnull String os) { this.os = os; return this; @@ -154,19 +131,16 @@ public BrowserDetails os(@jakarta.annotation.Nonnull String os) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_OS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getOs() { return os; } - @JsonProperty(value = JSON_PROPERTY_OS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setOs(@jakarta.annotation.Nonnull String os) { this.os = os; } - public BrowserDetails osVersion(@jakarta.annotation.Nonnull String osVersion) { this.osVersion = osVersion; return this; @@ -179,19 +153,16 @@ public BrowserDetails osVersion(@jakarta.annotation.Nonnull String osVersion) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_OS_VERSION, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getOsVersion() { return osVersion; } - @JsonProperty(value = JSON_PROPERTY_OS_VERSION, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setOsVersion(@jakarta.annotation.Nonnull String osVersion) { this.osVersion = osVersion; } - public BrowserDetails device(@jakarta.annotation.Nonnull String device) { this.device = device; return this; @@ -204,19 +175,16 @@ public BrowserDetails device(@jakarta.annotation.Nonnull String device) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_DEVICE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getDevice() { return device; } - @JsonProperty(value = JSON_PROPERTY_DEVICE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setDevice(@jakarta.annotation.Nonnull String device) { this.device = device; } - /** * Return true if this BrowserDetails object is equal to o. */ @@ -229,17 +197,18 @@ public boolean equals(Object o) { return false; } BrowserDetails browserDetails = (BrowserDetails) o; - return Objects.equals(this.browserName, browserDetails.browserName) && - Objects.equals(this.browserMajorVersion, browserDetails.browserMajorVersion) && - Objects.equals(this.browserFullVersion, browserDetails.browserFullVersion) && - Objects.equals(this.os, browserDetails.os) && - Objects.equals(this.osVersion, browserDetails.osVersion) && - Objects.equals(this.device, browserDetails.device); + return Objects.equals(this.browserName, browserDetails.browserName) + && Objects.equals(this.browserMajorVersion, browserDetails.browserMajorVersion) + && Objects.equals(this.browserFullVersion, browserDetails.browserFullVersion) + && Objects.equals(this.os, browserDetails.os) + && Objects.equals(this.osVersion, browserDetails.osVersion) + && Objects.equals(this.device, browserDetails.device); } @Override public int hashCode() { - return Objects.hash(browserName, browserMajorVersion, browserFullVersion, os, osVersion, device); + return Objects.hash( + browserName, browserMajorVersion, browserFullVersion, os, osVersion, device); } @Override @@ -247,7 +216,9 @@ public String toString() { StringBuilder sb = new StringBuilder(); sb.append("class BrowserDetails {\n"); sb.append(" browserName: ").append(toIndentedString(browserName)).append("\n"); - sb.append(" browserMajorVersion: ").append(toIndentedString(browserMajorVersion)).append("\n"); + sb.append(" browserMajorVersion: ") + .append(toIndentedString(browserMajorVersion)) + .append("\n"); sb.append(" browserFullVersion: ").append(toIndentedString(browserFullVersion)).append("\n"); sb.append(" os: ").append(toIndentedString(os)).append("\n"); sb.append(" osVersion: ").append(toIndentedString(osVersion)).append("\n"); @@ -266,6 +237,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/Canvas.java b/sdk/src/main/java/com/fingerprint/v4/model/Canvas.java index c0b96060..30e3a51a 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/Canvas.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/Canvas.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,22 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * Canvas fingerprint containing winding flag plus geometry/text hashes. @@ -35,22 +25,20 @@ Canvas.JSON_PROPERTY_GEOMETRY, Canvas.JSON_PROPERTY_TEXT }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class Canvas { public static final String JSON_PROPERTY_WINDING = "winding"; - @jakarta.annotation.Nullable - private Boolean winding; + @jakarta.annotation.Nullable private Boolean winding; public static final String JSON_PROPERTY_GEOMETRY = "geometry"; - @jakarta.annotation.Nullable - private String geometry; + @jakarta.annotation.Nullable private String geometry; public static final String JSON_PROPERTY_TEXT = "text"; - @jakarta.annotation.Nullable - private String text; + @jakarta.annotation.Nullable private String text; - public Canvas() { - } + public Canvas() {} public Canvas winding(@jakarta.annotation.Nullable Boolean winding) { this.winding = winding; @@ -64,19 +52,16 @@ public Canvas winding(@jakarta.annotation.Nullable Boolean winding) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_WINDING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getWinding() { return winding; } - @JsonProperty(value = JSON_PROPERTY_WINDING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWinding(@jakarta.annotation.Nullable Boolean winding) { this.winding = winding; } - public Canvas geometry(@jakarta.annotation.Nullable String geometry) { this.geometry = geometry; return this; @@ -89,19 +74,16 @@ public Canvas geometry(@jakarta.annotation.Nullable String geometry) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_GEOMETRY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getGeometry() { return geometry; } - @JsonProperty(value = JSON_PROPERTY_GEOMETRY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGeometry(@jakarta.annotation.Nullable String geometry) { this.geometry = geometry; } - public Canvas text(@jakarta.annotation.Nullable String text) { this.text = text; return this; @@ -114,19 +96,16 @@ public Canvas text(@jakarta.annotation.Nullable String text) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TEXT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getText() { return text; } - @JsonProperty(value = JSON_PROPERTY_TEXT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setText(@jakarta.annotation.Nullable String text) { this.text = text; } - /** * Return true if this Canvas object is equal to o. */ @@ -139,9 +118,9 @@ public boolean equals(Object o) { return false; } Canvas canvas = (Canvas) o; - return Objects.equals(this.winding, canvas.winding) && - Objects.equals(this.geometry, canvas.geometry) && - Objects.equals(this.text, canvas.text); + return Objects.equals(this.winding, canvas.winding) + && Objects.equals(this.geometry, canvas.geometry) + && Objects.equals(this.text, canvas.text); } @Override @@ -170,6 +149,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/Emoji.java b/sdk/src/main/java/com/fingerprint/v4/model/Emoji.java index 3854eadb..2338f0c7 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/Emoji.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/Emoji.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,22 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * Bounding box metrics describing how the emoji glyph renders. @@ -41,46 +31,38 @@ Emoji.JSON_PROPERTY_X, Emoji.JSON_PROPERTY_Y }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class Emoji { public static final String JSON_PROPERTY_FONT = "font"; - @jakarta.annotation.Nullable - private String font; + @jakarta.annotation.Nullable private String font; public static final String JSON_PROPERTY_WIDTH = "width"; - @jakarta.annotation.Nullable - private Double width; + @jakarta.annotation.Nullable private Double width; public static final String JSON_PROPERTY_HEIGHT = "height"; - @jakarta.annotation.Nullable - private Double height; + @jakarta.annotation.Nullable private Double height; public static final String JSON_PROPERTY_TOP = "top"; - @jakarta.annotation.Nullable - private Double top; + @jakarta.annotation.Nullable private Double top; public static final String JSON_PROPERTY_BOTTOM = "bottom"; - @jakarta.annotation.Nullable - private Double bottom; + @jakarta.annotation.Nullable private Double bottom; public static final String JSON_PROPERTY_LEFT = "left"; - @jakarta.annotation.Nullable - private Double left; + @jakarta.annotation.Nullable private Double left; public static final String JSON_PROPERTY_RIGHT = "right"; - @jakarta.annotation.Nullable - private Double right; + @jakarta.annotation.Nullable private Double right; public static final String JSON_PROPERTY_X = "x"; - @jakarta.annotation.Nullable - private Double x; + @jakarta.annotation.Nullable private Double x; public static final String JSON_PROPERTY_Y = "y"; - @jakarta.annotation.Nullable - private Double y; + @jakarta.annotation.Nullable private Double y; - public Emoji() { - } + public Emoji() {} public Emoji font(@jakarta.annotation.Nullable String font) { this.font = font; @@ -94,19 +76,16 @@ public Emoji font(@jakarta.annotation.Nullable String font) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FONT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getFont() { return font; } - @JsonProperty(value = JSON_PROPERTY_FONT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFont(@jakarta.annotation.Nullable String font) { this.font = font; } - public Emoji width(@jakarta.annotation.Nullable Double width) { this.width = width; return this; @@ -119,19 +98,16 @@ public Emoji width(@jakarta.annotation.Nullable Double width) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_WIDTH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getWidth() { return width; } - @JsonProperty(value = JSON_PROPERTY_WIDTH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWidth(@jakarta.annotation.Nullable Double width) { this.width = width; } - public Emoji height(@jakarta.annotation.Nullable Double height) { this.height = height; return this; @@ -144,19 +120,16 @@ public Emoji height(@jakarta.annotation.Nullable Double height) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_HEIGHT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getHeight() { return height; } - @JsonProperty(value = JSON_PROPERTY_HEIGHT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHeight(@jakarta.annotation.Nullable Double height) { this.height = height; } - public Emoji top(@jakarta.annotation.Nullable Double top) { this.top = top; return this; @@ -169,19 +142,16 @@ public Emoji top(@jakarta.annotation.Nullable Double top) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TOP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getTop() { return top; } - @JsonProperty(value = JSON_PROPERTY_TOP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTop(@jakarta.annotation.Nullable Double top) { this.top = top; } - public Emoji bottom(@jakarta.annotation.Nullable Double bottom) { this.bottom = bottom; return this; @@ -194,19 +164,16 @@ public Emoji bottom(@jakarta.annotation.Nullable Double bottom) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BOTTOM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getBottom() { return bottom; } - @JsonProperty(value = JSON_PROPERTY_BOTTOM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBottom(@jakarta.annotation.Nullable Double bottom) { this.bottom = bottom; } - public Emoji left(@jakarta.annotation.Nullable Double left) { this.left = left; return this; @@ -219,19 +186,16 @@ public Emoji left(@jakarta.annotation.Nullable Double left) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_LEFT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getLeft() { return left; } - @JsonProperty(value = JSON_PROPERTY_LEFT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLeft(@jakarta.annotation.Nullable Double left) { this.left = left; } - public Emoji right(@jakarta.annotation.Nullable Double right) { this.right = right; return this; @@ -244,19 +208,16 @@ public Emoji right(@jakarta.annotation.Nullable Double right) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_RIGHT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getRight() { return right; } - @JsonProperty(value = JSON_PROPERTY_RIGHT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRight(@jakarta.annotation.Nullable Double right) { this.right = right; } - public Emoji x(@jakarta.annotation.Nullable Double x) { this.x = x; return this; @@ -269,19 +230,16 @@ public Emoji x(@jakarta.annotation.Nullable Double x) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_X, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getX() { return x; } - @JsonProperty(value = JSON_PROPERTY_X, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setX(@jakarta.annotation.Nullable Double x) { this.x = x; } - public Emoji y(@jakarta.annotation.Nullable Double y) { this.y = y; return this; @@ -294,19 +252,16 @@ public Emoji y(@jakarta.annotation.Nullable Double y) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_Y, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getY() { return y; } - @JsonProperty(value = JSON_PROPERTY_Y, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setY(@jakarta.annotation.Nullable Double y) { this.y = y; } - /** * Return true if this Emoji object is equal to o. */ @@ -319,15 +274,15 @@ public boolean equals(Object o) { return false; } Emoji emoji = (Emoji) o; - return Objects.equals(this.font, emoji.font) && - Objects.equals(this.width, emoji.width) && - Objects.equals(this.height, emoji.height) && - Objects.equals(this.top, emoji.top) && - Objects.equals(this.bottom, emoji.bottom) && - Objects.equals(this.left, emoji.left) && - Objects.equals(this.right, emoji.right) && - Objects.equals(this.x, emoji.x) && - Objects.equals(this.y, emoji.y); + return Objects.equals(this.font, emoji.font) + && Objects.equals(this.width, emoji.width) + && Objects.equals(this.height, emoji.height) + && Objects.equals(this.top, emoji.top) + && Objects.equals(this.bottom, emoji.bottom) + && Objects.equals(this.left, emoji.left) + && Objects.equals(this.right, emoji.right) + && Objects.equals(this.x, emoji.x) + && Objects.equals(this.y, emoji.y); } @Override @@ -362,6 +317,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/Error.java b/sdk/src/main/java/com/fingerprint/v4/model/Error.java index 88a6a766..a282337d 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/Error.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/Error.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,43 +10,28 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.ErrorCode; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * Error */ -@JsonPropertyOrder({ - Error.JSON_PROPERTY_CODE, - Error.JSON_PROPERTY_MESSAGE -}) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@JsonPropertyOrder({Error.JSON_PROPERTY_CODE, Error.JSON_PROPERTY_MESSAGE}) +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class Error { public static final String JSON_PROPERTY_CODE = "code"; - @jakarta.annotation.Nonnull - private ErrorCode code; + @jakarta.annotation.Nonnull private ErrorCode code; public static final String JSON_PROPERTY_MESSAGE = "message"; - @jakarta.annotation.Nonnull - private String message; + @jakarta.annotation.Nonnull private String message; - public Error() { - } + public Error() {} public Error code(@jakarta.annotation.Nonnull ErrorCode code) { this.code = code; @@ -60,19 +45,16 @@ public Error code(@jakarta.annotation.Nonnull ErrorCode code) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CODE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ErrorCode getCode() { return code; } - @JsonProperty(value = JSON_PROPERTY_CODE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setCode(@jakarta.annotation.Nonnull ErrorCode code) { this.code = code; } - public Error message(@jakarta.annotation.Nonnull String message) { this.message = message; return this; @@ -85,19 +67,16 @@ public Error message(@jakarta.annotation.Nonnull String message) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getMessage() { return message; } - @JsonProperty(value = JSON_PROPERTY_MESSAGE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setMessage(@jakarta.annotation.Nonnull String message) { this.message = message; } - /** * Return true if this Error object is equal to o. */ @@ -110,8 +89,7 @@ public boolean equals(Object o) { return false; } Error error = (Error) o; - return Objects.equals(this.code, error.code) && - Objects.equals(this.message, error.message); + return Objects.equals(this.code, error.code) && Objects.equals(this.message, error.message); } @Override @@ -139,6 +117,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/ErrorCode.java b/sdk/src/main/java/com/fingerprint/v4/model/ErrorCode.java index 53d97abe..384100db 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/ErrorCode.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/ErrorCode.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,61 +10,52 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Locale; /** - * Error code: * `request_cannot_be_parsed` - The query parameters or JSON payload contains some errors that prevented us from parsing it (wrong type/surpassed limits). * `secret_api_key_required` - secret API key in header is missing or empty. * `secret_api_key_not_found` - No Fingerprint workspace found for specified secret API key. * `public_api_key_required` - public API key in header is missing or empty. * `public_api_key_not_found` - No Fingerprint workspace found for specified public API key. * `subscription_not_active` - Fingerprint workspace is not active. * `wrong_region` - Server and workspace region differ. * `feature_not_enabled` - This feature (for example, Delete API) is not enabled for your workspace. * `request_not_found` - The specified event ID was not found. It never existed, expired, or it has been deleted. * `visitor_not_found` - The specified visitor ID was not found. It never existed or it may have already been deleted. * `too_many_requests` - The limit on secret API key requests per second has been exceeded. * `state_not_ready` - The event specified with event ID is not ready for updates yet. Try again. This error happens in rare cases when update API is called immediately after receiving the event ID on the client. In case you need to send information right away, we recommend using the JS agent API instead. * `failed` - Internal server error. * `event_not_found` - The specified event ID was not found. It never existed, expired, or it has been deleted. * `missing_module` - The request is invalid because it is missing a required module. * `payload_too_large` - The request payload is too large and cannot be processed. * `service_unavailable` - The service was unable to process the request. * `ruleset_not_found` - The specified ruleset was not found. It never existed or it has been deleted. + * Error code: * `request_cannot_be_parsed` - The query parameters or JSON payload contains some errors that prevented us from parsing it (wrong type/surpassed limits). * `secret_api_key_required` - secret API key in header is missing or empty. * `secret_api_key_not_found` - No Fingerprint workspace found for specified secret API key. * `public_api_key_required` - public API key in header is missing or empty. * `public_api_key_not_found` - No Fingerprint workspace found for specified public API key. * `subscription_not_active` - Fingerprint workspace is not active. * `wrong_region` - Server and workspace region differ. * `feature_not_enabled` - This feature (for example, Delete API) is not enabled for your workspace. * `request_not_found` - The specified event ID was not found. It never existed, expired, or it has been deleted. * `visitor_not_found` - The specified visitor ID was not found. It never existed or it may have already been deleted. * `too_many_requests` - The limit on secret API key requests per second has been exceeded. * `state_not_ready` - The event specified with event ID is not ready for updates yet. Try again. This error happens in rare cases when update API is called immediately after receiving the event ID on the client. In case you need to send information right away, we recommend using the JS agent API instead. * `failed` - Internal server error. * `event_not_found` - The specified event ID was not found. It never existed, expired, or it has been deleted. * `missing_module` - The request is invalid because it is missing a required module. * `payload_too_large` - The request payload is too large and cannot be processed. * `service_unavailable` - The service was unable to process the request. * `ruleset_not_found` - The specified ruleset was not found. It never existed or it has been deleted. */ public enum ErrorCode { - REQUEST_CANNOT_BE_PARSED("request_cannot_be_parsed"), - + SECRET_API_KEY_REQUIRED("secret_api_key_required"), - + SECRET_API_KEY_NOT_FOUND("secret_api_key_not_found"), - + PUBLIC_API_KEY_REQUIRED("public_api_key_required"), - + PUBLIC_API_KEY_NOT_FOUND("public_api_key_not_found"), - + SUBSCRIPTION_NOT_ACTIVE("subscription_not_active"), - + WRONG_REGION("wrong_region"), - + FEATURE_NOT_ENABLED("feature_not_enabled"), - + REQUEST_NOT_FOUND("request_not_found"), - + VISITOR_NOT_FOUND("visitor_not_found"), - + TOO_MANY_REQUESTS("too_many_requests"), - + STATE_NOT_READY("state_not_ready"), - + FAILED("failed"), - + EVENT_NOT_FOUND("event_not_found"), - + MISSING_MODULE("missing_module"), - + PAYLOAD_TOO_LARGE("payload_too_large"), - + SERVICE_UNAVAILABLE("service_unavailable"), - - RULESET_NOT_FOUND("ruleset_not_found"); + + RULESET_NOT_FOUND("ruleset_not_found"), + + UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED("unsupported_value_sdk_upgrade_required"); private String value; @@ -89,7 +80,6 @@ public static ErrorCode fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED; } } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/ErrorResponse.java b/sdk/src/main/java/com/fingerprint/v4/model/ErrorResponse.java index e02811df..49b0be48 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/ErrorResponse.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/ErrorResponse.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,38 +10,25 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.Error; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * ErrorResponse */ -@JsonPropertyOrder({ - ErrorResponse.JSON_PROPERTY_ERROR -}) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@JsonPropertyOrder({ErrorResponse.JSON_PROPERTY_ERROR}) +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class ErrorResponse { public static final String JSON_PROPERTY_ERROR = "error"; - @jakarta.annotation.Nonnull - private Error error; + @jakarta.annotation.Nonnull private Error error; - public ErrorResponse() { - } + public ErrorResponse() {} public ErrorResponse error(@jakarta.annotation.Nonnull Error error) { this.error = error; @@ -55,19 +42,16 @@ public ErrorResponse error(@jakarta.annotation.Nonnull Error error) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_ERROR, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Error getError() { return error; } - @JsonProperty(value = JSON_PROPERTY_ERROR, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setError(@jakarta.annotation.Nonnull Error error) { this.error = error; } - /** * Return true if this ErrorResponse object is equal to o. */ @@ -107,6 +91,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/Event.java b/sdk/src/main/java/com/fingerprint/v4/model/Event.java index b912e8b1..52b93012 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/Event.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/Event.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,39 +10,14 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.BotInfo; -import com.fingerprint.v4.model.BotResult; -import com.fingerprint.v4.model.BrowserDetails; -import com.fingerprint.v4.model.EventRuleAction; -import com.fingerprint.v4.model.IPBlockList; -import com.fingerprint.v4.model.IPInfo; -import com.fingerprint.v4.model.Identification; -import com.fingerprint.v4.model.Proximity; -import com.fingerprint.v4.model.ProxyConfidence; -import com.fingerprint.v4.model.ProxyDetails; -import com.fingerprint.v4.model.RawDeviceAttributes; -import com.fingerprint.v4.model.SDK; -import com.fingerprint.v4.model.SupplementaryIDHighRecall; -import com.fingerprint.v4.model.TamperingDetails; -import com.fingerprint.v4.model.Velocity; -import com.fingerprint.v4.model.VpnConfidence; -import com.fingerprint.v4.model.VpnMethods; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; /** * Contains results from Fingerprint Identification and all active Smart Signals. @@ -99,210 +74,162 @@ Event.JSON_PROPERTY_HIGH_ACTIVITY_DEVICE, Event.JSON_PROPERTY_RAW_DEVICE_ATTRIBUTES }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class Event { public static final String JSON_PROPERTY_EVENT_ID = "event_id"; - @jakarta.annotation.Nonnull - private String eventId; + @jakarta.annotation.Nonnull private String eventId; public static final String JSON_PROPERTY_TIMESTAMP = "timestamp"; - @jakarta.annotation.Nonnull - private Long timestamp; + @jakarta.annotation.Nonnull private Long timestamp; public static final String JSON_PROPERTY_LINKED_ID = "linked_id"; - @jakarta.annotation.Nullable - private String linkedId; + @jakarta.annotation.Nullable private String linkedId; public static final String JSON_PROPERTY_ENVIRONMENT_ID = "environment_id"; - @jakarta.annotation.Nullable - private String environmentId; + @jakarta.annotation.Nullable private String environmentId; public static final String JSON_PROPERTY_SUSPECT = "suspect"; - @jakarta.annotation.Nullable - private Boolean suspect; + @jakarta.annotation.Nullable private Boolean suspect; public static final String JSON_PROPERTY_SDK = "sdk"; - @jakarta.annotation.Nullable - private SDK sdk; + @jakarta.annotation.Nullable private SDK sdk; public static final String JSON_PROPERTY_REPLAYED = "replayed"; - @jakarta.annotation.Nullable - private Boolean replayed; + @jakarta.annotation.Nullable private Boolean replayed; public static final String JSON_PROPERTY_IDENTIFICATION = "identification"; - @jakarta.annotation.Nullable - private Identification identification; + @jakarta.annotation.Nullable private Identification identification; - public static final String JSON_PROPERTY_SUPPLEMENTARY_ID_HIGH_RECALL = "supplementary_id_high_recall"; - @jakarta.annotation.Nullable - private SupplementaryIDHighRecall supplementaryIdHighRecall; + public static final String JSON_PROPERTY_SUPPLEMENTARY_ID_HIGH_RECALL = + "supplementary_id_high_recall"; + @jakarta.annotation.Nullable private SupplementaryIDHighRecall supplementaryIdHighRecall; public static final String JSON_PROPERTY_TAGS = "tags"; - @jakarta.annotation.Nullable - private Object tags; + @jakarta.annotation.Nullable private Map tags = new HashMap<>(); public static final String JSON_PROPERTY_URL = "url"; - @jakarta.annotation.Nullable - private String url; + @jakarta.annotation.Nullable private String url; public static final String JSON_PROPERTY_BUNDLE_ID = "bundle_id"; - @jakarta.annotation.Nullable - private String bundleId; + @jakarta.annotation.Nullable private String bundleId; public static final String JSON_PROPERTY_PACKAGE_NAME = "package_name"; - @jakarta.annotation.Nullable - private String packageName; + @jakarta.annotation.Nullable private String packageName; public static final String JSON_PROPERTY_IP_ADDRESS = "ip_address"; - @jakarta.annotation.Nullable - private String ipAddress; + @jakarta.annotation.Nullable private String ipAddress; public static final String JSON_PROPERTY_USER_AGENT = "user_agent"; - @jakarta.annotation.Nullable - private String userAgent; + @jakarta.annotation.Nullable private String userAgent; public static final String JSON_PROPERTY_CLIENT_REFERRER = "client_referrer"; - @jakarta.annotation.Nullable - private String clientReferrer; + @jakarta.annotation.Nullable private String clientReferrer; public static final String JSON_PROPERTY_BROWSER_DETAILS = "browser_details"; - @jakarta.annotation.Nullable - private BrowserDetails browserDetails; + @jakarta.annotation.Nullable private BrowserDetails browserDetails; public static final String JSON_PROPERTY_PROXIMITY = "proximity"; - @jakarta.annotation.Nullable - private Proximity proximity; + @jakarta.annotation.Nullable private Proximity proximity; public static final String JSON_PROPERTY_BOT = "bot"; - @jakarta.annotation.Nullable - private BotResult bot; + @jakarta.annotation.Nullable private BotResult bot; public static final String JSON_PROPERTY_BOT_TYPE = "bot_type"; - @jakarta.annotation.Nullable - private String botType; + @jakarta.annotation.Nullable private String botType; public static final String JSON_PROPERTY_BOT_INFO = "bot_info"; - @jakarta.annotation.Nullable - private BotInfo botInfo; + @jakarta.annotation.Nullable private BotInfo botInfo; public static final String JSON_PROPERTY_CLONED_APP = "cloned_app"; - @jakarta.annotation.Nullable - private Boolean clonedApp; + @jakarta.annotation.Nullable private Boolean clonedApp; public static final String JSON_PROPERTY_DEVELOPER_TOOLS = "developer_tools"; - @jakarta.annotation.Nullable - private Boolean developerTools; + @jakarta.annotation.Nullable private Boolean developerTools; public static final String JSON_PROPERTY_EMULATOR = "emulator"; - @jakarta.annotation.Nullable - private Boolean emulator; + @jakarta.annotation.Nullable private Boolean emulator; public static final String JSON_PROPERTY_FACTORY_RESET_TIMESTAMP = "factory_reset_timestamp"; - @jakarta.annotation.Nullable - private Long factoryResetTimestamp; + @jakarta.annotation.Nullable private Long factoryResetTimestamp; public static final String JSON_PROPERTY_FRIDA = "frida"; - @jakarta.annotation.Nullable - private Boolean frida; + @jakarta.annotation.Nullable private Boolean frida; public static final String JSON_PROPERTY_IP_BLOCKLIST = "ip_blocklist"; - @jakarta.annotation.Nullable - private IPBlockList ipBlocklist; + @jakarta.annotation.Nullable private IPBlockList ipBlocklist; public static final String JSON_PROPERTY_IP_INFO = "ip_info"; - @jakarta.annotation.Nullable - private IPInfo ipInfo; + @jakarta.annotation.Nullable private IPInfo ipInfo; public static final String JSON_PROPERTY_PROXY = "proxy"; - @jakarta.annotation.Nullable - private Boolean proxy; + @jakarta.annotation.Nullable private Boolean proxy; public static final String JSON_PROPERTY_PROXY_CONFIDENCE = "proxy_confidence"; - @jakarta.annotation.Nullable - private ProxyConfidence proxyConfidence; + @jakarta.annotation.Nullable private ProxyConfidence proxyConfidence; public static final String JSON_PROPERTY_PROXY_DETAILS = "proxy_details"; - @jakarta.annotation.Nullable - private ProxyDetails proxyDetails; + @jakarta.annotation.Nullable private ProxyDetails proxyDetails; public static final String JSON_PROPERTY_INCOGNITO = "incognito"; - @jakarta.annotation.Nullable - private Boolean incognito; + @jakarta.annotation.Nullable private Boolean incognito; public static final String JSON_PROPERTY_JAILBROKEN = "jailbroken"; - @jakarta.annotation.Nullable - private Boolean jailbroken; + @jakarta.annotation.Nullable private Boolean jailbroken; public static final String JSON_PROPERTY_LOCATION_SPOOFING = "location_spoofing"; - @jakarta.annotation.Nullable - private Boolean locationSpoofing; + @jakarta.annotation.Nullable private Boolean locationSpoofing; public static final String JSON_PROPERTY_MITM_ATTACK = "mitm_attack"; - @jakarta.annotation.Nullable - private Boolean mitmAttack; + @jakarta.annotation.Nullable private Boolean mitmAttack; public static final String JSON_PROPERTY_PRIVACY_SETTINGS = "privacy_settings"; - @jakarta.annotation.Nullable - private Boolean privacySettings; + @jakarta.annotation.Nullable private Boolean privacySettings; public static final String JSON_PROPERTY_ROOT_APPS = "root_apps"; - @jakarta.annotation.Nullable - private Boolean rootApps; + @jakarta.annotation.Nullable private Boolean rootApps; public static final String JSON_PROPERTY_RULE_ACTION = "rule_action"; - @jakarta.annotation.Nullable - private EventRuleAction ruleAction; + @jakarta.annotation.Nullable private EventRuleAction ruleAction; public static final String JSON_PROPERTY_SUSPECT_SCORE = "suspect_score"; - @jakarta.annotation.Nullable - private Integer suspectScore; + @jakarta.annotation.Nullable private Integer suspectScore; public static final String JSON_PROPERTY_TAMPERING = "tampering"; - @jakarta.annotation.Nullable - private Boolean tampering; + @jakarta.annotation.Nullable private Boolean tampering; public static final String JSON_PROPERTY_TAMPERING_DETAILS = "tampering_details"; - @jakarta.annotation.Nullable - private TamperingDetails tamperingDetails; + @jakarta.annotation.Nullable private TamperingDetails tamperingDetails; public static final String JSON_PROPERTY_VELOCITY = "velocity"; - @jakarta.annotation.Nullable - private Velocity velocity; + @jakarta.annotation.Nullable private Velocity velocity; public static final String JSON_PROPERTY_VIRTUAL_MACHINE = "virtual_machine"; - @jakarta.annotation.Nullable - private Boolean virtualMachine; + @jakarta.annotation.Nullable private Boolean virtualMachine; public static final String JSON_PROPERTY_VPN = "vpn"; - @jakarta.annotation.Nullable - private Boolean vpn; + @jakarta.annotation.Nullable private Boolean vpn; public static final String JSON_PROPERTY_VPN_CONFIDENCE = "vpn_confidence"; - @jakarta.annotation.Nullable - private VpnConfidence vpnConfidence; + @jakarta.annotation.Nullable private VpnConfidence vpnConfidence; public static final String JSON_PROPERTY_VPN_ORIGIN_TIMEZONE = "vpn_origin_timezone"; - @jakarta.annotation.Nullable - private String vpnOriginTimezone; + @jakarta.annotation.Nullable private String vpnOriginTimezone; public static final String JSON_PROPERTY_VPN_ORIGIN_COUNTRY = "vpn_origin_country"; - @jakarta.annotation.Nullable - private String vpnOriginCountry; + @jakarta.annotation.Nullable private String vpnOriginCountry; public static final String JSON_PROPERTY_VPN_METHODS = "vpn_methods"; - @jakarta.annotation.Nullable - private VpnMethods vpnMethods; + @jakarta.annotation.Nullable private VpnMethods vpnMethods; public static final String JSON_PROPERTY_HIGH_ACTIVITY_DEVICE = "high_activity_device"; - @jakarta.annotation.Nullable - private Boolean highActivityDevice; + @jakarta.annotation.Nullable private Boolean highActivityDevice; public static final String JSON_PROPERTY_RAW_DEVICE_ATTRIBUTES = "raw_device_attributes"; - @jakarta.annotation.Nullable - private RawDeviceAttributes rawDeviceAttributes; + @jakarta.annotation.Nullable private RawDeviceAttributes rawDeviceAttributes; - public Event() { - } + public Event() {} public Event eventId(@jakarta.annotation.Nonnull String eventId) { this.eventId = eventId; @@ -310,25 +237,22 @@ public Event eventId(@jakarta.annotation.Nonnull String eventId) { } /** - * Unique identifier of the user's request. The first portion of the event_id is a unix epoch milliseconds timestamp For example: `1758130560902.8tRtrH` + * Unique identifier of the user's request. The first portion of the event_id is a unix epoch milliseconds timestamp For example: `1758130560902.8tRtrH` * @return eventId */ @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_EVENT_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getEventId() { return eventId; } - @JsonProperty(value = JSON_PROPERTY_EVENT_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setEventId(@jakarta.annotation.Nonnull String eventId) { this.eventId = eventId; } - public Event timestamp(@jakarta.annotation.Nonnull Long timestamp) { this.timestamp = timestamp; return this; @@ -341,19 +265,16 @@ public Event timestamp(@jakarta.annotation.Nonnull Long timestamp) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_TIMESTAMP, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Long getTimestamp() { return timestamp; } - @JsonProperty(value = JSON_PROPERTY_TIMESTAMP, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setTimestamp(@jakarta.annotation.Nonnull Long timestamp) { this.timestamp = timestamp; } - public Event linkedId(@jakarta.annotation.Nullable String linkedId) { this.linkedId = linkedId; return this; @@ -366,69 +287,60 @@ public Event linkedId(@jakarta.annotation.Nullable String linkedId) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_LINKED_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLinkedId() { return linkedId; } - @JsonProperty(value = JSON_PROPERTY_LINKED_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLinkedId(@jakarta.annotation.Nullable String linkedId) { this.linkedId = linkedId; } - public Event environmentId(@jakarta.annotation.Nullable String environmentId) { this.environmentId = environmentId; return this; } /** - * Environment Id of the event. For example: `ae_47abaca3db2c7c43` + * Environment Id of the event. For example: `ae_47abaca3db2c7c43` * @return environmentId */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ENVIRONMENT_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getEnvironmentId() { return environmentId; } - @JsonProperty(value = JSON_PROPERTY_ENVIRONMENT_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEnvironmentId(@jakarta.annotation.Nullable String environmentId) { this.environmentId = environmentId; } - public Event suspect(@jakarta.annotation.Nullable Boolean suspect) { this.suspect = suspect; return this; } /** - * Field is `true` if you have previously set the `suspect` flag for this event using the [Server API Update event endpoint](https://dev.fingerprint.com/reference/updateevent). + * 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). * @return suspect */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SUSPECT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getSuspect() { return suspect; } - @JsonProperty(value = JSON_PROPERTY_SUSPECT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSuspect(@jakarta.annotation.Nullable Boolean suspect) { this.suspect = suspect; } - public Event sdk(@jakarta.annotation.Nullable SDK sdk) { this.sdk = sdk; return this; @@ -441,44 +353,38 @@ public Event sdk(@jakarta.annotation.Nullable SDK sdk) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SDK, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SDK getSdk() { return sdk; } - @JsonProperty(value = JSON_PROPERTY_SDK, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSdk(@jakarta.annotation.Nullable SDK sdk) { this.sdk = sdk; } - public Event replayed(@jakarta.annotation.Nullable Boolean replayed) { this.replayed = replayed; return this; } /** - * `true` if we determined that this payload was replayed, `false` otherwise. + * `true` if we determined that this payload was replayed, `false` otherwise. * @return replayed */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_REPLAYED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getReplayed() { return replayed; } - @JsonProperty(value = JSON_PROPERTY_REPLAYED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setReplayed(@jakarta.annotation.Nullable Boolean replayed) { this.replayed = replayed; } - public Event identification(@jakarta.annotation.Nullable Identification identification) { this.identification = identification; return this; @@ -491,20 +397,18 @@ public Event identification(@jakarta.annotation.Nullable Identification identifi @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_IDENTIFICATION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Identification getIdentification() { return identification; } - @JsonProperty(value = JSON_PROPERTY_IDENTIFICATION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIdentification(@jakarta.annotation.Nullable Identification identification) { this.identification = identification; } - - public Event supplementaryIdHighRecall(@jakarta.annotation.Nullable SupplementaryIDHighRecall supplementaryIdHighRecall) { + public Event supplementaryIdHighRecall( + @jakarta.annotation.Nullable SupplementaryIDHighRecall supplementaryIdHighRecall) { this.supplementaryIdHighRecall = supplementaryIdHighRecall; return this; } @@ -516,119 +420,113 @@ public Event supplementaryIdHighRecall(@jakarta.annotation.Nullable Supplementar @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SUPPLEMENTARY_ID_HIGH_RECALL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public SupplementaryIDHighRecall getSupplementaryIdHighRecall() { return supplementaryIdHighRecall; } - @JsonProperty(value = JSON_PROPERTY_SUPPLEMENTARY_ID_HIGH_RECALL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSupplementaryIdHighRecall(@jakarta.annotation.Nullable SupplementaryIDHighRecall supplementaryIdHighRecall) { + public void setSupplementaryIdHighRecall( + @jakarta.annotation.Nullable SupplementaryIDHighRecall supplementaryIdHighRecall) { this.supplementaryIdHighRecall = supplementaryIdHighRecall; } - - public Event tags(@jakarta.annotation.Nullable Object tags) { + public Event tags(@jakarta.annotation.Nullable Map tags) { this.tags = tags; return this; } + public Event putTagsItem(String key, Object tagsItem) { + if (this.tags == null) { + this.tags = new HashMap<>(); + } + this.tags.put(key, tagsItem); + return this; + } + /** * A customer-provided value or an object that was sent with the identification request or updated later. * @return tags */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Object getTags() { + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getTags() { return tags; } - @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTags(@jakarta.annotation.Nullable Object tags) { + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(@jakarta.annotation.Nullable Map tags) { this.tags = tags; } - public Event url(@jakarta.annotation.Nullable String url) { this.url = url; return this; } /** - * Page URL from which the request was sent. For example `https://example.com/` + * Page URL from which the request was sent. For example `https://example.com/` * @return url */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_URL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getUrl() { return url; } - @JsonProperty(value = JSON_PROPERTY_URL, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUrl(@jakarta.annotation.Nullable String url) { this.url = url; } - public Event bundleId(@jakarta.annotation.Nullable String bundleId) { this.bundleId = bundleId; return this; } /** - * Bundle Id of the iOS application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` + * Bundle Id of the iOS application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` * @return bundleId */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BUNDLE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBundleId() { return bundleId; } - @JsonProperty(value = JSON_PROPERTY_BUNDLE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBundleId(@jakarta.annotation.Nullable String bundleId) { this.bundleId = bundleId; } - public Event packageName(@jakarta.annotation.Nullable String packageName) { this.packageName = packageName; return this; } /** - * Package name of the Android application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` + * Package name of the Android application integrated with the Fingerprint SDK for the event. For example: `com.foo.app` * @return packageName */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PACKAGE_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPackageName() { return packageName; } - @JsonProperty(value = JSON_PROPERTY_PACKAGE_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPackageName(@jakarta.annotation.Nullable String packageName) { this.packageName = packageName; } - public Event ipAddress(@jakarta.annotation.Nullable String ipAddress) { this.ipAddress = ipAddress; return this; @@ -641,69 +539,60 @@ public Event ipAddress(@jakarta.annotation.Nullable String ipAddress) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_IP_ADDRESS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getIpAddress() { return ipAddress; } - @JsonProperty(value = JSON_PROPERTY_IP_ADDRESS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIpAddress(@jakarta.annotation.Nullable String ipAddress) { this.ipAddress = ipAddress; } - public Event userAgent(@jakarta.annotation.Nullable String userAgent) { this.userAgent = userAgent; return this; } /** - * User Agent of the client, for example: `Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....` + * User Agent of the client, for example: `Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....` * @return userAgent */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_USER_AGENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getUserAgent() { return userAgent; } - @JsonProperty(value = JSON_PROPERTY_USER_AGENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setUserAgent(@jakarta.annotation.Nullable String userAgent) { this.userAgent = userAgent; } - public Event clientReferrer(@jakarta.annotation.Nullable String clientReferrer) { this.clientReferrer = clientReferrer; return this; } /** - * Client Referrer field corresponds to the `document.referrer` field gathered during an identification request. The value is an empty string if the user navigated to the page directly (not through a link, but, for example, by using a bookmark) For example: `https://example.com/blog/my-article` + * Client Referrer field corresponds to the `document.referrer` field gathered during an identification request. The value is an empty string if the user navigated to the page directly (not through a link, but, for example, by using a bookmark) For example: `https://example.com/blog/my-article` * @return clientReferrer */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CLIENT_REFERRER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getClientReferrer() { return clientReferrer; } - @JsonProperty(value = JSON_PROPERTY_CLIENT_REFERRER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClientReferrer(@jakarta.annotation.Nullable String clientReferrer) { this.clientReferrer = clientReferrer; } - public Event browserDetails(@jakarta.annotation.Nullable BrowserDetails browserDetails) { this.browserDetails = browserDetails; return this; @@ -716,19 +605,16 @@ public Event browserDetails(@jakarta.annotation.Nullable BrowserDetails browserD @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BROWSER_DETAILS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BrowserDetails getBrowserDetails() { return browserDetails; } - @JsonProperty(value = JSON_PROPERTY_BROWSER_DETAILS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBrowserDetails(@jakarta.annotation.Nullable BrowserDetails browserDetails) { this.browserDetails = browserDetails; } - public Event proximity(@jakarta.annotation.Nullable Proximity proximity) { this.proximity = proximity; return this; @@ -741,19 +627,16 @@ public Event proximity(@jakarta.annotation.Nullable Proximity proximity) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PROXIMITY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Proximity getProximity() { return proximity; } - @JsonProperty(value = JSON_PROPERTY_PROXIMITY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProximity(@jakarta.annotation.Nullable Proximity proximity) { this.proximity = proximity; } - public Event bot(@jakarta.annotation.Nullable BotResult bot) { this.bot = bot; return this; @@ -766,44 +649,38 @@ public Event bot(@jakarta.annotation.Nullable BotResult bot) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BOT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BotResult getBot() { return bot; } - @JsonProperty(value = JSON_PROPERTY_BOT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBot(@jakarta.annotation.Nullable BotResult bot) { this.bot = bot; } - public Event botType(@jakarta.annotation.Nullable String botType) { this.botType = botType; return this; } /** - * Additional classification of the bot type if detected. + * Additional classification of the bot type if detected. * @return botType */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BOT_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBotType() { return botType; } - @JsonProperty(value = JSON_PROPERTY_BOT_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBotType(@jakarta.annotation.Nullable String botType) { this.botType = botType; } - public Event botInfo(@jakarta.annotation.Nullable BotInfo botInfo) { this.botInfo = botInfo; return this; @@ -816,144 +693,126 @@ public Event botInfo(@jakarta.annotation.Nullable BotInfo botInfo) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BOT_INFO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public BotInfo getBotInfo() { return botInfo; } - @JsonProperty(value = JSON_PROPERTY_BOT_INFO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBotInfo(@jakarta.annotation.Nullable BotInfo botInfo) { this.botInfo = botInfo; } - public Event clonedApp(@jakarta.annotation.Nullable Boolean clonedApp) { this.clonedApp = clonedApp; return this; } /** - * 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. + * 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. * @return clonedApp */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CLONED_APP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getClonedApp() { return clonedApp; } - @JsonProperty(value = JSON_PROPERTY_CLONED_APP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setClonedApp(@jakarta.annotation.Nullable Boolean clonedApp) { this.clonedApp = clonedApp; } - public Event developerTools(@jakarta.annotation.Nullable Boolean developerTools) { this.developerTools = developerTools; return this; } /** - * `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. + * `true` if the browser is Chrome with DevTools open or Firefox with Developer Tools open, `false` otherwise. * @return developerTools */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DEVELOPER_TOOLS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getDeveloperTools() { return developerTools; } - @JsonProperty(value = JSON_PROPERTY_DEVELOPER_TOOLS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeveloperTools(@jakarta.annotation.Nullable Boolean developerTools) { this.developerTools = developerTools; } - public Event emulator(@jakarta.annotation.Nullable Boolean emulator) { this.emulator = emulator; return this; } /** - * 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. + * 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. * @return emulator */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_EMULATOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getEmulator() { return emulator; } - @JsonProperty(value = JSON_PROPERTY_EMULATOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmulator(@jakarta.annotation.Nullable Boolean emulator) { this.emulator = emulator; } - public Event factoryResetTimestamp(@jakarta.annotation.Nullable Long factoryResetTimestamp) { this.factoryResetTimestamp = factoryResetTimestamp; return this; } /** - * 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://dev.fingerprint.com/docs/smart-signals-overview#factory-reset-detection) to learn more about this Smart Signal. + * 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. * @return factoryResetTimestamp */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FACTORY_RESET_TIMESTAMP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getFactoryResetTimestamp() { return factoryResetTimestamp; } - @JsonProperty(value = JSON_PROPERTY_FACTORY_RESET_TIMESTAMP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFactoryResetTimestamp(@jakarta.annotation.Nullable Long factoryResetTimestamp) { this.factoryResetTimestamp = factoryResetTimestamp; } - public Event frida(@jakarta.annotation.Nullable Boolean frida) { this.frida = frida; return this; } /** - * [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. + * [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. * @return frida */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FRIDA, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getFrida() { return frida; } - @JsonProperty(value = JSON_PROPERTY_FRIDA, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFrida(@jakarta.annotation.Nullable Boolean frida) { this.frida = frida; } - public Event ipBlocklist(@jakarta.annotation.Nullable IPBlockList ipBlocklist) { this.ipBlocklist = ipBlocklist; return this; @@ -966,19 +825,16 @@ public Event ipBlocklist(@jakarta.annotation.Nullable IPBlockList ipBlocklist) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_IP_BLOCKLIST, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public IPBlockList getIpBlocklist() { return ipBlocklist; } - @JsonProperty(value = JSON_PROPERTY_IP_BLOCKLIST, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIpBlocklist(@jakarta.annotation.Nullable IPBlockList ipBlocklist) { this.ipBlocklist = ipBlocklist; } - public Event ipInfo(@jakarta.annotation.Nullable IPInfo ipInfo) { this.ipInfo = ipInfo; return this; @@ -991,44 +847,38 @@ public Event ipInfo(@jakarta.annotation.Nullable IPInfo ipInfo) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_IP_INFO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public IPInfo getIpInfo() { return ipInfo; } - @JsonProperty(value = JSON_PROPERTY_IP_INFO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIpInfo(@jakarta.annotation.Nullable IPInfo ipInfo) { this.ipInfo = ipInfo; } - public Event proxy(@jakarta.annotation.Nullable Boolean proxy) { this.proxy = proxy; return this; } /** - * IP address was used by a public proxy provider or belonged to a known recent residential proxy + * IP address was used by a public proxy provider or belonged to a known recent residential proxy * @return proxy */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PROXY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getProxy() { return proxy; } - @JsonProperty(value = JSON_PROPERTY_PROXY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProxy(@jakarta.annotation.Nullable Boolean proxy) { this.proxy = proxy; } - public Event proxyConfidence(@jakarta.annotation.Nullable ProxyConfidence proxyConfidence) { this.proxyConfidence = proxyConfidence; return this; @@ -1041,19 +891,16 @@ public Event proxyConfidence(@jakarta.annotation.Nullable ProxyConfidence proxyC @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PROXY_CONFIDENCE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ProxyConfidence getProxyConfidence() { return proxyConfidence; } - @JsonProperty(value = JSON_PROPERTY_PROXY_CONFIDENCE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProxyConfidence(@jakarta.annotation.Nullable ProxyConfidence proxyConfidence) { this.proxyConfidence = proxyConfidence; } - public Event proxyDetails(@jakarta.annotation.Nullable ProxyDetails proxyDetails) { this.proxyDetails = proxyDetails; return this; @@ -1066,69 +913,60 @@ public Event proxyDetails(@jakarta.annotation.Nullable ProxyDetails proxyDetails @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PROXY_DETAILS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public ProxyDetails getProxyDetails() { return proxyDetails; } - @JsonProperty(value = JSON_PROPERTY_PROXY_DETAILS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProxyDetails(@jakarta.annotation.Nullable ProxyDetails proxyDetails) { this.proxyDetails = proxyDetails; } - public Event incognito(@jakarta.annotation.Nullable Boolean incognito) { this.incognito = incognito; return this; } /** - * `true` if we detected incognito mode used in the browser, `false` otherwise. + * `true` if we detected incognito mode used in the browser, `false` otherwise. * @return incognito */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_INCOGNITO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIncognito() { return incognito; } - @JsonProperty(value = JSON_PROPERTY_INCOGNITO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIncognito(@jakarta.annotation.Nullable Boolean incognito) { this.incognito = incognito; } - public Event jailbroken(@jakarta.annotation.Nullable Boolean jailbroken) { this.jailbroken = jailbroken; return this; } /** - * iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. + * iOS specific jailbreak detection. There are 2 values: * `true` - Jailbreak detected. * `false` - No signs of jailbreak or the client is not iOS. * @return jailbroken */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_JAILBROKEN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getJailbroken() { return jailbroken; } - @JsonProperty(value = JSON_PROPERTY_JAILBROKEN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setJailbroken(@jakarta.annotation.Nullable Boolean jailbroken) { this.jailbroken = jailbroken; } - public Event locationSpoofing(@jakarta.annotation.Nullable Boolean locationSpoofing) { this.locationSpoofing = locationSpoofing; return this; @@ -1141,94 +979,82 @@ public Event locationSpoofing(@jakarta.annotation.Nullable Boolean locationSpoof @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_LOCATION_SPOOFING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getLocationSpoofing() { return locationSpoofing; } - @JsonProperty(value = JSON_PROPERTY_LOCATION_SPOOFING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLocationSpoofing(@jakarta.annotation.Nullable Boolean locationSpoofing) { this.locationSpoofing = locationSpoofing; } - public Event mitmAttack(@jakarta.annotation.Nullable Boolean mitmAttack) { this.mitmAttack = mitmAttack; return this; } /** - * * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://dev.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. + * * `true` - When requests made from your users' mobile devices to Fingerprint servers have been intercepted and potentially modified. * `false` - Otherwise or when the request originated from a browser. See [MitM Attack Detection](https://docs.fingerprint.com/docs/smart-signals-reference#mitm-attack-detection) to learn more about this Smart Signal. * @return mitmAttack */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MITM_ATTACK, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getMitmAttack() { return mitmAttack; } - @JsonProperty(value = JSON_PROPERTY_MITM_ATTACK, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMitmAttack(@jakarta.annotation.Nullable Boolean mitmAttack) { this.mitmAttack = mitmAttack; } - public Event privacySettings(@jakarta.annotation.Nullable Boolean privacySettings) { this.privacySettings = privacySettings; return this; } /** - * `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. + * `true` if the request is from a privacy aware browser (e.g. Tor) or from a browser in which fingerprinting is blocked. Otherwise `false`. * @return privacySettings */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PRIVACY_SETTINGS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPrivacySettings() { return privacySettings; } - @JsonProperty(value = JSON_PROPERTY_PRIVACY_SETTINGS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPrivacySettings(@jakarta.annotation.Nullable Boolean privacySettings) { this.privacySettings = privacySettings; } - public Event rootApps(@jakarta.annotation.Nullable Boolean rootApps) { this.rootApps = rootApps; return this; } /** - * Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. + * Android specific root management apps detection. There are 2 values: * `true` - Root Management Apps detected (e.g. Magisk). * `false` - No Root Management Apps detected or the client isn't Android. * @return rootApps */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ROOT_APPS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getRootApps() { return rootApps; } - @JsonProperty(value = JSON_PROPERTY_ROOT_APPS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRootApps(@jakarta.annotation.Nullable Boolean rootApps) { this.rootApps = rootApps; } - public Event ruleAction(@jakarta.annotation.Nullable EventRuleAction ruleAction) { this.ruleAction = ruleAction; return this; @@ -1241,69 +1067,60 @@ public Event ruleAction(@jakarta.annotation.Nullable EventRuleAction ruleAction) @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_RULE_ACTION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public EventRuleAction getRuleAction() { return ruleAction; } - @JsonProperty(value = JSON_PROPERTY_RULE_ACTION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRuleAction(@jakarta.annotation.Nullable EventRuleAction ruleAction) { this.ruleAction = ruleAction; } - public Event suspectScore(@jakarta.annotation.Nullable Integer suspectScore) { this.suspectScore = suspectScore; return this; } /** - * Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://dev.fingerprint.com/docs/suspect-score + * Suspect Score is an easy way to integrate Smart Signals into your fraud protection work flow. It is a weighted representation of all Smart Signals present in the payload that helps identify suspicious activity. The value range is [0; S] where S is sum of all Smart Signals weights. See more details here: https://docs.fingerprint.com/docs/suspect-score * @return suspectScore */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SUSPECT_SCORE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getSuspectScore() { return suspectScore; } - @JsonProperty(value = JSON_PROPERTY_SUSPECT_SCORE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSuspectScore(@jakarta.annotation.Nullable Integer suspectScore) { this.suspectScore = suspectScore; } - public Event tampering(@jakarta.annotation.Nullable Boolean tampering) { this.tampering = tampering; return this; } /** - * Flag indicating browser tampering was detected. This happens when either: * There are inconsistencies in the browser configuration that cross internal tampering thresholds (see `tampering_details.anomaly_score`). * The browser signature resembles an \"anti-detect\" browser specifically designed to evade fingerprinting (see `tampering_details.anti_detect_browser`). + * Flag indicating browser tampering was detected. This happens when either: * There are inconsistencies in the browser configuration that cross internal tampering thresholds (see `tampering_details.anomaly_score`). * The browser signature resembles an \"anti-detect\" browser specifically designed to evade fingerprinting (see `tampering_details.anti_detect_browser`). * @return tampering */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TAMPERING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTampering() { return tampering; } - @JsonProperty(value = JSON_PROPERTY_TAMPERING, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTampering(@jakarta.annotation.Nullable Boolean tampering) { this.tampering = tampering; } - public Event tamperingDetails(@jakarta.annotation.Nullable TamperingDetails tamperingDetails) { this.tamperingDetails = tamperingDetails; return this; @@ -1316,19 +1133,16 @@ public Event tamperingDetails(@jakarta.annotation.Nullable TamperingDetails tamp @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TAMPERING_DETAILS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TamperingDetails getTamperingDetails() { return tamperingDetails; } - @JsonProperty(value = JSON_PROPERTY_TAMPERING_DETAILS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTamperingDetails(@jakarta.annotation.Nullable TamperingDetails tamperingDetails) { this.tamperingDetails = tamperingDetails; } - public Event velocity(@jakarta.annotation.Nullable Velocity velocity) { this.velocity = velocity; return this; @@ -1341,69 +1155,60 @@ public Event velocity(@jakarta.annotation.Nullable Velocity velocity) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_VELOCITY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Velocity getVelocity() { return velocity; } - @JsonProperty(value = JSON_PROPERTY_VELOCITY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVelocity(@jakarta.annotation.Nullable Velocity velocity) { this.velocity = velocity; } - public Event virtualMachine(@jakarta.annotation.Nullable Boolean virtualMachine) { this.virtualMachine = virtualMachine; return this; } /** - * `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. + * `true` if the request came from a browser running inside a virtual machine (e.g. VMWare), `false` otherwise. * @return virtualMachine */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_VIRTUAL_MACHINE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getVirtualMachine() { return virtualMachine; } - @JsonProperty(value = JSON_PROPERTY_VIRTUAL_MACHINE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVirtualMachine(@jakarta.annotation.Nullable Boolean virtualMachine) { this.virtualMachine = virtualMachine; } - public Event vpn(@jakarta.annotation.Nullable Boolean vpn) { this.vpn = vpn; return this; } /** - * VPN or other anonymizing service has been used when sending the request. + * VPN or other anonymizing service has been used when sending the request. * @return vpn */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_VPN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getVpn() { return vpn; } - @JsonProperty(value = JSON_PROPERTY_VPN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVpn(@jakarta.annotation.Nullable Boolean vpn) { this.vpn = vpn; } - public Event vpnConfidence(@jakarta.annotation.Nullable VpnConfidence vpnConfidence) { this.vpnConfidence = vpnConfidence; return this; @@ -1416,69 +1221,60 @@ public Event vpnConfidence(@jakarta.annotation.Nullable VpnConfidence vpnConfide @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_VPN_CONFIDENCE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public VpnConfidence getVpnConfidence() { return vpnConfidence; } - @JsonProperty(value = JSON_PROPERTY_VPN_CONFIDENCE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVpnConfidence(@jakarta.annotation.Nullable VpnConfidence vpnConfidence) { this.vpnConfidence = vpnConfidence; } - public Event vpnOriginTimezone(@jakarta.annotation.Nullable String vpnOriginTimezone) { this.vpnOriginTimezone = vpnOriginTimezone; return this; } /** - * Local timezone which is used in timezone_mismatch method. + * Local timezone which is used in timezone_mismatch method. * @return vpnOriginTimezone */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_VPN_ORIGIN_TIMEZONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getVpnOriginTimezone() { return vpnOriginTimezone; } - @JsonProperty(value = JSON_PROPERTY_VPN_ORIGIN_TIMEZONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVpnOriginTimezone(@jakarta.annotation.Nullable String vpnOriginTimezone) { this.vpnOriginTimezone = vpnOriginTimezone; } - public Event vpnOriginCountry(@jakarta.annotation.Nullable String vpnOriginCountry) { this.vpnOriginCountry = vpnOriginCountry; return this; } /** - * Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). + * Country of the request (only for Android SDK version >= 2.4.0, ISO 3166 format or unknown). * @return vpnOriginCountry */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_VPN_ORIGIN_COUNTRY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getVpnOriginCountry() { return vpnOriginCountry; } - @JsonProperty(value = JSON_PROPERTY_VPN_ORIGIN_COUNTRY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVpnOriginCountry(@jakarta.annotation.Nullable String vpnOriginCountry) { this.vpnOriginCountry = vpnOriginCountry; } - public Event vpnMethods(@jakarta.annotation.Nullable VpnMethods vpnMethods) { this.vpnMethods = vpnMethods; return this; @@ -1491,19 +1287,16 @@ public Event vpnMethods(@jakarta.annotation.Nullable VpnMethods vpnMethods) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_VPN_METHODS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public VpnMethods getVpnMethods() { return vpnMethods; } - @JsonProperty(value = JSON_PROPERTY_VPN_METHODS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVpnMethods(@jakarta.annotation.Nullable VpnMethods vpnMethods) { this.vpnMethods = vpnMethods; } - public Event highActivityDevice(@jakarta.annotation.Nullable Boolean highActivityDevice) { this.highActivityDevice = highActivityDevice; return this; @@ -1516,20 +1309,18 @@ public Event highActivityDevice(@jakarta.annotation.Nullable Boolean highActivit @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_HIGH_ACTIVITY_DEVICE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getHighActivityDevice() { return highActivityDevice; } - @JsonProperty(value = JSON_PROPERTY_HIGH_ACTIVITY_DEVICE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHighActivityDevice(@jakarta.annotation.Nullable Boolean highActivityDevice) { this.highActivityDevice = highActivityDevice; } - - public Event rawDeviceAttributes(@jakarta.annotation.Nullable RawDeviceAttributes rawDeviceAttributes) { + public Event rawDeviceAttributes( + @jakarta.annotation.Nullable RawDeviceAttributes rawDeviceAttributes) { this.rawDeviceAttributes = rawDeviceAttributes; return this; } @@ -1541,19 +1332,17 @@ public Event rawDeviceAttributes(@jakarta.annotation.Nullable RawDeviceAttribute @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_RAW_DEVICE_ATTRIBUTES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public RawDeviceAttributes getRawDeviceAttributes() { return rawDeviceAttributes; } - @JsonProperty(value = JSON_PROPERTY_RAW_DEVICE_ATTRIBUTES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRawDeviceAttributes(@jakarta.annotation.Nullable RawDeviceAttributes rawDeviceAttributes) { + public void setRawDeviceAttributes( + @jakarta.annotation.Nullable RawDeviceAttributes rawDeviceAttributes) { this.rawDeviceAttributes = rawDeviceAttributes; } - /** * Return true if this Event object is equal to o. */ @@ -1566,61 +1355,111 @@ public boolean equals(Object o) { return false; } Event event = (Event) o; - return Objects.equals(this.eventId, event.eventId) && - Objects.equals(this.timestamp, event.timestamp) && - Objects.equals(this.linkedId, event.linkedId) && - Objects.equals(this.environmentId, event.environmentId) && - Objects.equals(this.suspect, event.suspect) && - Objects.equals(this.sdk, event.sdk) && - Objects.equals(this.replayed, event.replayed) && - Objects.equals(this.identification, event.identification) && - Objects.equals(this.supplementaryIdHighRecall, event.supplementaryIdHighRecall) && - Objects.equals(this.tags, event.tags) && - Objects.equals(this.url, event.url) && - Objects.equals(this.bundleId, event.bundleId) && - Objects.equals(this.packageName, event.packageName) && - Objects.equals(this.ipAddress, event.ipAddress) && - Objects.equals(this.userAgent, event.userAgent) && - Objects.equals(this.clientReferrer, event.clientReferrer) && - Objects.equals(this.browserDetails, event.browserDetails) && - Objects.equals(this.proximity, event.proximity) && - Objects.equals(this.bot, event.bot) && - Objects.equals(this.botType, event.botType) && - Objects.equals(this.botInfo, event.botInfo) && - Objects.equals(this.clonedApp, event.clonedApp) && - Objects.equals(this.developerTools, event.developerTools) && - Objects.equals(this.emulator, event.emulator) && - Objects.equals(this.factoryResetTimestamp, event.factoryResetTimestamp) && - Objects.equals(this.frida, event.frida) && - Objects.equals(this.ipBlocklist, event.ipBlocklist) && - Objects.equals(this.ipInfo, event.ipInfo) && - Objects.equals(this.proxy, event.proxy) && - Objects.equals(this.proxyConfidence, event.proxyConfidence) && - Objects.equals(this.proxyDetails, event.proxyDetails) && - Objects.equals(this.incognito, event.incognito) && - Objects.equals(this.jailbroken, event.jailbroken) && - Objects.equals(this.locationSpoofing, event.locationSpoofing) && - Objects.equals(this.mitmAttack, event.mitmAttack) && - Objects.equals(this.privacySettings, event.privacySettings) && - Objects.equals(this.rootApps, event.rootApps) && - Objects.equals(this.ruleAction, event.ruleAction) && - Objects.equals(this.suspectScore, event.suspectScore) && - Objects.equals(this.tampering, event.tampering) && - Objects.equals(this.tamperingDetails, event.tamperingDetails) && - Objects.equals(this.velocity, event.velocity) && - Objects.equals(this.virtualMachine, event.virtualMachine) && - Objects.equals(this.vpn, event.vpn) && - Objects.equals(this.vpnConfidence, event.vpnConfidence) && - Objects.equals(this.vpnOriginTimezone, event.vpnOriginTimezone) && - Objects.equals(this.vpnOriginCountry, event.vpnOriginCountry) && - Objects.equals(this.vpnMethods, event.vpnMethods) && - Objects.equals(this.highActivityDevice, event.highActivityDevice) && - Objects.equals(this.rawDeviceAttributes, event.rawDeviceAttributes); + return Objects.equals(this.eventId, event.eventId) + && Objects.equals(this.timestamp, event.timestamp) + && Objects.equals(this.linkedId, event.linkedId) + && Objects.equals(this.environmentId, event.environmentId) + && Objects.equals(this.suspect, event.suspect) + && Objects.equals(this.sdk, event.sdk) + && Objects.equals(this.replayed, event.replayed) + && Objects.equals(this.identification, event.identification) + && Objects.equals(this.supplementaryIdHighRecall, event.supplementaryIdHighRecall) + && Objects.equals(this.tags, event.tags) + && Objects.equals(this.url, event.url) + && Objects.equals(this.bundleId, event.bundleId) + && Objects.equals(this.packageName, event.packageName) + && Objects.equals(this.ipAddress, event.ipAddress) + && Objects.equals(this.userAgent, event.userAgent) + && Objects.equals(this.clientReferrer, event.clientReferrer) + && Objects.equals(this.browserDetails, event.browserDetails) + && Objects.equals(this.proximity, event.proximity) + && Objects.equals(this.bot, event.bot) + && Objects.equals(this.botType, event.botType) + && Objects.equals(this.botInfo, event.botInfo) + && Objects.equals(this.clonedApp, event.clonedApp) + && Objects.equals(this.developerTools, event.developerTools) + && Objects.equals(this.emulator, event.emulator) + && Objects.equals(this.factoryResetTimestamp, event.factoryResetTimestamp) + && Objects.equals(this.frida, event.frida) + && Objects.equals(this.ipBlocklist, event.ipBlocklist) + && Objects.equals(this.ipInfo, event.ipInfo) + && Objects.equals(this.proxy, event.proxy) + && Objects.equals(this.proxyConfidence, event.proxyConfidence) + && Objects.equals(this.proxyDetails, event.proxyDetails) + && Objects.equals(this.incognito, event.incognito) + && Objects.equals(this.jailbroken, event.jailbroken) + && Objects.equals(this.locationSpoofing, event.locationSpoofing) + && Objects.equals(this.mitmAttack, event.mitmAttack) + && Objects.equals(this.privacySettings, event.privacySettings) + && Objects.equals(this.rootApps, event.rootApps) + && Objects.equals(this.ruleAction, event.ruleAction) + && Objects.equals(this.suspectScore, event.suspectScore) + && Objects.equals(this.tampering, event.tampering) + && Objects.equals(this.tamperingDetails, event.tamperingDetails) + && Objects.equals(this.velocity, event.velocity) + && Objects.equals(this.virtualMachine, event.virtualMachine) + && Objects.equals(this.vpn, event.vpn) + && Objects.equals(this.vpnConfidence, event.vpnConfidence) + && Objects.equals(this.vpnOriginTimezone, event.vpnOriginTimezone) + && Objects.equals(this.vpnOriginCountry, event.vpnOriginCountry) + && Objects.equals(this.vpnMethods, event.vpnMethods) + && Objects.equals(this.highActivityDevice, event.highActivityDevice) + && Objects.equals(this.rawDeviceAttributes, event.rawDeviceAttributes); } @Override public int hashCode() { - return Objects.hash(eventId, timestamp, linkedId, environmentId, suspect, sdk, replayed, identification, supplementaryIdHighRecall, tags, url, bundleId, packageName, ipAddress, userAgent, clientReferrer, browserDetails, proximity, bot, botType, botInfo, clonedApp, developerTools, emulator, factoryResetTimestamp, frida, ipBlocklist, ipInfo, proxy, proxyConfidence, proxyDetails, incognito, jailbroken, locationSpoofing, mitmAttack, privacySettings, rootApps, ruleAction, suspectScore, tampering, tamperingDetails, velocity, virtualMachine, vpn, vpnConfidence, vpnOriginTimezone, vpnOriginCountry, vpnMethods, highActivityDevice, rawDeviceAttributes); + return Objects.hash( + eventId, + timestamp, + linkedId, + environmentId, + suspect, + sdk, + replayed, + identification, + supplementaryIdHighRecall, + tags, + url, + bundleId, + packageName, + ipAddress, + userAgent, + clientReferrer, + browserDetails, + proximity, + bot, + botType, + botInfo, + clonedApp, + developerTools, + emulator, + factoryResetTimestamp, + frida, + ipBlocklist, + ipInfo, + proxy, + proxyConfidence, + proxyDetails, + incognito, + jailbroken, + locationSpoofing, + mitmAttack, + privacySettings, + rootApps, + ruleAction, + suspectScore, + tampering, + tamperingDetails, + velocity, + virtualMachine, + vpn, + vpnConfidence, + vpnOriginTimezone, + vpnOriginCountry, + vpnMethods, + highActivityDevice, + rawDeviceAttributes); } @Override @@ -1635,7 +1474,9 @@ public String toString() { sb.append(" sdk: ").append(toIndentedString(sdk)).append("\n"); sb.append(" replayed: ").append(toIndentedString(replayed)).append("\n"); sb.append(" identification: ").append(toIndentedString(identification)).append("\n"); - sb.append(" supplementaryIdHighRecall: ").append(toIndentedString(supplementaryIdHighRecall)).append("\n"); + sb.append(" supplementaryIdHighRecall: ") + .append(toIndentedString(supplementaryIdHighRecall)) + .append("\n"); sb.append(" tags: ").append(toIndentedString(tags)).append("\n"); sb.append(" url: ").append(toIndentedString(url)).append("\n"); sb.append(" bundleId: ").append(toIndentedString(bundleId)).append("\n"); @@ -1651,7 +1492,9 @@ public String toString() { sb.append(" clonedApp: ").append(toIndentedString(clonedApp)).append("\n"); sb.append(" developerTools: ").append(toIndentedString(developerTools)).append("\n"); sb.append(" emulator: ").append(toIndentedString(emulator)).append("\n"); - sb.append(" factoryResetTimestamp: ").append(toIndentedString(factoryResetTimestamp)).append("\n"); + sb.append(" factoryResetTimestamp: ") + .append(toIndentedString(factoryResetTimestamp)) + .append("\n"); sb.append(" frida: ").append(toIndentedString(frida)).append("\n"); sb.append(" ipBlocklist: ").append(toIndentedString(ipBlocklist)).append("\n"); sb.append(" ipInfo: ").append(toIndentedString(ipInfo)).append("\n"); @@ -1676,7 +1519,9 @@ public String toString() { sb.append(" vpnOriginCountry: ").append(toIndentedString(vpnOriginCountry)).append("\n"); sb.append(" vpnMethods: ").append(toIndentedString(vpnMethods)).append("\n"); sb.append(" highActivityDevice: ").append(toIndentedString(highActivityDevice)).append("\n"); - sb.append(" rawDeviceAttributes: ").append(toIndentedString(rawDeviceAttributes)).append("\n"); + sb.append(" rawDeviceAttributes: ") + .append(toIndentedString(rawDeviceAttributes)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -1691,6 +1536,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/EventRuleAction.java b/sdk/src/main/java/com/fingerprint/v4/model/EventRuleAction.java index 1172359f..481907c0 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/EventRuleAction.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/EventRuleAction.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,48 +10,25 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Map; -import java.util.HashMap; -import com.fasterxml.jackson.annotation.JsonAnyGetter; -import com.fasterxml.jackson.annotation.JsonAnySetter; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonSubTypes; import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.EventRuleActionAllow; -import com.fingerprint.v4.model.EventRuleActionBlock; -import com.fingerprint.v4.model.RequestHeaderModifications; -import com.fingerprint.v4.model.RuleActionHeaderField; -import com.fingerprint.v4.model.RuleActionType; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - -import com.fasterxml.jackson.core.type.TypeReference; - -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") + +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") @JsonTypeInfo( use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "type", - defaultImpl = EventRuleAction.UnknownEventRuleAction.class -) + defaultImpl = EventRuleAction.UnknownEventRuleAction.class, + visible = true) @JsonSubTypes({ - @JsonSubTypes.Type(value = EventRuleActionAllow.class, name = "allow"), - @JsonSubTypes.Type(value = EventRuleActionBlock.class, name = "block") + @JsonSubTypes.Type(value = EventRuleActionAllow.class, name = "allow"), + @JsonSubTypes.Type(value = EventRuleActionBlock.class, name = "block") }) public interface EventRuleAction { @@ -66,7 +43,6 @@ public interface EventRuleAction { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_RULESET_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - String getRulesetId(); @JsonProperty(value = JSON_PROPERTY_RULESET_ID, required = true) @@ -75,7 +51,6 @@ public interface EventRuleAction { EventRuleAction rulesetId(@jakarta.annotation.Nonnull String rulesetId); - /** * Get type * @return type @@ -83,7 +58,6 @@ public interface EventRuleAction { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - RuleActionType getType(); @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @@ -92,70 +66,62 @@ public interface EventRuleAction { EventRuleAction type(@jakarta.annotation.Nonnull RuleActionType type); - public static final class UnknownEventRuleAction implements EventRuleAction { public static final String JSON_PROPERTY_RULESET_ID = "ruleset_id"; - @jakarta.annotation.Nonnull - private String rulesetId; + @jakarta.annotation.Nonnull private String rulesetId; public static final String JSON_PROPERTY_TYPE = "type"; - // The discriminator does not have Nullability-annotation since it is added during serialization by the @JsonTypeName annotation + // The discriminator does not have Nullability-annotation since it is added during serialization + // by the @JsonTypeName annotation private RuleActionType type; - public UnknownEventRuleAction() { - } + public UnknownEventRuleAction() {} public EventRuleAction rulesetId(@jakarta.annotation.Nonnull String rulesetId) { - - this.rulesetId = rulesetId; - return this; + + this.rulesetId = rulesetId; + return this; } /** - * The ID of the evaluated ruleset. - * @return rulesetId - */ + * The ID of the evaluated ruleset. + * @return rulesetId + */ @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_RULESET_ID, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - + @JsonInclude(value = JsonInclude.Include.ALWAYS) public String getRulesetId() { - return rulesetId; + return rulesetId; } - @JsonProperty(value = JSON_PROPERTY_RULESET_ID, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setRulesetId(@jakarta.annotation.Nonnull String rulesetId) { - this.rulesetId = rulesetId; + this.rulesetId = rulesetId; } public EventRuleAction type(@jakarta.annotation.Nonnull RuleActionType type) { - - this.type = type; - return this; + + this.type = type; + return this; } /** - * Get type - * @return type - */ + * Get type + * @return type + */ @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) - + @JsonInclude(value = JsonInclude.Include.ALWAYS) public RuleActionType getType() { - return type; + return type; } - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) - @JsonInclude(value = JsonInclude.Include.ALWAYS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setType(@jakarta.annotation.Nonnull RuleActionType type) { - this.type = type; + this.type = type; } - } } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/EventRuleActionAllow.java b/sdk/src/main/java/com/fingerprint/v4/model/EventRuleActionAllow.java index 57a11faa..38e31a2d 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/EventRuleActionAllow.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/EventRuleActionAllow.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,29 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.RequestHeaderModifications; -import com.fingerprint.v4.model.RuleActionType; -import java.util.Arrays; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import java.util.ArrayList; -import java.util.List; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * Informs the client that the request should be forwarded to the origin with optional request header modifications. @@ -44,30 +27,27 @@ EventRuleActionAllow.JSON_PROPERTY_TYPE, EventRuleActionAllow.JSON_PROPERTY_REQUEST_HEADER_MODIFICATIONS }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class EventRuleActionAllow implements EventRuleAction { public static final String JSON_PROPERTY_RULESET_ID = "ruleset_id"; - @jakarta.annotation.Nonnull - private String rulesetId; + @jakarta.annotation.Nonnull private String rulesetId; public static final String JSON_PROPERTY_RULE_ID = "rule_id"; - @jakarta.annotation.Nullable - private String ruleId; + @jakarta.annotation.Nullable private String ruleId; public static final String JSON_PROPERTY_RULE_EXPRESSION = "rule_expression"; - @jakarta.annotation.Nullable - private String ruleExpression; + @jakarta.annotation.Nullable private String ruleExpression; public static final String JSON_PROPERTY_TYPE = "type"; - @jakarta.annotation.Nonnull - private RuleActionType type; + @jakarta.annotation.Nonnull private RuleActionType type; - public static final String JSON_PROPERTY_REQUEST_HEADER_MODIFICATIONS = "request_header_modifications"; - @jakarta.annotation.Nullable - private RequestHeaderModifications requestHeaderModifications; + public static final String JSON_PROPERTY_REQUEST_HEADER_MODIFICATIONS = + "request_header_modifications"; + @jakarta.annotation.Nullable private RequestHeaderModifications requestHeaderModifications; - public EventRuleActionAllow() { - } + public EventRuleActionAllow() {} public EventRuleActionAllow rulesetId(@jakarta.annotation.Nonnull String rulesetId) { this.rulesetId = rulesetId; @@ -81,19 +61,16 @@ public EventRuleActionAllow rulesetId(@jakarta.annotation.Nonnull String ruleset @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_RULESET_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getRulesetId() { return rulesetId; } - @JsonProperty(value = JSON_PROPERTY_RULESET_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setRulesetId(@jakarta.annotation.Nonnull String rulesetId) { this.rulesetId = rulesetId; } - public EventRuleActionAllow ruleId(@jakarta.annotation.Nullable String ruleId) { this.ruleId = ruleId; return this; @@ -106,19 +83,16 @@ public EventRuleActionAllow ruleId(@jakarta.annotation.Nullable String ruleId) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_RULE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRuleId() { return ruleId; } - @JsonProperty(value = JSON_PROPERTY_RULE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRuleId(@jakarta.annotation.Nullable String ruleId) { this.ruleId = ruleId; } - public EventRuleActionAllow ruleExpression(@jakarta.annotation.Nullable String ruleExpression) { this.ruleExpression = ruleExpression; return this; @@ -131,19 +105,16 @@ public EventRuleActionAllow ruleExpression(@jakarta.annotation.Nullable String r @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_RULE_EXPRESSION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRuleExpression() { return ruleExpression; } - @JsonProperty(value = JSON_PROPERTY_RULE_EXPRESSION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRuleExpression(@jakarta.annotation.Nullable String ruleExpression) { this.ruleExpression = ruleExpression; } - public EventRuleActionAllow type(@jakarta.annotation.Nonnull RuleActionType type) { this.type = type; return this; @@ -156,20 +127,18 @@ public EventRuleActionAllow type(@jakarta.annotation.Nonnull RuleActionType type @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public RuleActionType getType() { return type; } - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setType(@jakarta.annotation.Nonnull RuleActionType type) { this.type = type; } - - public EventRuleActionAllow requestHeaderModifications(@jakarta.annotation.Nullable RequestHeaderModifications requestHeaderModifications) { + public EventRuleActionAllow requestHeaderModifications( + @jakarta.annotation.Nullable RequestHeaderModifications requestHeaderModifications) { this.requestHeaderModifications = requestHeaderModifications; return this; } @@ -181,19 +150,17 @@ public EventRuleActionAllow requestHeaderModifications(@jakarta.annotation.Nulla @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_REQUEST_HEADER_MODIFICATIONS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public RequestHeaderModifications getRequestHeaderModifications() { return requestHeaderModifications; } - @JsonProperty(value = JSON_PROPERTY_REQUEST_HEADER_MODIFICATIONS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setRequestHeaderModifications(@jakarta.annotation.Nullable RequestHeaderModifications requestHeaderModifications) { + public void setRequestHeaderModifications( + @jakarta.annotation.Nullable RequestHeaderModifications requestHeaderModifications) { this.requestHeaderModifications = requestHeaderModifications; } - /** * Return true if this EventRuleActionAllow object is equal to o. */ @@ -206,11 +173,12 @@ public boolean equals(Object o) { return false; } EventRuleActionAllow eventRuleActionAllow = (EventRuleActionAllow) o; - return Objects.equals(this.rulesetId, eventRuleActionAllow.rulesetId) && - Objects.equals(this.ruleId, eventRuleActionAllow.ruleId) && - Objects.equals(this.ruleExpression, eventRuleActionAllow.ruleExpression) && - Objects.equals(this.type, eventRuleActionAllow.type) && - Objects.equals(this.requestHeaderModifications, eventRuleActionAllow.requestHeaderModifications); + return Objects.equals(this.rulesetId, eventRuleActionAllow.rulesetId) + && Objects.equals(this.ruleId, eventRuleActionAllow.ruleId) + && Objects.equals(this.ruleExpression, eventRuleActionAllow.ruleExpression) + && Objects.equals(this.type, eventRuleActionAllow.type) + && Objects.equals( + this.requestHeaderModifications, eventRuleActionAllow.requestHeaderModifications); } @Override @@ -226,7 +194,9 @@ public String toString() { sb.append(" ruleId: ").append(toIndentedString(ruleId)).append("\n"); sb.append(" ruleExpression: ").append(toIndentedString(ruleExpression)).append("\n"); sb.append(" type: ").append(toIndentedString(type)).append("\n"); - sb.append(" requestHeaderModifications: ").append(toIndentedString(requestHeaderModifications)).append("\n"); + sb.append(" requestHeaderModifications: ") + .append(toIndentedString(requestHeaderModifications)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -241,6 +211,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/EventRuleActionBlock.java b/sdk/src/main/java/com/fingerprint/v4/model/EventRuleActionBlock.java index 044ec4c4..47500110 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/EventRuleActionBlock.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/EventRuleActionBlock.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,29 +10,14 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.RuleActionHeaderField; -import com.fingerprint.v4.model.RuleActionType; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -import com.fasterxml.jackson.annotation.JsonIgnoreProperties; -import com.fasterxml.jackson.annotation.JsonSubTypes; -import com.fasterxml.jackson.annotation.JsonTypeInfo; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * Informs the client the request should be blocked using the response described by this rule action. @@ -46,38 +31,32 @@ EventRuleActionBlock.JSON_PROPERTY_HEADERS, EventRuleActionBlock.JSON_PROPERTY_BODY }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class EventRuleActionBlock implements EventRuleAction { public static final String JSON_PROPERTY_RULESET_ID = "ruleset_id"; - @jakarta.annotation.Nonnull - private String rulesetId; + @jakarta.annotation.Nonnull private String rulesetId; public static final String JSON_PROPERTY_RULE_ID = "rule_id"; - @jakarta.annotation.Nullable - private String ruleId; + @jakarta.annotation.Nullable private String ruleId; public static final String JSON_PROPERTY_RULE_EXPRESSION = "rule_expression"; - @jakarta.annotation.Nullable - private String ruleExpression; + @jakarta.annotation.Nullable private String ruleExpression; public static final String JSON_PROPERTY_TYPE = "type"; - @jakarta.annotation.Nonnull - private RuleActionType type; + @jakarta.annotation.Nonnull private RuleActionType type; public static final String JSON_PROPERTY_STATUS_CODE = "status_code"; - @jakarta.annotation.Nullable - private Integer statusCode; + @jakarta.annotation.Nullable private Integer statusCode; public static final String JSON_PROPERTY_HEADERS = "headers"; - @jakarta.annotation.Nullable - private List headers = new ArrayList<>(); + @jakarta.annotation.Nullable private List headers = new ArrayList<>(); public static final String JSON_PROPERTY_BODY = "body"; - @jakarta.annotation.Nullable - private String body; + @jakarta.annotation.Nullable private String body; - public EventRuleActionBlock() { - } + public EventRuleActionBlock() {} public EventRuleActionBlock rulesetId(@jakarta.annotation.Nonnull String rulesetId) { this.rulesetId = rulesetId; @@ -91,19 +70,16 @@ public EventRuleActionBlock rulesetId(@jakarta.annotation.Nonnull String ruleset @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_RULESET_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getRulesetId() { return rulesetId; } - @JsonProperty(value = JSON_PROPERTY_RULESET_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setRulesetId(@jakarta.annotation.Nonnull String rulesetId) { this.rulesetId = rulesetId; } - public EventRuleActionBlock ruleId(@jakarta.annotation.Nullable String ruleId) { this.ruleId = ruleId; return this; @@ -116,19 +92,16 @@ public EventRuleActionBlock ruleId(@jakarta.annotation.Nullable String ruleId) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_RULE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRuleId() { return ruleId; } - @JsonProperty(value = JSON_PROPERTY_RULE_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRuleId(@jakarta.annotation.Nullable String ruleId) { this.ruleId = ruleId; } - public EventRuleActionBlock ruleExpression(@jakarta.annotation.Nullable String ruleExpression) { this.ruleExpression = ruleExpression; return this; @@ -141,19 +114,16 @@ public EventRuleActionBlock ruleExpression(@jakarta.annotation.Nullable String r @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_RULE_EXPRESSION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRuleExpression() { return ruleExpression; } - @JsonProperty(value = JSON_PROPERTY_RULE_EXPRESSION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRuleExpression(@jakarta.annotation.Nullable String ruleExpression) { this.ruleExpression = ruleExpression; } - public EventRuleActionBlock type(@jakarta.annotation.Nonnull RuleActionType type) { this.type = type; return this; @@ -166,19 +136,16 @@ public EventRuleActionBlock type(@jakarta.annotation.Nonnull RuleActionType type @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public RuleActionType getType() { return type; } - @JsonProperty(value = JSON_PROPERTY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setType(@jakarta.annotation.Nonnull RuleActionType type) { this.type = type; } - public EventRuleActionBlock statusCode(@jakarta.annotation.Nullable Integer statusCode) { this.statusCode = statusCode; return this; @@ -191,20 +158,18 @@ public EventRuleActionBlock statusCode(@jakarta.annotation.Nullable Integer stat @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_STATUS_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getStatusCode() { return statusCode; } - @JsonProperty(value = JSON_PROPERTY_STATUS_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setStatusCode(@jakarta.annotation.Nullable Integer statusCode) { this.statusCode = statusCode; } - - public EventRuleActionBlock headers(@jakarta.annotation.Nullable List headers) { + public EventRuleActionBlock headers( + @jakarta.annotation.Nullable List headers) { this.headers = headers; return this; } @@ -224,19 +189,16 @@ public EventRuleActionBlock addHeadersItem(RuleActionHeaderField headersItem) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getHeaders() { return headers; } - @JsonProperty(value = JSON_PROPERTY_HEADERS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHeaders(@jakarta.annotation.Nullable List headers) { this.headers = headers; } - public EventRuleActionBlock body(@jakarta.annotation.Nullable String body) { this.body = body; return this; @@ -249,19 +211,16 @@ public EventRuleActionBlock body(@jakarta.annotation.Nullable String body) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_BODY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getBody() { return body; } - @JsonProperty(value = JSON_PROPERTY_BODY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setBody(@jakarta.annotation.Nullable String body) { this.body = body; } - /** * Return true if this EventRuleActionBlock object is equal to o. */ @@ -274,13 +233,13 @@ public boolean equals(Object o) { return false; } EventRuleActionBlock eventRuleActionBlock = (EventRuleActionBlock) o; - return Objects.equals(this.rulesetId, eventRuleActionBlock.rulesetId) && - Objects.equals(this.ruleId, eventRuleActionBlock.ruleId) && - Objects.equals(this.ruleExpression, eventRuleActionBlock.ruleExpression) && - Objects.equals(this.type, eventRuleActionBlock.type) && - Objects.equals(this.statusCode, eventRuleActionBlock.statusCode) && - Objects.equals(this.headers, eventRuleActionBlock.headers) && - Objects.equals(this.body, eventRuleActionBlock.body); + return Objects.equals(this.rulesetId, eventRuleActionBlock.rulesetId) + && Objects.equals(this.ruleId, eventRuleActionBlock.ruleId) + && Objects.equals(this.ruleExpression, eventRuleActionBlock.ruleExpression) + && Objects.equals(this.type, eventRuleActionBlock.type) + && Objects.equals(this.statusCode, eventRuleActionBlock.statusCode) + && Objects.equals(this.headers, eventRuleActionBlock.headers) + && Objects.equals(this.body, eventRuleActionBlock.body); } @Override @@ -313,6 +272,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/EventSearch.java b/sdk/src/main/java/com/fingerprint/v4/model/EventSearch.java index 1dd94ba3..46d334d3 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/EventSearch.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/EventSearch.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,25 +10,14 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.Event; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * Contains a list of all identification events matching the specified search criteria. @@ -38,22 +27,20 @@ EventSearch.JSON_PROPERTY_PAGINATION_KEY, EventSearch.JSON_PROPERTY_TOTAL_HITS }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class EventSearch { public static final String JSON_PROPERTY_EVENTS = "events"; - @jakarta.annotation.Nonnull - private List events = new ArrayList<>(); + @jakarta.annotation.Nonnull private List events = new ArrayList<>(); public static final String JSON_PROPERTY_PAGINATION_KEY = "pagination_key"; - @jakarta.annotation.Nullable - private String paginationKey; + @jakarta.annotation.Nullable private String paginationKey; public static final String JSON_PROPERTY_TOTAL_HITS = "total_hits"; - @jakarta.annotation.Nullable - private Long totalHits; + @jakarta.annotation.Nullable private Long totalHits; - public EventSearch() { - } + public EventSearch() {} public EventSearch events(@jakarta.annotation.Nonnull List events) { this.events = events; @@ -75,19 +62,16 @@ public EventSearch addEventsItem(Event eventsItem) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_EVENTS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public List getEvents() { return events; } - @JsonProperty(value = JSON_PROPERTY_EVENTS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setEvents(@jakarta.annotation.Nonnull List events) { this.events = events; } - public EventSearch paginationKey(@jakarta.annotation.Nullable String paginationKey) { this.paginationKey = paginationKey; return this; @@ -100,19 +84,16 @@ public EventSearch paginationKey(@jakarta.annotation.Nullable String paginationK @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PAGINATION_KEY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPaginationKey() { return paginationKey; } - @JsonProperty(value = JSON_PROPERTY_PAGINATION_KEY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPaginationKey(@jakarta.annotation.Nullable String paginationKey) { this.paginationKey = paginationKey; } - public EventSearch totalHits(@jakarta.annotation.Nullable Long totalHits) { this.totalHits = totalHits; return this; @@ -125,19 +106,16 @@ public EventSearch totalHits(@jakarta.annotation.Nullable Long totalHits) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TOTAL_HITS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getTotalHits() { return totalHits; } - @JsonProperty(value = JSON_PROPERTY_TOTAL_HITS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTotalHits(@jakarta.annotation.Nullable Long totalHits) { this.totalHits = totalHits; } - /** * Return true if this EventSearch object is equal to o. */ @@ -150,9 +128,9 @@ public boolean equals(Object o) { return false; } EventSearch eventSearch = (EventSearch) o; - return Objects.equals(this.events, eventSearch.events) && - Objects.equals(this.paginationKey, eventSearch.paginationKey) && - Objects.equals(this.totalHits, eventSearch.totalHits); + return Objects.equals(this.events, eventSearch.events) + && Objects.equals(this.paginationKey, eventSearch.paginationKey) + && Objects.equals(this.totalHits, eventSearch.totalHits); } @Override @@ -181,6 +159,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/EventUpdate.java b/sdk/src/main/java/com/fingerprint/v4/model/EventUpdate.java index 280d1f50..21f6d3e3 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/EventUpdate.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/EventUpdate.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,22 +10,14 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.HashMap; +import java.util.Map; +import java.util.Objects; /** * EventUpdate @@ -35,22 +27,20 @@ EventUpdate.JSON_PROPERTY_TAGS, EventUpdate.JSON_PROPERTY_SUSPECT }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class EventUpdate { public static final String JSON_PROPERTY_LINKED_ID = "linked_id"; - @jakarta.annotation.Nullable - private String linkedId; + @jakarta.annotation.Nullable private String linkedId; public static final String JSON_PROPERTY_TAGS = "tags"; - @jakarta.annotation.Nullable - private Object tags; + @jakarta.annotation.Nullable private Map tags = new HashMap<>(); public static final String JSON_PROPERTY_SUSPECT = "suspect"; - @jakarta.annotation.Nullable - private Boolean suspect; + @jakarta.annotation.Nullable private Boolean suspect; - public EventUpdate() { - } + public EventUpdate() {} public EventUpdate linkedId(@jakarta.annotation.Nullable String linkedId) { this.linkedId = linkedId; @@ -64,44 +54,46 @@ public EventUpdate linkedId(@jakarta.annotation.Nullable String linkedId) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_LINKED_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getLinkedId() { return linkedId; } - @JsonProperty(value = JSON_PROPERTY_LINKED_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLinkedId(@jakarta.annotation.Nullable String linkedId) { this.linkedId = linkedId; } - - public EventUpdate tags(@jakarta.annotation.Nullable Object tags) { + public EventUpdate tags(@jakarta.annotation.Nullable Map tags) { this.tags = tags; return this; } + public EventUpdate putTagsItem(String key, Object tagsItem) { + if (this.tags == null) { + this.tags = new HashMap<>(); + } + this.tags.put(key, tagsItem); + return this; + } + /** * A customer-provided value or an object that was sent with the identification request or updated later. * @return tags */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - - public Object getTags() { + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public Map getTags() { return tags; } - @JsonProperty(value = JSON_PROPERTY_TAGS, required = false) - @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setTags(@jakarta.annotation.Nullable Object tags) { + @JsonInclude(content = JsonInclude.Include.ALWAYS, value = JsonInclude.Include.USE_DEFAULTS) + public void setTags(@jakarta.annotation.Nullable Map tags) { this.tags = tags; } - public EventUpdate suspect(@jakarta.annotation.Nullable Boolean suspect) { this.suspect = suspect; return this; @@ -114,19 +106,16 @@ public EventUpdate suspect(@jakarta.annotation.Nullable Boolean suspect) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SUSPECT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getSuspect() { return suspect; } - @JsonProperty(value = JSON_PROPERTY_SUSPECT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSuspect(@jakarta.annotation.Nullable Boolean suspect) { this.suspect = suspect; } - /** * Return true if this EventUpdate object is equal to o. */ @@ -139,9 +128,9 @@ public boolean equals(Object o) { return false; } EventUpdate eventUpdate = (EventUpdate) o; - return Objects.equals(this.linkedId, eventUpdate.linkedId) && - Objects.equals(this.tags, eventUpdate.tags) && - Objects.equals(this.suspect, eventUpdate.suspect); + return Objects.equals(this.linkedId, eventUpdate.linkedId) + && Objects.equals(this.tags, eventUpdate.tags) + && Objects.equals(this.suspect, eventUpdate.suspect); } @Override @@ -170,6 +159,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/FontPreferences.java b/sdk/src/main/java/com/fingerprint/v4/model/FontPreferences.java index bce614d4..95b8bc85 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/FontPreferences.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/FontPreferences.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,25 +10,15 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** - * Baseline measurement of canonical fonts rendered on the device. Numeric width metrics, in CSS pixels, for the canonical fonts collected by the agent. + * Baseline measurement of canonical fonts rendered on the device. Numeric width metrics, in CSS pixels, for the canonical fonts collected by the agent. */ @JsonPropertyOrder({ FontPreferences.JSON_PROPERTY_DEFAULT, @@ -39,38 +29,32 @@ FontPreferences.JSON_PROPERTY_MIN, FontPreferences.JSON_PROPERTY_SYSTEM }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class FontPreferences { public static final String JSON_PROPERTY_DEFAULT = "default"; - @jakarta.annotation.Nullable - private Double _default; + @jakarta.annotation.Nullable private Double _default; public static final String JSON_PROPERTY_SERIF = "serif"; - @jakarta.annotation.Nullable - private Double serif; + @jakarta.annotation.Nullable private Double serif; public static final String JSON_PROPERTY_SANS = "sans"; - @jakarta.annotation.Nullable - private Double sans; + @jakarta.annotation.Nullable private Double sans; public static final String JSON_PROPERTY_MONO = "mono"; - @jakarta.annotation.Nullable - private Double mono; + @jakarta.annotation.Nullable private Double mono; public static final String JSON_PROPERTY_APPLE = "apple"; - @jakarta.annotation.Nullable - private Double apple; + @jakarta.annotation.Nullable private Double apple; public static final String JSON_PROPERTY_MIN = "min"; - @jakarta.annotation.Nullable - private Double min; + @jakarta.annotation.Nullable private Double min; public static final String JSON_PROPERTY_SYSTEM = "system"; - @jakarta.annotation.Nullable - private Double system; + @jakarta.annotation.Nullable private Double system; - public FontPreferences() { - } + public FontPreferences() {} public FontPreferences _default(@jakarta.annotation.Nullable Double _default) { this._default = _default; @@ -84,19 +68,16 @@ public FontPreferences _default(@jakarta.annotation.Nullable Double _default) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DEFAULT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getDefault() { return _default; } - @JsonProperty(value = JSON_PROPERTY_DEFAULT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDefault(@jakarta.annotation.Nullable Double _default) { this._default = _default; } - public FontPreferences serif(@jakarta.annotation.Nullable Double serif) { this.serif = serif; return this; @@ -109,19 +90,16 @@ public FontPreferences serif(@jakarta.annotation.Nullable Double serif) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SERIF, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getSerif() { return serif; } - @JsonProperty(value = JSON_PROPERTY_SERIF, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSerif(@jakarta.annotation.Nullable Double serif) { this.serif = serif; } - public FontPreferences sans(@jakarta.annotation.Nullable Double sans) { this.sans = sans; return this; @@ -134,19 +112,16 @@ public FontPreferences sans(@jakarta.annotation.Nullable Double sans) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SANS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getSans() { return sans; } - @JsonProperty(value = JSON_PROPERTY_SANS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSans(@jakarta.annotation.Nullable Double sans) { this.sans = sans; } - public FontPreferences mono(@jakarta.annotation.Nullable Double mono) { this.mono = mono; return this; @@ -159,19 +134,16 @@ public FontPreferences mono(@jakarta.annotation.Nullable Double mono) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MONO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getMono() { return mono; } - @JsonProperty(value = JSON_PROPERTY_MONO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMono(@jakarta.annotation.Nullable Double mono) { this.mono = mono; } - public FontPreferences apple(@jakarta.annotation.Nullable Double apple) { this.apple = apple; return this; @@ -184,19 +156,16 @@ public FontPreferences apple(@jakarta.annotation.Nullable Double apple) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_APPLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getApple() { return apple; } - @JsonProperty(value = JSON_PROPERTY_APPLE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setApple(@jakarta.annotation.Nullable Double apple) { this.apple = apple; } - public FontPreferences min(@jakarta.annotation.Nullable Double min) { this.min = min; return this; @@ -209,19 +178,16 @@ public FontPreferences min(@jakarta.annotation.Nullable Double min) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MIN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getMin() { return min; } - @JsonProperty(value = JSON_PROPERTY_MIN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMin(@jakarta.annotation.Nullable Double min) { this.min = min; } - public FontPreferences system(@jakarta.annotation.Nullable Double system) { this.system = system; return this; @@ -234,19 +200,16 @@ public FontPreferences system(@jakarta.annotation.Nullable Double system) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SYSTEM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getSystem() { return system; } - @JsonProperty(value = JSON_PROPERTY_SYSTEM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSystem(@jakarta.annotation.Nullable Double system) { this.system = system; } - /** * Return true if this FontPreferences object is equal to o. */ @@ -259,13 +222,13 @@ public boolean equals(Object o) { return false; } FontPreferences fontPreferences = (FontPreferences) o; - return Objects.equals(this._default, fontPreferences._default) && - Objects.equals(this.serif, fontPreferences.serif) && - Objects.equals(this.sans, fontPreferences.sans) && - Objects.equals(this.mono, fontPreferences.mono) && - Objects.equals(this.apple, fontPreferences.apple) && - Objects.equals(this.min, fontPreferences.min) && - Objects.equals(this.system, fontPreferences.system); + return Objects.equals(this._default, fontPreferences._default) + && Objects.equals(this.serif, fontPreferences.serif) + && Objects.equals(this.sans, fontPreferences.sans) + && Objects.equals(this.mono, fontPreferences.mono) + && Objects.equals(this.apple, fontPreferences.apple) + && Objects.equals(this.min, fontPreferences.min) + && Objects.equals(this.system, fontPreferences.system); } @Override @@ -298,6 +261,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/Geolocation.java b/sdk/src/main/java/com/fingerprint/v4/model/Geolocation.java index 6b3020e6..c555264b 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/Geolocation.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/Geolocation.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,25 +10,14 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.GeolocationSubdivisionsInner; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * Geolocation @@ -46,54 +35,46 @@ Geolocation.JSON_PROPERTY_CONTINENT_NAME, Geolocation.JSON_PROPERTY_SUBDIVISIONS }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class Geolocation { public static final String JSON_PROPERTY_ACCURACY_RADIUS = "accuracy_radius"; - @jakarta.annotation.Nullable - private Integer accuracyRadius; + @jakarta.annotation.Nullable private Integer accuracyRadius; public static final String JSON_PROPERTY_LATITUDE = "latitude"; - @jakarta.annotation.Nullable - private Double latitude; + @jakarta.annotation.Nullable private Double latitude; public static final String JSON_PROPERTY_LONGITUDE = "longitude"; - @jakarta.annotation.Nullable - private Double longitude; + @jakarta.annotation.Nullable private Double longitude; public static final String JSON_PROPERTY_POSTAL_CODE = "postal_code"; - @jakarta.annotation.Nullable - private String postalCode; + @jakarta.annotation.Nullable private String postalCode; public static final String JSON_PROPERTY_TIMEZONE = "timezone"; - @jakarta.annotation.Nullable - private String timezone; + @jakarta.annotation.Nullable private String timezone; public static final String JSON_PROPERTY_CITY_NAME = "city_name"; - @jakarta.annotation.Nullable - private String cityName; + @jakarta.annotation.Nullable private String cityName; public static final String JSON_PROPERTY_COUNTRY_CODE = "country_code"; - @jakarta.annotation.Nullable - private String countryCode; + @jakarta.annotation.Nullable private String countryCode; public static final String JSON_PROPERTY_COUNTRY_NAME = "country_name"; - @jakarta.annotation.Nullable - private String countryName; + @jakarta.annotation.Nullable private String countryName; public static final String JSON_PROPERTY_CONTINENT_CODE = "continent_code"; - @jakarta.annotation.Nullable - private String continentCode; + @jakarta.annotation.Nullable private String continentCode; public static final String JSON_PROPERTY_CONTINENT_NAME = "continent_name"; - @jakarta.annotation.Nullable - private String continentName; + @jakarta.annotation.Nullable private String continentName; public static final String JSON_PROPERTY_SUBDIVISIONS = "subdivisions"; + @jakarta.annotation.Nullable private List subdivisions = new ArrayList<>(); - public Geolocation() { - } + public Geolocation() {} public Geolocation accuracyRadius(@jakarta.annotation.Nullable Integer accuracyRadius) { this.accuracyRadius = accuracyRadius; @@ -108,19 +89,16 @@ public Geolocation accuracyRadius(@jakarta.annotation.Nullable Integer accuracyR @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ACCURACY_RADIUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getAccuracyRadius() { return accuracyRadius; } - @JsonProperty(value = JSON_PROPERTY_ACCURACY_RADIUS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAccuracyRadius(@jakarta.annotation.Nullable Integer accuracyRadius) { this.accuracyRadius = accuracyRadius; } - public Geolocation latitude(@jakarta.annotation.Nullable Double latitude) { this.latitude = latitude; return this; @@ -135,19 +113,16 @@ public Geolocation latitude(@jakarta.annotation.Nullable Double latitude) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_LATITUDE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getLatitude() { return latitude; } - @JsonProperty(value = JSON_PROPERTY_LATITUDE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLatitude(@jakarta.annotation.Nullable Double latitude) { this.latitude = latitude; } - public Geolocation longitude(@jakarta.annotation.Nullable Double longitude) { this.longitude = longitude; return this; @@ -162,19 +137,16 @@ public Geolocation longitude(@jakarta.annotation.Nullable Double longitude) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_LONGITUDE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getLongitude() { return longitude; } - @JsonProperty(value = JSON_PROPERTY_LONGITUDE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLongitude(@jakarta.annotation.Nullable Double longitude) { this.longitude = longitude; } - public Geolocation postalCode(@jakarta.annotation.Nullable String postalCode) { this.postalCode = postalCode; return this; @@ -187,19 +159,16 @@ public Geolocation postalCode(@jakarta.annotation.Nullable String postalCode) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_POSTAL_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPostalCode() { return postalCode; } - @JsonProperty(value = JSON_PROPERTY_POSTAL_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPostalCode(@jakarta.annotation.Nullable String postalCode) { this.postalCode = postalCode; } - public Geolocation timezone(@jakarta.annotation.Nullable String timezone) { this.timezone = timezone; return this; @@ -212,19 +181,16 @@ public Geolocation timezone(@jakarta.annotation.Nullable String timezone) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TIMEZONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTimezone() { return timezone; } - @JsonProperty(value = JSON_PROPERTY_TIMEZONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimezone(@jakarta.annotation.Nullable String timezone) { this.timezone = timezone; } - public Geolocation cityName(@jakarta.annotation.Nullable String cityName) { this.cityName = cityName; return this; @@ -237,19 +203,16 @@ public Geolocation cityName(@jakarta.annotation.Nullable String cityName) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CITY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCityName() { return cityName; } - @JsonProperty(value = JSON_PROPERTY_CITY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCityName(@jakarta.annotation.Nullable String cityName) { this.cityName = cityName; } - public Geolocation countryCode(@jakarta.annotation.Nullable String countryCode) { this.countryCode = countryCode; return this; @@ -262,19 +225,16 @@ public Geolocation countryCode(@jakarta.annotation.Nullable String countryCode) @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_COUNTRY_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCountryCode() { return countryCode; } - @JsonProperty(value = JSON_PROPERTY_COUNTRY_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryCode(@jakarta.annotation.Nullable String countryCode) { this.countryCode = countryCode; } - public Geolocation countryName(@jakarta.annotation.Nullable String countryName) { this.countryName = countryName; return this; @@ -287,19 +247,16 @@ public Geolocation countryName(@jakarta.annotation.Nullable String countryName) @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_COUNTRY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getCountryName() { return countryName; } - @JsonProperty(value = JSON_PROPERTY_COUNTRY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCountryName(@jakarta.annotation.Nullable String countryName) { this.countryName = countryName; } - public Geolocation continentCode(@jakarta.annotation.Nullable String continentCode) { this.continentCode = continentCode; return this; @@ -312,19 +269,16 @@ public Geolocation continentCode(@jakarta.annotation.Nullable String continentCo @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CONTINENT_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getContinentCode() { return continentCode; } - @JsonProperty(value = JSON_PROPERTY_CONTINENT_CODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContinentCode(@jakarta.annotation.Nullable String continentCode) { this.continentCode = continentCode; } - public Geolocation continentName(@jakarta.annotation.Nullable String continentName) { this.continentName = continentName; return this; @@ -337,20 +291,18 @@ public Geolocation continentName(@jakarta.annotation.Nullable String continentNa @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CONTINENT_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getContinentName() { return continentName; } - @JsonProperty(value = JSON_PROPERTY_CONTINENT_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContinentName(@jakarta.annotation.Nullable String continentName) { this.continentName = continentName; } - - public Geolocation subdivisions(@jakarta.annotation.Nullable List subdivisions) { + public Geolocation subdivisions( + @jakarta.annotation.Nullable List subdivisions) { this.subdivisions = subdivisions; return this; } @@ -370,19 +322,17 @@ public Geolocation addSubdivisionsItem(GeolocationSubdivisionsInner subdivisions @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SUBDIVISIONS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSubdivisions() { return subdivisions; } - @JsonProperty(value = JSON_PROPERTY_SUBDIVISIONS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubdivisions(@jakarta.annotation.Nullable List subdivisions) { + public void setSubdivisions( + @jakarta.annotation.Nullable List subdivisions) { this.subdivisions = subdivisions; } - /** * Return true if this Geolocation object is equal to o. */ @@ -395,22 +345,33 @@ public boolean equals(Object o) { return false; } Geolocation geolocation = (Geolocation) o; - return Objects.equals(this.accuracyRadius, geolocation.accuracyRadius) && - Objects.equals(this.latitude, geolocation.latitude) && - Objects.equals(this.longitude, geolocation.longitude) && - Objects.equals(this.postalCode, geolocation.postalCode) && - Objects.equals(this.timezone, geolocation.timezone) && - Objects.equals(this.cityName, geolocation.cityName) && - Objects.equals(this.countryCode, geolocation.countryCode) && - Objects.equals(this.countryName, geolocation.countryName) && - Objects.equals(this.continentCode, geolocation.continentCode) && - Objects.equals(this.continentName, geolocation.continentName) && - Objects.equals(this.subdivisions, geolocation.subdivisions); + return Objects.equals(this.accuracyRadius, geolocation.accuracyRadius) + && Objects.equals(this.latitude, geolocation.latitude) + && Objects.equals(this.longitude, geolocation.longitude) + && Objects.equals(this.postalCode, geolocation.postalCode) + && Objects.equals(this.timezone, geolocation.timezone) + && Objects.equals(this.cityName, geolocation.cityName) + && Objects.equals(this.countryCode, geolocation.countryCode) + && Objects.equals(this.countryName, geolocation.countryName) + && Objects.equals(this.continentCode, geolocation.continentCode) + && Objects.equals(this.continentName, geolocation.continentName) + && Objects.equals(this.subdivisions, geolocation.subdivisions); } @Override public int hashCode() { - return Objects.hash(accuracyRadius, latitude, longitude, postalCode, timezone, cityName, countryCode, countryName, continentCode, continentName, subdivisions); + return Objects.hash( + accuracyRadius, + latitude, + longitude, + postalCode, + timezone, + cityName, + countryCode, + countryName, + continentCode, + continentName, + subdivisions); } @Override @@ -442,6 +403,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/GeolocationSubdivisionsInner.java b/sdk/src/main/java/com/fingerprint/v4/model/GeolocationSubdivisionsInner.java index a989ab33..ee79c14b 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/GeolocationSubdivisionsInner.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/GeolocationSubdivisionsInner.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,22 +10,13 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Objects; /** * GeolocationSubdivisionsInner @@ -35,18 +26,17 @@ GeolocationSubdivisionsInner.JSON_PROPERTY_NAME }) @JsonTypeName("Geolocation_subdivisions_inner") -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class GeolocationSubdivisionsInner { public static final String JSON_PROPERTY_ISO_CODE = "iso_code"; - @jakarta.annotation.Nonnull - private String isoCode; + @jakarta.annotation.Nonnull private String isoCode; public static final String JSON_PROPERTY_NAME = "name"; - @jakarta.annotation.Nonnull - private String name; + @jakarta.annotation.Nonnull private String name; - public GeolocationSubdivisionsInner() { - } + public GeolocationSubdivisionsInner() {} public GeolocationSubdivisionsInner isoCode(@jakarta.annotation.Nonnull String isoCode) { this.isoCode = isoCode; @@ -60,19 +50,16 @@ public GeolocationSubdivisionsInner isoCode(@jakarta.annotation.Nonnull String i @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_ISO_CODE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getIsoCode() { return isoCode; } - @JsonProperty(value = JSON_PROPERTY_ISO_CODE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setIsoCode(@jakarta.annotation.Nonnull String isoCode) { this.isoCode = isoCode; } - public GeolocationSubdivisionsInner name(@jakarta.annotation.Nonnull String name) { this.name = name; return this; @@ -85,19 +72,16 @@ public GeolocationSubdivisionsInner name(@jakarta.annotation.Nonnull String name @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { return name; } - @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setName(@jakarta.annotation.Nonnull String name) { this.name = name; } - /** * Return true if this Geolocation_subdivisions_inner object is equal to o. */ @@ -110,8 +94,8 @@ public boolean equals(Object o) { return false; } GeolocationSubdivisionsInner geolocationSubdivisionsInner = (GeolocationSubdivisionsInner) o; - return Objects.equals(this.isoCode, geolocationSubdivisionsInner.isoCode) && - Objects.equals(this.name, geolocationSubdivisionsInner.name); + return Objects.equals(this.isoCode, geolocationSubdivisionsInner.isoCode) + && Objects.equals(this.name, geolocationSubdivisionsInner.name); } @Override @@ -139,6 +123,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/IPBlockList.java b/sdk/src/main/java/com/fingerprint/v4/model/IPBlockList.java index 7f4952e0..7866c9f3 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/IPBlockList.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/IPBlockList.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,22 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * IPBlockList @@ -35,22 +25,20 @@ IPBlockList.JSON_PROPERTY_ATTACK_SOURCE, IPBlockList.JSON_PROPERTY_TOR_NODE }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class IPBlockList { public static final String JSON_PROPERTY_EMAIL_SPAM = "email_spam"; - @jakarta.annotation.Nullable - private Boolean emailSpam; + @jakarta.annotation.Nullable private Boolean emailSpam; public static final String JSON_PROPERTY_ATTACK_SOURCE = "attack_source"; - @jakarta.annotation.Nullable - private Boolean attackSource; + @jakarta.annotation.Nullable private Boolean attackSource; public static final String JSON_PROPERTY_TOR_NODE = "tor_node"; - @jakarta.annotation.Nullable - private Boolean torNode; + @jakarta.annotation.Nullable private Boolean torNode; - public IPBlockList() { - } + public IPBlockList() {} public IPBlockList emailSpam(@jakarta.annotation.Nullable Boolean emailSpam) { this.emailSpam = emailSpam; @@ -64,19 +52,16 @@ public IPBlockList emailSpam(@jakarta.annotation.Nullable Boolean emailSpam) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_EMAIL_SPAM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getEmailSpam() { return emailSpam; } - @JsonProperty(value = JSON_PROPERTY_EMAIL_SPAM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmailSpam(@jakarta.annotation.Nullable Boolean emailSpam) { this.emailSpam = emailSpam; } - public IPBlockList attackSource(@jakarta.annotation.Nullable Boolean attackSource) { this.attackSource = attackSource; return this; @@ -89,19 +74,16 @@ public IPBlockList attackSource(@jakarta.annotation.Nullable Boolean attackSourc @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ATTACK_SOURCE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAttackSource() { return attackSource; } - @JsonProperty(value = JSON_PROPERTY_ATTACK_SOURCE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAttackSource(@jakarta.annotation.Nullable Boolean attackSource) { this.attackSource = attackSource; } - public IPBlockList torNode(@jakarta.annotation.Nullable Boolean torNode) { this.torNode = torNode; return this; @@ -114,19 +96,16 @@ public IPBlockList torNode(@jakarta.annotation.Nullable Boolean torNode) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TOR_NODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTorNode() { return torNode; } - @JsonProperty(value = JSON_PROPERTY_TOR_NODE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTorNode(@jakarta.annotation.Nullable Boolean torNode) { this.torNode = torNode; } - /** * Return true if this IPBlockList object is equal to o. */ @@ -139,9 +118,9 @@ public boolean equals(Object o) { return false; } IPBlockList ipBlockList = (IPBlockList) o; - return Objects.equals(this.emailSpam, ipBlockList.emailSpam) && - Objects.equals(this.attackSource, ipBlockList.attackSource) && - Objects.equals(this.torNode, ipBlockList.torNode); + return Objects.equals(this.emailSpam, ipBlockList.emailSpam) + && Objects.equals(this.attackSource, ipBlockList.attackSource) + && Objects.equals(this.torNode, ipBlockList.torNode); } @Override @@ -170,6 +149,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/IPInfo.java b/sdk/src/main/java/com/fingerprint/v4/model/IPInfo.java index 64ddb282..4746b89b 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/IPInfo.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/IPInfo.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,44 +10,28 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.IPInfoV4; -import com.fingerprint.v4.model.IPInfoV6; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * Details about the request IP address. Has separate fields for v4 and v6 IP address versions. */ -@JsonPropertyOrder({ - IPInfo.JSON_PROPERTY_V4, - IPInfo.JSON_PROPERTY_V6 -}) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@JsonPropertyOrder({IPInfo.JSON_PROPERTY_V4, IPInfo.JSON_PROPERTY_V6}) +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class IPInfo { public static final String JSON_PROPERTY_V4 = "v4"; - @jakarta.annotation.Nullable - private IPInfoV4 v4; + @jakarta.annotation.Nullable private IPInfoV4 v4; public static final String JSON_PROPERTY_V6 = "v6"; - @jakarta.annotation.Nullable - private IPInfoV6 v6; + @jakarta.annotation.Nullable private IPInfoV6 v6; - public IPInfo() { - } + public IPInfo() {} public IPInfo v4(@jakarta.annotation.Nullable IPInfoV4 v4) { this.v4 = v4; @@ -61,19 +45,16 @@ public IPInfo v4(@jakarta.annotation.Nullable IPInfoV4 v4) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_V4, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public IPInfoV4 getV4() { return v4; } - @JsonProperty(value = JSON_PROPERTY_V4, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setV4(@jakarta.annotation.Nullable IPInfoV4 v4) { this.v4 = v4; } - public IPInfo v6(@jakarta.annotation.Nullable IPInfoV6 v6) { this.v6 = v6; return this; @@ -86,19 +67,16 @@ public IPInfo v6(@jakarta.annotation.Nullable IPInfoV6 v6) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_V6, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public IPInfoV6 getV6() { return v6; } - @JsonProperty(value = JSON_PROPERTY_V6, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setV6(@jakarta.annotation.Nullable IPInfoV6 v6) { this.v6 = v6; } - /** * Return true if this IPInfo object is equal to o. */ @@ -111,8 +89,7 @@ public boolean equals(Object o) { return false; } IPInfo ipInfo = (IPInfo) o; - return Objects.equals(this.v4, ipInfo.v4) && - Objects.equals(this.v6, ipInfo.v6); + return Objects.equals(this.v4, ipInfo.v4) && Objects.equals(this.v6, ipInfo.v6); } @Override @@ -140,6 +117,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/IPInfoV4.java b/sdk/src/main/java/com/fingerprint/v4/model/IPInfoV4.java index 44ec9e58..1e339e32 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/IPInfoV4.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/IPInfoV4.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,23 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.Geolocation; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * IPInfoV4 @@ -41,42 +30,35 @@ IPInfoV4.JSON_PROPERTY_DATACENTER_RESULT, IPInfoV4.JSON_PROPERTY_DATACENTER_NAME }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class IPInfoV4 { public static final String JSON_PROPERTY_ADDRESS = "address"; - @jakarta.annotation.Nonnull - private String address; + @jakarta.annotation.Nonnull private String address; public static final String JSON_PROPERTY_GEOLOCATION = "geolocation"; - @jakarta.annotation.Nullable - private Geolocation geolocation; + @jakarta.annotation.Nullable private Geolocation geolocation; public static final String JSON_PROPERTY_ASN = "asn"; - @jakarta.annotation.Nullable - private String asn; + @jakarta.annotation.Nullable private String asn; public static final String JSON_PROPERTY_ASN_NAME = "asn_name"; - @jakarta.annotation.Nullable - private String asnName; + @jakarta.annotation.Nullable private String asnName; public static final String JSON_PROPERTY_ASN_NETWORK = "asn_network"; - @jakarta.annotation.Nullable - private String asnNetwork; + @jakarta.annotation.Nullable private String asnNetwork; public static final String JSON_PROPERTY_ASN_TYPE = "asn_type"; - @jakarta.annotation.Nullable - private String asnType; + @jakarta.annotation.Nullable private String asnType; public static final String JSON_PROPERTY_DATACENTER_RESULT = "datacenter_result"; - @jakarta.annotation.Nullable - private Boolean datacenterResult; + @jakarta.annotation.Nullable private Boolean datacenterResult; public static final String JSON_PROPERTY_DATACENTER_NAME = "datacenter_name"; - @jakarta.annotation.Nullable - private String datacenterName; + @jakarta.annotation.Nullable private String datacenterName; - public IPInfoV4() { - } + public IPInfoV4() {} public IPInfoV4 address(@jakarta.annotation.Nonnull String address) { this.address = address; @@ -90,19 +72,16 @@ public IPInfoV4 address(@jakarta.annotation.Nonnull String address) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_ADDRESS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getAddress() { return address; } - @JsonProperty(value = JSON_PROPERTY_ADDRESS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setAddress(@jakarta.annotation.Nonnull String address) { this.address = address; } - public IPInfoV4 geolocation(@jakarta.annotation.Nullable Geolocation geolocation) { this.geolocation = geolocation; return this; @@ -115,19 +94,16 @@ public IPInfoV4 geolocation(@jakarta.annotation.Nullable Geolocation geolocation @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_GEOLOCATION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Geolocation getGeolocation() { return geolocation; } - @JsonProperty(value = JSON_PROPERTY_GEOLOCATION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGeolocation(@jakarta.annotation.Nullable Geolocation geolocation) { this.geolocation = geolocation; } - public IPInfoV4 asn(@jakarta.annotation.Nullable String asn) { this.asn = asn; return this; @@ -140,19 +116,16 @@ public IPInfoV4 asn(@jakarta.annotation.Nullable String asn) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ASN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAsn() { return asn; } - @JsonProperty(value = JSON_PROPERTY_ASN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAsn(@jakarta.annotation.Nullable String asn) { this.asn = asn; } - public IPInfoV4 asnName(@jakarta.annotation.Nullable String asnName) { this.asnName = asnName; return this; @@ -165,19 +138,16 @@ public IPInfoV4 asnName(@jakarta.annotation.Nullable String asnName) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ASN_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAsnName() { return asnName; } - @JsonProperty(value = JSON_PROPERTY_ASN_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAsnName(@jakarta.annotation.Nullable String asnName) { this.asnName = asnName; } - public IPInfoV4 asnNetwork(@jakarta.annotation.Nullable String asnNetwork) { this.asnNetwork = asnNetwork; return this; @@ -190,19 +160,16 @@ public IPInfoV4 asnNetwork(@jakarta.annotation.Nullable String asnNetwork) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ASN_NETWORK, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAsnNetwork() { return asnNetwork; } - @JsonProperty(value = JSON_PROPERTY_ASN_NETWORK, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAsnNetwork(@jakarta.annotation.Nullable String asnNetwork) { this.asnNetwork = asnNetwork; } - public IPInfoV4 asnType(@jakarta.annotation.Nullable String asnType) { this.asnType = asnType; return this; @@ -215,19 +182,16 @@ public IPInfoV4 asnType(@jakarta.annotation.Nullable String asnType) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ASN_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAsnType() { return asnType; } - @JsonProperty(value = JSON_PROPERTY_ASN_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAsnType(@jakarta.annotation.Nullable String asnType) { this.asnType = asnType; } - public IPInfoV4 datacenterResult(@jakarta.annotation.Nullable Boolean datacenterResult) { this.datacenterResult = datacenterResult; return this; @@ -240,19 +204,16 @@ public IPInfoV4 datacenterResult(@jakarta.annotation.Nullable Boolean datacenter @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DATACENTER_RESULT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getDatacenterResult() { return datacenterResult; } - @JsonProperty(value = JSON_PROPERTY_DATACENTER_RESULT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDatacenterResult(@jakarta.annotation.Nullable Boolean datacenterResult) { this.datacenterResult = datacenterResult; } - public IPInfoV4 datacenterName(@jakarta.annotation.Nullable String datacenterName) { this.datacenterName = datacenterName; return this; @@ -265,19 +226,16 @@ public IPInfoV4 datacenterName(@jakarta.annotation.Nullable String datacenterNam @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DATACENTER_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getDatacenterName() { return datacenterName; } - @JsonProperty(value = JSON_PROPERTY_DATACENTER_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDatacenterName(@jakarta.annotation.Nullable String datacenterName) { this.datacenterName = datacenterName; } - /** * Return true if this IPInfoV4 object is equal to o. */ @@ -290,19 +248,20 @@ public boolean equals(Object o) { return false; } IPInfoV4 ipInfoV4 = (IPInfoV4) o; - return Objects.equals(this.address, ipInfoV4.address) && - Objects.equals(this.geolocation, ipInfoV4.geolocation) && - Objects.equals(this.asn, ipInfoV4.asn) && - Objects.equals(this.asnName, ipInfoV4.asnName) && - Objects.equals(this.asnNetwork, ipInfoV4.asnNetwork) && - Objects.equals(this.asnType, ipInfoV4.asnType) && - Objects.equals(this.datacenterResult, ipInfoV4.datacenterResult) && - Objects.equals(this.datacenterName, ipInfoV4.datacenterName); + return Objects.equals(this.address, ipInfoV4.address) + && Objects.equals(this.geolocation, ipInfoV4.geolocation) + && Objects.equals(this.asn, ipInfoV4.asn) + && Objects.equals(this.asnName, ipInfoV4.asnName) + && Objects.equals(this.asnNetwork, ipInfoV4.asnNetwork) + && Objects.equals(this.asnType, ipInfoV4.asnType) + && Objects.equals(this.datacenterResult, ipInfoV4.datacenterResult) + && Objects.equals(this.datacenterName, ipInfoV4.datacenterName); } @Override public int hashCode() { - return Objects.hash(address, geolocation, asn, asnName, asnNetwork, asnType, datacenterResult, datacenterName); + return Objects.hash( + address, geolocation, asn, asnName, asnNetwork, asnType, datacenterResult, datacenterName); } @Override @@ -331,6 +290,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/IPInfoV6.java b/sdk/src/main/java/com/fingerprint/v4/model/IPInfoV6.java index 2c6ef382..4ebc709c 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/IPInfoV6.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/IPInfoV6.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,23 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.Geolocation; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * IPInfoV6 @@ -41,42 +30,35 @@ IPInfoV6.JSON_PROPERTY_DATACENTER_RESULT, IPInfoV6.JSON_PROPERTY_DATACENTER_NAME }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class IPInfoV6 { public static final String JSON_PROPERTY_ADDRESS = "address"; - @jakarta.annotation.Nonnull - private String address; + @jakarta.annotation.Nonnull private String address; public static final String JSON_PROPERTY_GEOLOCATION = "geolocation"; - @jakarta.annotation.Nullable - private Geolocation geolocation; + @jakarta.annotation.Nullable private Geolocation geolocation; public static final String JSON_PROPERTY_ASN = "asn"; - @jakarta.annotation.Nullable - private String asn; + @jakarta.annotation.Nullable private String asn; public static final String JSON_PROPERTY_ASN_NAME = "asn_name"; - @jakarta.annotation.Nullable - private String asnName; + @jakarta.annotation.Nullable private String asnName; public static final String JSON_PROPERTY_ASN_NETWORK = "asn_network"; - @jakarta.annotation.Nullable - private String asnNetwork; + @jakarta.annotation.Nullable private String asnNetwork; public static final String JSON_PROPERTY_ASN_TYPE = "asn_type"; - @jakarta.annotation.Nullable - private String asnType; + @jakarta.annotation.Nullable private String asnType; public static final String JSON_PROPERTY_DATACENTER_RESULT = "datacenter_result"; - @jakarta.annotation.Nullable - private Boolean datacenterResult; + @jakarta.annotation.Nullable private Boolean datacenterResult; public static final String JSON_PROPERTY_DATACENTER_NAME = "datacenter_name"; - @jakarta.annotation.Nullable - private String datacenterName; + @jakarta.annotation.Nullable private String datacenterName; - public IPInfoV6() { - } + public IPInfoV6() {} public IPInfoV6 address(@jakarta.annotation.Nonnull String address) { this.address = address; @@ -90,19 +72,16 @@ public IPInfoV6 address(@jakarta.annotation.Nonnull String address) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_ADDRESS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getAddress() { return address; } - @JsonProperty(value = JSON_PROPERTY_ADDRESS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setAddress(@jakarta.annotation.Nonnull String address) { this.address = address; } - public IPInfoV6 geolocation(@jakarta.annotation.Nullable Geolocation geolocation) { this.geolocation = geolocation; return this; @@ -115,19 +94,16 @@ public IPInfoV6 geolocation(@jakarta.annotation.Nullable Geolocation geolocation @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_GEOLOCATION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Geolocation getGeolocation() { return geolocation; } - @JsonProperty(value = JSON_PROPERTY_GEOLOCATION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setGeolocation(@jakarta.annotation.Nullable Geolocation geolocation) { this.geolocation = geolocation; } - public IPInfoV6 asn(@jakarta.annotation.Nullable String asn) { this.asn = asn; return this; @@ -140,19 +116,16 @@ public IPInfoV6 asn(@jakarta.annotation.Nullable String asn) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ASN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAsn() { return asn; } - @JsonProperty(value = JSON_PROPERTY_ASN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAsn(@jakarta.annotation.Nullable String asn) { this.asn = asn; } - public IPInfoV6 asnName(@jakarta.annotation.Nullable String asnName) { this.asnName = asnName; return this; @@ -165,19 +138,16 @@ public IPInfoV6 asnName(@jakarta.annotation.Nullable String asnName) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ASN_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAsnName() { return asnName; } - @JsonProperty(value = JSON_PROPERTY_ASN_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAsnName(@jakarta.annotation.Nullable String asnName) { this.asnName = asnName; } - public IPInfoV6 asnNetwork(@jakarta.annotation.Nullable String asnNetwork) { this.asnNetwork = asnNetwork; return this; @@ -190,19 +160,16 @@ public IPInfoV6 asnNetwork(@jakarta.annotation.Nullable String asnNetwork) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ASN_NETWORK, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAsnNetwork() { return asnNetwork; } - @JsonProperty(value = JSON_PROPERTY_ASN_NETWORK, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAsnNetwork(@jakarta.annotation.Nullable String asnNetwork) { this.asnNetwork = asnNetwork; } - public IPInfoV6 asnType(@jakarta.annotation.Nullable String asnType) { this.asnType = asnType; return this; @@ -215,19 +182,16 @@ public IPInfoV6 asnType(@jakarta.annotation.Nullable String asnType) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ASN_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getAsnType() { return asnType; } - @JsonProperty(value = JSON_PROPERTY_ASN_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAsnType(@jakarta.annotation.Nullable String asnType) { this.asnType = asnType; } - public IPInfoV6 datacenterResult(@jakarta.annotation.Nullable Boolean datacenterResult) { this.datacenterResult = datacenterResult; return this; @@ -240,19 +204,16 @@ public IPInfoV6 datacenterResult(@jakarta.annotation.Nullable Boolean datacenter @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DATACENTER_RESULT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getDatacenterResult() { return datacenterResult; } - @JsonProperty(value = JSON_PROPERTY_DATACENTER_RESULT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDatacenterResult(@jakarta.annotation.Nullable Boolean datacenterResult) { this.datacenterResult = datacenterResult; } - public IPInfoV6 datacenterName(@jakarta.annotation.Nullable String datacenterName) { this.datacenterName = datacenterName; return this; @@ -265,19 +226,16 @@ public IPInfoV6 datacenterName(@jakarta.annotation.Nullable String datacenterNam @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DATACENTER_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getDatacenterName() { return datacenterName; } - @JsonProperty(value = JSON_PROPERTY_DATACENTER_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDatacenterName(@jakarta.annotation.Nullable String datacenterName) { this.datacenterName = datacenterName; } - /** * Return true if this IPInfoV6 object is equal to o. */ @@ -290,19 +248,20 @@ public boolean equals(Object o) { return false; } IPInfoV6 ipInfoV6 = (IPInfoV6) o; - return Objects.equals(this.address, ipInfoV6.address) && - Objects.equals(this.geolocation, ipInfoV6.geolocation) && - Objects.equals(this.asn, ipInfoV6.asn) && - Objects.equals(this.asnName, ipInfoV6.asnName) && - Objects.equals(this.asnNetwork, ipInfoV6.asnNetwork) && - Objects.equals(this.asnType, ipInfoV6.asnType) && - Objects.equals(this.datacenterResult, ipInfoV6.datacenterResult) && - Objects.equals(this.datacenterName, ipInfoV6.datacenterName); + return Objects.equals(this.address, ipInfoV6.address) + && Objects.equals(this.geolocation, ipInfoV6.geolocation) + && Objects.equals(this.asn, ipInfoV6.asn) + && Objects.equals(this.asnName, ipInfoV6.asnName) + && Objects.equals(this.asnNetwork, ipInfoV6.asnNetwork) + && Objects.equals(this.asnType, ipInfoV6.asnType) + && Objects.equals(this.datacenterResult, ipInfoV6.datacenterResult) + && Objects.equals(this.datacenterName, ipInfoV6.datacenterName); } @Override public int hashCode() { - return Objects.hash(address, geolocation, asn, asnName, asnNetwork, asnType, datacenterResult, datacenterName); + return Objects.hash( + address, geolocation, asn, asnName, asnNetwork, asnType, datacenterResult, datacenterName); } @Override @@ -331,6 +290,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/Identification.java b/sdk/src/main/java/com/fingerprint/v4/model/Identification.java index 50f2d9a4..1249673e 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/Identification.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/Identification.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,23 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.IdentificationConfidence; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * Identification @@ -38,30 +27,26 @@ Identification.JSON_PROPERTY_FIRST_SEEN_AT, Identification.JSON_PROPERTY_LAST_SEEN_AT }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class Identification { public static final String JSON_PROPERTY_VISITOR_ID = "visitor_id"; - @jakarta.annotation.Nonnull - private String visitorId; + @jakarta.annotation.Nonnull private String visitorId; public static final String JSON_PROPERTY_CONFIDENCE = "confidence"; - @jakarta.annotation.Nullable - private IdentificationConfidence confidence; + @jakarta.annotation.Nullable private IdentificationConfidence confidence; public static final String JSON_PROPERTY_VISITOR_FOUND = "visitor_found"; - @jakarta.annotation.Nonnull - private Boolean visitorFound; + @jakarta.annotation.Nonnull private Boolean visitorFound; public static final String JSON_PROPERTY_FIRST_SEEN_AT = "first_seen_at"; - @jakarta.annotation.Nullable - private Long firstSeenAt; + @jakarta.annotation.Nullable private Long firstSeenAt; public static final String JSON_PROPERTY_LAST_SEEN_AT = "last_seen_at"; - @jakarta.annotation.Nullable - private Long lastSeenAt; + @jakarta.annotation.Nullable private Long lastSeenAt; - public Identification() { - } + public Identification() {} public Identification visitorId(@jakarta.annotation.Nonnull String visitorId) { this.visitorId = visitorId; @@ -75,20 +60,18 @@ public Identification visitorId(@jakarta.annotation.Nonnull String visitorId) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_VISITOR_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getVisitorId() { return visitorId; } - @JsonProperty(value = JSON_PROPERTY_VISITOR_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setVisitorId(@jakarta.annotation.Nonnull String visitorId) { this.visitorId = visitorId; } - - public Identification confidence(@jakarta.annotation.Nullable IdentificationConfidence confidence) { + public Identification confidence( + @jakarta.annotation.Nullable IdentificationConfidence confidence) { this.confidence = confidence; return this; } @@ -100,19 +83,16 @@ public Identification confidence(@jakarta.annotation.Nullable IdentificationConf @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CONFIDENCE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public IdentificationConfidence getConfidence() { return confidence; } - @JsonProperty(value = JSON_PROPERTY_CONFIDENCE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfidence(@jakarta.annotation.Nullable IdentificationConfidence confidence) { this.confidence = confidence; } - public Identification visitorFound(@jakarta.annotation.Nonnull Boolean visitorFound) { this.visitorFound = visitorFound; return this; @@ -125,69 +105,60 @@ public Identification visitorFound(@jakarta.annotation.Nonnull Boolean visitorFo @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_VISITOR_FOUND, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Boolean getVisitorFound() { return visitorFound; } - @JsonProperty(value = JSON_PROPERTY_VISITOR_FOUND, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setVisitorFound(@jakarta.annotation.Nonnull Boolean visitorFound) { this.visitorFound = visitorFound; } - public Identification firstSeenAt(@jakarta.annotation.Nullable Long firstSeenAt) { this.firstSeenAt = firstSeenAt; return this; } /** - * Unix epoch time milliseconds timestamp indicating the time at which this visitor ID was first seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + * Unix epoch time milliseconds timestamp indicating the time at which this visitor ID was first seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 * @return firstSeenAt */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FIRST_SEEN_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getFirstSeenAt() { return firstSeenAt; } - @JsonProperty(value = JSON_PROPERTY_FIRST_SEEN_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstSeenAt(@jakarta.annotation.Nullable Long firstSeenAt) { this.firstSeenAt = firstSeenAt; } - public Identification lastSeenAt(@jakarta.annotation.Nullable Long lastSeenAt) { this.lastSeenAt = lastSeenAt; return this; } /** - * Unix epoch time milliseconds timestamp indicating the time at which this visitor ID was last seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + * Unix epoch time milliseconds timestamp indicating the time at which this visitor ID was last seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 * @return lastSeenAt */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_LAST_SEEN_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getLastSeenAt() { return lastSeenAt; } - @JsonProperty(value = JSON_PROPERTY_LAST_SEEN_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastSeenAt(@jakarta.annotation.Nullable Long lastSeenAt) { this.lastSeenAt = lastSeenAt; } - /** * Return true if this Identification object is equal to o. */ @@ -200,11 +171,11 @@ public boolean equals(Object o) { return false; } Identification identification = (Identification) o; - return Objects.equals(this.visitorId, identification.visitorId) && - Objects.equals(this.confidence, identification.confidence) && - Objects.equals(this.visitorFound, identification.visitorFound) && - Objects.equals(this.firstSeenAt, identification.firstSeenAt) && - Objects.equals(this.lastSeenAt, identification.lastSeenAt); + return Objects.equals(this.visitorId, identification.visitorId) + && Objects.equals(this.confidence, identification.confidence) + && Objects.equals(this.visitorFound, identification.visitorFound) + && Objects.equals(this.firstSeenAt, identification.firstSeenAt) + && Objects.equals(this.lastSeenAt, identification.lastSeenAt); } @Override @@ -235,6 +206,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/IdentificationConfidence.java b/sdk/src/main/java/com/fingerprint/v4/model/IdentificationConfidence.java index febcb869..6e6f95b5 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/IdentificationConfidence.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/IdentificationConfidence.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,22 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * IdentificationConfidence @@ -35,22 +25,20 @@ IdentificationConfidence.JSON_PROPERTY_VERSION, IdentificationConfidence.JSON_PROPERTY_COMMENT }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class IdentificationConfidence { public static final String JSON_PROPERTY_SCORE = "score"; - @jakarta.annotation.Nonnull - private Double score; + @jakarta.annotation.Nonnull private Double score; public static final String JSON_PROPERTY_VERSION = "version"; - @jakarta.annotation.Nullable - private String version; + @jakarta.annotation.Nullable private String version; public static final String JSON_PROPERTY_COMMENT = "comment"; - @jakarta.annotation.Nullable - private String comment; + @jakarta.annotation.Nullable private String comment; - public IdentificationConfidence() { - } + public IdentificationConfidence() {} public IdentificationConfidence score(@jakarta.annotation.Nonnull Double score) { this.score = score; @@ -66,19 +54,16 @@ public IdentificationConfidence score(@jakarta.annotation.Nonnull Double score) @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_SCORE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Double getScore() { return score; } - @JsonProperty(value = JSON_PROPERTY_SCORE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setScore(@jakarta.annotation.Nonnull Double score) { this.score = score; } - public IdentificationConfidence version(@jakarta.annotation.Nullable String version) { this.version = version; return this; @@ -91,19 +76,16 @@ public IdentificationConfidence version(@jakarta.annotation.Nullable String vers @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_VERSION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getVersion() { return version; } - @JsonProperty(value = JSON_PROPERTY_VERSION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVersion(@jakarta.annotation.Nullable String version) { this.version = version; } - public IdentificationConfidence comment(@jakarta.annotation.Nullable String comment) { this.comment = comment; return this; @@ -116,19 +98,16 @@ public IdentificationConfidence comment(@jakarta.annotation.Nullable String comm @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_COMMENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getComment() { return comment; } - @JsonProperty(value = JSON_PROPERTY_COMMENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setComment(@jakarta.annotation.Nullable String comment) { this.comment = comment; } - /** * Return true if this IdentificationConfidence object is equal to o. */ @@ -141,9 +120,9 @@ public boolean equals(Object o) { return false; } IdentificationConfidence identificationConfidence = (IdentificationConfidence) o; - return Objects.equals(this.score, identificationConfidence.score) && - Objects.equals(this.version, identificationConfidence.version) && - Objects.equals(this.comment, identificationConfidence.comment); + return Objects.equals(this.score, identificationConfidence.score) + && Objects.equals(this.version, identificationConfidence.version) + && Objects.equals(this.comment, identificationConfidence.comment); } @Override @@ -172,6 +151,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/Integration.java b/sdk/src/main/java/com/fingerprint/v4/model/Integration.java index 394ef463..c0a3d95f 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/Integration.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/Integration.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,23 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.IntegrationSubintegration; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * Integration @@ -36,22 +25,20 @@ Integration.JSON_PROPERTY_VERSION, Integration.JSON_PROPERTY_SUBINTEGRATION }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class Integration { public static final String JSON_PROPERTY_NAME = "name"; - @jakarta.annotation.Nullable - private String name; + @jakarta.annotation.Nullable private String name; public static final String JSON_PROPERTY_VERSION = "version"; - @jakarta.annotation.Nullable - private String version; + @jakarta.annotation.Nullable private String version; public static final String JSON_PROPERTY_SUBINTEGRATION = "subintegration"; - @jakarta.annotation.Nullable - private IntegrationSubintegration subintegration; + @jakarta.annotation.Nullable private IntegrationSubintegration subintegration; - public Integration() { - } + public Integration() {} public Integration name(@jakarta.annotation.Nullable String name) { this.name = name; @@ -65,19 +52,16 @@ public Integration name(@jakarta.annotation.Nullable String name) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { return name; } - @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(@jakarta.annotation.Nullable String name) { this.name = name; } - public Integration version(@jakarta.annotation.Nullable String version) { this.version = version; return this; @@ -90,20 +74,18 @@ public Integration version(@jakarta.annotation.Nullable String version) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_VERSION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getVersion() { return version; } - @JsonProperty(value = JSON_PROPERTY_VERSION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVersion(@jakarta.annotation.Nullable String version) { this.version = version; } - - public Integration subintegration(@jakarta.annotation.Nullable IntegrationSubintegration subintegration) { + public Integration subintegration( + @jakarta.annotation.Nullable IntegrationSubintegration subintegration) { this.subintegration = subintegration; return this; } @@ -115,19 +97,17 @@ public Integration subintegration(@jakarta.annotation.Nullable IntegrationSubint @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SUBINTEGRATION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public IntegrationSubintegration getSubintegration() { return subintegration; } - @JsonProperty(value = JSON_PROPERTY_SUBINTEGRATION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setSubintegration(@jakarta.annotation.Nullable IntegrationSubintegration subintegration) { + public void setSubintegration( + @jakarta.annotation.Nullable IntegrationSubintegration subintegration) { this.subintegration = subintegration; } - /** * Return true if this Integration object is equal to o. */ @@ -140,9 +120,9 @@ public boolean equals(Object o) { return false; } Integration integration = (Integration) o; - return Objects.equals(this.name, integration.name) && - Objects.equals(this.version, integration.version) && - Objects.equals(this.subintegration, integration.subintegration); + return Objects.equals(this.name, integration.name) + && Objects.equals(this.version, integration.version) + && Objects.equals(this.subintegration, integration.subintegration); } @Override @@ -171,6 +151,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/IntegrationSubintegration.java b/sdk/src/main/java/com/fingerprint/v4/model/IntegrationSubintegration.java index 39e55670..3f984120 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/IntegrationSubintegration.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/IntegrationSubintegration.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,22 +10,13 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Objects; /** * IntegrationSubintegration @@ -35,18 +26,17 @@ IntegrationSubintegration.JSON_PROPERTY_VERSION }) @JsonTypeName("Integration_subintegration") -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class IntegrationSubintegration { public static final String JSON_PROPERTY_NAME = "name"; - @jakarta.annotation.Nullable - private String name; + @jakarta.annotation.Nullable private String name; public static final String JSON_PROPERTY_VERSION = "version"; - @jakarta.annotation.Nullable - private String version; + @jakarta.annotation.Nullable private String version; - public IntegrationSubintegration() { - } + public IntegrationSubintegration() {} public IntegrationSubintegration name(@jakarta.annotation.Nullable String name) { this.name = name; @@ -60,19 +50,16 @@ public IntegrationSubintegration name(@jakarta.annotation.Nullable String name) @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getName() { return name; } - @JsonProperty(value = JSON_PROPERTY_NAME, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setName(@jakarta.annotation.Nullable String name) { this.name = name; } - public IntegrationSubintegration version(@jakarta.annotation.Nullable String version) { this.version = version; return this; @@ -85,19 +72,16 @@ public IntegrationSubintegration version(@jakarta.annotation.Nullable String ver @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_VERSION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getVersion() { return version; } - @JsonProperty(value = JSON_PROPERTY_VERSION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVersion(@jakarta.annotation.Nullable String version) { this.version = version; } - /** * Return true if this Integration_subintegration object is equal to o. */ @@ -110,8 +94,8 @@ public boolean equals(Object o) { return false; } IntegrationSubintegration integrationSubintegration = (IntegrationSubintegration) o; - return Objects.equals(this.name, integrationSubintegration.name) && - Objects.equals(this.version, integrationSubintegration.version); + return Objects.equals(this.name, integrationSubintegration.name) + && Objects.equals(this.version, integrationSubintegration.version); } @Override @@ -139,6 +123,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/PluginsInner.java b/sdk/src/main/java/com/fingerprint/v4/model/PluginsInner.java index ae52ccee..f7344861 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/PluginsInner.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/PluginsInner.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,25 +10,15 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.PluginsInnerMimeTypesInner; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * PluginsInner @@ -39,22 +29,22 @@ PluginsInner.JSON_PROPERTY_MIME_TYPES }) @JsonTypeName("Plugins_inner") -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class PluginsInner { public static final String JSON_PROPERTY_NAME = "name"; - @jakarta.annotation.Nonnull - private String name; + @jakarta.annotation.Nonnull private String name; public static final String JSON_PROPERTY_DESCRIPTION = "description"; - @jakarta.annotation.Nullable - private String description; + @jakarta.annotation.Nullable private String description; public static final String JSON_PROPERTY_MIME_TYPES = "mimeTypes"; + @jakarta.annotation.Nullable private List mimeTypes = new ArrayList<>(); - public PluginsInner() { - } + public PluginsInner() {} public PluginsInner name(@jakarta.annotation.Nonnull String name) { this.name = name; @@ -68,19 +58,16 @@ public PluginsInner name(@jakarta.annotation.Nonnull String name) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { return name; } - @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setName(@jakarta.annotation.Nonnull String name) { this.name = name; } - public PluginsInner description(@jakarta.annotation.Nullable String description) { this.description = description; return this; @@ -93,20 +80,18 @@ public PluginsInner description(@jakarta.annotation.Nullable String description) @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getDescription() { return description; } - @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(@jakarta.annotation.Nullable String description) { this.description = description; } - - public PluginsInner mimeTypes(@jakarta.annotation.Nullable List mimeTypes) { + public PluginsInner mimeTypes( + @jakarta.annotation.Nullable List mimeTypes) { this.mimeTypes = mimeTypes; return this; } @@ -126,19 +111,17 @@ public PluginsInner addMimeTypesItem(PluginsInnerMimeTypesInner mimeTypesItem) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MIME_TYPES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getMimeTypes() { return mimeTypes; } - @JsonProperty(value = JSON_PROPERTY_MIME_TYPES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setMimeTypes(@jakarta.annotation.Nullable List mimeTypes) { + public void setMimeTypes( + @jakarta.annotation.Nullable List mimeTypes) { this.mimeTypes = mimeTypes; } - /** * Return true if this Plugins_inner object is equal to o. */ @@ -151,9 +134,9 @@ public boolean equals(Object o) { return false; } PluginsInner pluginsInner = (PluginsInner) o; - return Objects.equals(this.name, pluginsInner.name) && - Objects.equals(this.description, pluginsInner.description) && - Objects.equals(this.mimeTypes, pluginsInner.mimeTypes); + return Objects.equals(this.name, pluginsInner.name) + && Objects.equals(this.description, pluginsInner.description) + && Objects.equals(this.mimeTypes, pluginsInner.mimeTypes); } @Override @@ -182,6 +165,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/PluginsInnerMimeTypesInner.java b/sdk/src/main/java/com/fingerprint/v4/model/PluginsInnerMimeTypesInner.java index bb67c05f..b384f245 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/PluginsInnerMimeTypesInner.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/PluginsInnerMimeTypesInner.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,22 +10,13 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import com.fasterxml.jackson.annotation.JsonTypeName; +import java.util.Objects; /** * PluginsInnerMimeTypesInner @@ -36,22 +27,20 @@ PluginsInnerMimeTypesInner.JSON_PROPERTY_DESCRIPTION }) @JsonTypeName("Plugins_inner_mimeTypes_inner") -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class PluginsInnerMimeTypesInner { public static final String JSON_PROPERTY_TYPE = "type"; - @jakarta.annotation.Nullable - private String type; + @jakarta.annotation.Nullable private String type; public static final String JSON_PROPERTY_SUFFIXES = "suffixes"; - @jakarta.annotation.Nullable - private String suffixes; + @jakarta.annotation.Nullable private String suffixes; public static final String JSON_PROPERTY_DESCRIPTION = "description"; - @jakarta.annotation.Nullable - private String description; + @jakarta.annotation.Nullable private String description; - public PluginsInnerMimeTypesInner() { - } + public PluginsInnerMimeTypesInner() {} public PluginsInnerMimeTypesInner type(@jakarta.annotation.Nullable String type) { this.type = type; @@ -65,19 +54,16 @@ public PluginsInnerMimeTypesInner type(@jakarta.annotation.Nullable String type) @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getType() { return type; } - @JsonProperty(value = JSON_PROPERTY_TYPE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setType(@jakarta.annotation.Nullable String type) { this.type = type; } - public PluginsInnerMimeTypesInner suffixes(@jakarta.annotation.Nullable String suffixes) { this.suffixes = suffixes; return this; @@ -90,19 +76,16 @@ public PluginsInnerMimeTypesInner suffixes(@jakarta.annotation.Nullable String s @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SUFFIXES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getSuffixes() { return suffixes; } - @JsonProperty(value = JSON_PROPERTY_SUFFIXES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSuffixes(@jakarta.annotation.Nullable String suffixes) { this.suffixes = suffixes; } - public PluginsInnerMimeTypesInner description(@jakarta.annotation.Nullable String description) { this.description = description; return this; @@ -115,19 +98,16 @@ public PluginsInnerMimeTypesInner description(@jakarta.annotation.Nullable Strin @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getDescription() { return description; } - @JsonProperty(value = JSON_PROPERTY_DESCRIPTION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDescription(@jakarta.annotation.Nullable String description) { this.description = description; } - /** * Return true if this Plugins_inner_mimeTypes_inner object is equal to o. */ @@ -140,9 +120,9 @@ public boolean equals(Object o) { return false; } PluginsInnerMimeTypesInner pluginsInnerMimeTypesInner = (PluginsInnerMimeTypesInner) o; - return Objects.equals(this.type, pluginsInnerMimeTypesInner.type) && - Objects.equals(this.suffixes, pluginsInnerMimeTypesInner.suffixes) && - Objects.equals(this.description, pluginsInnerMimeTypesInner.description); + return Objects.equals(this.type, pluginsInnerMimeTypesInner.type) + && Objects.equals(this.suffixes, pluginsInnerMimeTypesInner.suffixes) + && Objects.equals(this.description, pluginsInnerMimeTypesInner.description); } @Override @@ -171,6 +151,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/Proximity.java b/sdk/src/main/java/com/fingerprint/v4/model/Proximity.java index f3233a6a..95e7b643 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/Proximity.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/Proximity.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,58 +10,53 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; /** - * Proximity ID represents a fixed geographical zone in a discrete global grid within which the device is observed. + * Proximity ID represents a fixed geographical zone in a discrete global grid within which the device is observed. */ @JsonPropertyOrder({ Proximity.JSON_PROPERTY_ID, Proximity.JSON_PROPERTY_PRECISION_RADIUS, Proximity.JSON_PROPERTY_CONFIDENCE }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class Proximity { public static final String JSON_PROPERTY_ID = "id"; - @jakarta.annotation.Nonnull - private String id; + @jakarta.annotation.Nonnull private String id; /** - * The radius of the proximity zone’s precision level, in meters. + * The radius of the proximity zone’s precision level, in meters. */ public enum PrecisionRadiusEnum { NUMBER_10(Integer.valueOf(10)), - + NUMBER_25(Integer.valueOf(25)), - + NUMBER_65(Integer.valueOf(65)), - + NUMBER_175(Integer.valueOf(175)), - + NUMBER_450(Integer.valueOf(450)), - + NUMBER_1200(Integer.valueOf(1200)), - + NUMBER_3300(Integer.valueOf(3300)), - + NUMBER_8500(Integer.valueOf(8500)), - - NUMBER_22500(Integer.valueOf(22500)); + + NUMBER_22500(Integer.valueOf(22500)), + + UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED(Integer.MAX_VALUE); private Integer value; @@ -86,20 +81,17 @@ public static PrecisionRadiusEnum fromValue(Integer value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED; } } public static final String JSON_PROPERTY_PRECISION_RADIUS = "precision_radius"; - @jakarta.annotation.Nonnull - private PrecisionRadiusEnum precisionRadius; + @jakarta.annotation.Nonnull private PrecisionRadiusEnum precisionRadius; public static final String JSON_PROPERTY_CONFIDENCE = "confidence"; - @jakarta.annotation.Nonnull - private Float confidence; + @jakarta.annotation.Nonnull private Float confidence; - public Proximity() { - } + public Proximity() {} public Proximity id(@jakarta.annotation.Nonnull String id) { this.id = id; @@ -107,57 +99,52 @@ public Proximity id(@jakarta.annotation.Nonnull String id) { } /** - * A stable privacy-preserving identifier for a given proximity zone. + * A stable privacy-preserving identifier for a given proximity zone. * @return id */ @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getId() { return id; } - @JsonProperty(value = JSON_PROPERTY_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setId(@jakarta.annotation.Nonnull String id) { this.id = id; } - - public Proximity precisionRadius(@jakarta.annotation.Nonnull PrecisionRadiusEnum precisionRadius) { + public Proximity precisionRadius( + @jakarta.annotation.Nonnull PrecisionRadiusEnum precisionRadius) { this.precisionRadius = precisionRadius; return this; } /** - * The radius of the proximity zone’s precision level, in meters. + * The radius of the proximity zone’s precision level, in meters. * @return precisionRadius */ @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_PRECISION_RADIUS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public PrecisionRadiusEnum getPrecisionRadius() { return precisionRadius; } - @JsonProperty(value = JSON_PROPERTY_PRECISION_RADIUS, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPrecisionRadius(@jakarta.annotation.Nonnull PrecisionRadiusEnum precisionRadius) { this.precisionRadius = precisionRadius; } - public Proximity confidence(@jakarta.annotation.Nonnull Float confidence) { this.confidence = confidence; return this; } /** - * A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. + * A value between `0` and `1` representing the likelihood that the true device location lies within the mapped proximity zone. * Scores closer to `1` indicate high confidence that the location is inside the mapped proximity zone. * Scores closer to `0` indicate lower confidence, suggesting the true location may fall in an adjacent zone. * minimum: 0 * maximum: 1 * @return confidence @@ -165,19 +152,16 @@ public Proximity confidence(@jakarta.annotation.Nonnull Float confidence) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_CONFIDENCE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Float getConfidence() { return confidence; } - @JsonProperty(value = JSON_PROPERTY_CONFIDENCE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setConfidence(@jakarta.annotation.Nonnull Float confidence) { this.confidence = confidence; } - /** * Return true if this Proximity object is equal to o. */ @@ -190,9 +174,9 @@ public boolean equals(Object o) { return false; } Proximity proximity = (Proximity) o; - return Objects.equals(this.id, proximity.id) && - Objects.equals(this.precisionRadius, proximity.precisionRadius) && - Objects.equals(this.confidence, proximity.confidence); + return Objects.equals(this.id, proximity.id) + && Objects.equals(this.precisionRadius, proximity.precisionRadius) + && Objects.equals(this.confidence, proximity.confidence); } @Override @@ -221,6 +205,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/ProxyConfidence.java b/sdk/src/main/java/com/fingerprint/v4/model/ProxyConfidence.java index d8c03f42..4e076d75 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/ProxyConfidence.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/ProxyConfidence.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,31 +10,22 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Locale; /** - * Confidence level of the proxy detection. If a proxy is not detected, confidence is \"high\". If it's detected, can be \"low\", \"medium\", or \"high\". + * Confidence level of the proxy detection. If a proxy is not detected, confidence is \"high\". If it's detected, can be \"low\", \"medium\", or \"high\". */ public enum ProxyConfidence { - LOW("low"), - + MEDIUM("medium"), - - HIGH("high"); + + HIGH("high"), + + UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED("unsupported_value_sdk_upgrade_required"); private String value; @@ -59,7 +50,6 @@ public static ProxyConfidence fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED; } } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/ProxyDetails.java b/sdk/src/main/java/com/fingerprint/v4/model/ProxyDetails.java index d81ab767..d4d7e484 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/ProxyDetails.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/ProxyDetails.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,22 +10,14 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Objects; /** * Proxy detection details (present if `proxy` is `true`) @@ -35,15 +27,19 @@ ProxyDetails.JSON_PROPERTY_LAST_SEEN_AT, ProxyDetails.JSON_PROPERTY_PROVIDER }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class ProxyDetails { /** - * Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers + * Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers */ public enum ProxyTypeEnum { RESIDENTIAL(String.valueOf("residential")), - - DATA_CENTER(String.valueOf("data_center")); + + DATA_CENTER(String.valueOf("data_center")), + + UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED("unsupported_value_sdk_upgrade_required"); private String value; @@ -68,24 +64,20 @@ public static ProxyTypeEnum fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED; } } public static final String JSON_PROPERTY_PROXY_TYPE = "proxy_type"; - @jakarta.annotation.Nonnull - private ProxyTypeEnum proxyType; + @jakarta.annotation.Nonnull private ProxyTypeEnum proxyType; public static final String JSON_PROPERTY_LAST_SEEN_AT = "last_seen_at"; - @jakarta.annotation.Nullable - private Long lastSeenAt; + @jakarta.annotation.Nullable private Long lastSeenAt; public static final String JSON_PROPERTY_PROVIDER = "provider"; - @jakarta.annotation.Nullable - private String provider; + @jakarta.annotation.Nullable private String provider; - public ProxyDetails() { - } + public ProxyDetails() {} public ProxyDetails proxyType(@jakarta.annotation.Nonnull ProxyTypeEnum proxyType) { this.proxyType = proxyType; @@ -93,75 +85,66 @@ public ProxyDetails proxyType(@jakarta.annotation.Nonnull ProxyTypeEnum proxyTyp } /** - * Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers + * Residential proxies use real user IP addresses to appear as legitimate traffic, while data center proxies are public proxies hosted in data centers * @return proxyType */ @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_PROXY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public ProxyTypeEnum getProxyType() { return proxyType; } - @JsonProperty(value = JSON_PROPERTY_PROXY_TYPE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setProxyType(@jakarta.annotation.Nonnull ProxyTypeEnum proxyType) { this.proxyType = proxyType; } - public ProxyDetails lastSeenAt(@jakarta.annotation.Nullable Long lastSeenAt) { this.lastSeenAt = lastSeenAt; return this; } /** - * Unix millisecond timestamp with hourly resolution of when this IP was last seen as a proxy + * Unix millisecond timestamp with hourly resolution of when this IP was last seen as a proxy * @return lastSeenAt */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_LAST_SEEN_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getLastSeenAt() { return lastSeenAt; } - @JsonProperty(value = JSON_PROPERTY_LAST_SEEN_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastSeenAt(@jakarta.annotation.Nullable Long lastSeenAt) { this.lastSeenAt = lastSeenAt; } - public ProxyDetails provider(@jakarta.annotation.Nullable String provider) { this.provider = provider; return this; } /** - * String representing the last proxy service provider detected when this IP was synced. An IP can be shared by multiple service providers. + * String representing the last proxy service provider detected when this IP was synced. An IP can be shared by multiple service providers. * @return provider */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PROVIDER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getProvider() { return provider; } - @JsonProperty(value = JSON_PROPERTY_PROVIDER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setProvider(@jakarta.annotation.Nullable String provider) { this.provider = provider; } - /** * Return true if this ProxyDetails object is equal to o. */ @@ -174,9 +157,9 @@ public boolean equals(Object o) { return false; } ProxyDetails proxyDetails = (ProxyDetails) o; - return Objects.equals(this.proxyType, proxyDetails.proxyType) && - Objects.equals(this.lastSeenAt, proxyDetails.lastSeenAt) && - Objects.equals(this.provider, proxyDetails.provider); + return Objects.equals(this.proxyType, proxyDetails.proxyType) + && Objects.equals(this.lastSeenAt, proxyDetails.lastSeenAt) + && Objects.equals(this.provider, proxyDetails.provider); } @Override @@ -205,6 +188,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/RawDeviceAttributes.java b/sdk/src/main/java/com/fingerprint/v4/model/RawDeviceAttributes.java index 7bb543bc..d7d77217 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/RawDeviceAttributes.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/RawDeviceAttributes.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,34 +10,17 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.Canvas; -import com.fingerprint.v4.model.Emoji; -import com.fingerprint.v4.model.FontPreferences; -import com.fingerprint.v4.model.PluginsInner; -import com.fingerprint.v4.model.TouchSupport; -import com.fingerprint.v4.model.WebGlBasics; -import com.fingerprint.v4.model.WebGlExtensions; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** - * A curated subset of raw browser/device attributes that the API surface exposes. Each property contains a value or object with the data for the collected signal. + * A curated subset of raw browser/device attributes that the API surface exposes. Each property contains a value or object with the data for the collected signal. */ @JsonPropertyOrder({ RawDeviceAttributes.JSON_PROPERTY_FONT_PREFERENCES, @@ -66,112 +49,89 @@ RawDeviceAttributes.JSON_PROPERTY_INDEXED_DB, RawDeviceAttributes.JSON_PROPERTY_MATH }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class RawDeviceAttributes { public static final String JSON_PROPERTY_FONT_PREFERENCES = "font_preferences"; - @jakarta.annotation.Nullable - private FontPreferences fontPreferences; + @jakarta.annotation.Nullable private FontPreferences fontPreferences; public static final String JSON_PROPERTY_EMOJI = "emoji"; - @jakarta.annotation.Nullable - private Emoji emoji; + @jakarta.annotation.Nullable private Emoji emoji; public static final String JSON_PROPERTY_FONTS = "fonts"; - @jakarta.annotation.Nullable - private List fonts = new ArrayList<>(); + @jakarta.annotation.Nullable private List fonts = new ArrayList<>(); public static final String JSON_PROPERTY_DEVICE_MEMORY = "device_memory"; - @jakarta.annotation.Nullable - private Integer deviceMemory; + @jakarta.annotation.Nullable private Integer deviceMemory; public static final String JSON_PROPERTY_TIMEZONE = "timezone"; - @jakarta.annotation.Nullable - private String timezone; + @jakarta.annotation.Nullable private String timezone; public static final String JSON_PROPERTY_CANVAS = "canvas"; - @jakarta.annotation.Nullable - private Canvas canvas; + @jakarta.annotation.Nullable private Canvas canvas; public static final String JSON_PROPERTY_LANGUAGES = "languages"; - @jakarta.annotation.Nullable - private List> languages = new ArrayList<>(); + @jakarta.annotation.Nullable private List> languages = new ArrayList<>(); public static final String JSON_PROPERTY_WEBGL_EXTENSIONS = "webgl_extensions"; - @jakarta.annotation.Nullable - private WebGlExtensions webglExtensions; + @jakarta.annotation.Nullable private WebGlExtensions webglExtensions; public static final String JSON_PROPERTY_WEBGL_BASICS = "webgl_basics"; - @jakarta.annotation.Nullable - private WebGlBasics webglBasics; + @jakarta.annotation.Nullable private WebGlBasics webglBasics; public static final String JSON_PROPERTY_SCREEN_RESOLUTION = "screen_resolution"; - @jakarta.annotation.Nullable - private List screenResolution = new ArrayList<>(); + @jakarta.annotation.Nullable private List screenResolution = new ArrayList<>(); public static final String JSON_PROPERTY_TOUCH_SUPPORT = "touch_support"; - @jakarta.annotation.Nullable - private TouchSupport touchSupport; + @jakarta.annotation.Nullable private TouchSupport touchSupport; public static final String JSON_PROPERTY_OSCPU = "oscpu"; - @jakarta.annotation.Nullable - private String oscpu; + @jakarta.annotation.Nullable private String oscpu; public static final String JSON_PROPERTY_ARCHITECTURE = "architecture"; - @jakarta.annotation.Nullable - private Integer architecture; + @jakarta.annotation.Nullable private Integer architecture; public static final String JSON_PROPERTY_COOKIES_ENABLED = "cookies_enabled"; - @jakarta.annotation.Nullable - private Boolean cookiesEnabled; + @jakarta.annotation.Nullable private Boolean cookiesEnabled; public static final String JSON_PROPERTY_HARDWARE_CONCURRENCY = "hardware_concurrency"; - @jakarta.annotation.Nullable - private Integer hardwareConcurrency; + @jakarta.annotation.Nullable private Integer hardwareConcurrency; public static final String JSON_PROPERTY_DATE_TIME_LOCALE = "date_time_locale"; - @jakarta.annotation.Nullable - private String dateTimeLocale; + @jakarta.annotation.Nullable private String dateTimeLocale; public static final String JSON_PROPERTY_VENDOR = "vendor"; - @jakarta.annotation.Nullable - private String vendor; + @jakarta.annotation.Nullable private String vendor; public static final String JSON_PROPERTY_COLOR_DEPTH = "color_depth"; - @jakarta.annotation.Nullable - private Integer colorDepth; + @jakarta.annotation.Nullable private Integer colorDepth; public static final String JSON_PROPERTY_PLATFORM = "platform"; - @jakarta.annotation.Nullable - private String platform; + @jakarta.annotation.Nullable private String platform; public static final String JSON_PROPERTY_SESSION_STORAGE = "session_storage"; - @jakarta.annotation.Nullable - private Boolean sessionStorage; + @jakarta.annotation.Nullable private Boolean sessionStorage; public static final String JSON_PROPERTY_LOCAL_STORAGE = "local_storage"; - @jakarta.annotation.Nullable - private Boolean localStorage; + @jakarta.annotation.Nullable private Boolean localStorage; public static final String JSON_PROPERTY_AUDIO = "audio"; - @jakarta.annotation.Nullable - private Double audio; + @jakarta.annotation.Nullable private Double audio; public static final String JSON_PROPERTY_PLUGINS = "plugins"; - @jakarta.annotation.Nullable - private List plugins = new ArrayList<>(); + @jakarta.annotation.Nullable private List plugins = new ArrayList<>(); public static final String JSON_PROPERTY_INDEXED_DB = "indexed_db"; - @jakarta.annotation.Nullable - private Boolean indexedDb; + @jakarta.annotation.Nullable private Boolean indexedDb; public static final String JSON_PROPERTY_MATH = "math"; - @jakarta.annotation.Nullable - private String math; + @jakarta.annotation.Nullable private String math; - public RawDeviceAttributes() { - } + public RawDeviceAttributes() {} - public RawDeviceAttributes fontPreferences(@jakarta.annotation.Nullable FontPreferences fontPreferences) { + public RawDeviceAttributes fontPreferences( + @jakarta.annotation.Nullable FontPreferences fontPreferences) { this.fontPreferences = fontPreferences; return this; } @@ -183,19 +143,16 @@ public RawDeviceAttributes fontPreferences(@jakarta.annotation.Nullable FontPref @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FONT_PREFERENCES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public FontPreferences getFontPreferences() { return fontPreferences; } - @JsonProperty(value = JSON_PROPERTY_FONT_PREFERENCES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFontPreferences(@jakarta.annotation.Nullable FontPreferences fontPreferences) { this.fontPreferences = fontPreferences; } - public RawDeviceAttributes emoji(@jakarta.annotation.Nullable Emoji emoji) { this.emoji = emoji; return this; @@ -208,19 +165,16 @@ public RawDeviceAttributes emoji(@jakarta.annotation.Nullable Emoji emoji) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_EMOJI, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Emoji getEmoji() { return emoji; } - @JsonProperty(value = JSON_PROPERTY_EMOJI, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEmoji(@jakarta.annotation.Nullable Emoji emoji) { this.emoji = emoji; } - public RawDeviceAttributes fonts(@jakarta.annotation.Nullable List fonts) { this.fonts = fonts; return this; @@ -241,19 +195,16 @@ public RawDeviceAttributes addFontsItem(String fontsItem) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FONTS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getFonts() { return fonts; } - @JsonProperty(value = JSON_PROPERTY_FONTS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFonts(@jakarta.annotation.Nullable List fonts) { this.fonts = fonts; } - public RawDeviceAttributes deviceMemory(@jakarta.annotation.Nullable Integer deviceMemory) { this.deviceMemory = deviceMemory; return this; @@ -267,19 +218,16 @@ public RawDeviceAttributes deviceMemory(@jakarta.annotation.Nullable Integer dev @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DEVICE_MEMORY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getDeviceMemory() { return deviceMemory; } - @JsonProperty(value = JSON_PROPERTY_DEVICE_MEMORY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDeviceMemory(@jakarta.annotation.Nullable Integer deviceMemory) { this.deviceMemory = deviceMemory; } - public RawDeviceAttributes timezone(@jakarta.annotation.Nullable String timezone) { this.timezone = timezone; return this; @@ -292,19 +240,16 @@ public RawDeviceAttributes timezone(@jakarta.annotation.Nullable String timezone @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TIMEZONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getTimezone() { return timezone; } - @JsonProperty(value = JSON_PROPERTY_TIMEZONE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimezone(@jakarta.annotation.Nullable String timezone) { this.timezone = timezone; } - public RawDeviceAttributes canvas(@jakarta.annotation.Nullable Canvas canvas) { this.canvas = canvas; return this; @@ -317,19 +262,16 @@ public RawDeviceAttributes canvas(@jakarta.annotation.Nullable Canvas canvas) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CANVAS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Canvas getCanvas() { return canvas; } - @JsonProperty(value = JSON_PROPERTY_CANVAS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCanvas(@jakarta.annotation.Nullable Canvas canvas) { this.canvas = canvas; } - public RawDeviceAttributes languages(@jakarta.annotation.Nullable List> languages) { this.languages = languages; return this; @@ -344,26 +286,24 @@ public RawDeviceAttributes addLanguagesItem(List languagesItem) { } /** - * Navigator languages reported by the agent including fallbacks. Each inner array represents ordered language preferences reported by different APIs. + * Navigator languages reported by the agent including fallbacks. Each inner array represents ordered language preferences reported by different APIs. * @return languages */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_LANGUAGES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List> getLanguages() { return languages; } - @JsonProperty(value = JSON_PROPERTY_LANGUAGES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLanguages(@jakarta.annotation.Nullable List> languages) { this.languages = languages; } - - public RawDeviceAttributes webglExtensions(@jakarta.annotation.Nullable WebGlExtensions webglExtensions) { + public RawDeviceAttributes webglExtensions( + @jakarta.annotation.Nullable WebGlExtensions webglExtensions) { this.webglExtensions = webglExtensions; return this; } @@ -375,19 +315,16 @@ public RawDeviceAttributes webglExtensions(@jakarta.annotation.Nullable WebGlExt @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_WEBGL_EXTENSIONS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public WebGlExtensions getWebglExtensions() { return webglExtensions; } - @JsonProperty(value = JSON_PROPERTY_WEBGL_EXTENSIONS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebglExtensions(@jakarta.annotation.Nullable WebGlExtensions webglExtensions) { this.webglExtensions = webglExtensions; } - public RawDeviceAttributes webglBasics(@jakarta.annotation.Nullable WebGlBasics webglBasics) { this.webglBasics = webglBasics; return this; @@ -400,20 +337,18 @@ public RawDeviceAttributes webglBasics(@jakarta.annotation.Nullable WebGlBasics @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_WEBGL_BASICS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public WebGlBasics getWebglBasics() { return webglBasics; } - @JsonProperty(value = JSON_PROPERTY_WEBGL_BASICS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setWebglBasics(@jakarta.annotation.Nullable WebGlBasics webglBasics) { this.webglBasics = webglBasics; } - - public RawDeviceAttributes screenResolution(@jakarta.annotation.Nullable List screenResolution) { + public RawDeviceAttributes screenResolution( + @jakarta.annotation.Nullable List screenResolution) { this.screenResolution = screenResolution; return this; } @@ -433,19 +368,16 @@ public RawDeviceAttributes addScreenResolutionItem(Integer screenResolutionItem) @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SCREEN_RESOLUTION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getScreenResolution() { return screenResolution; } - @JsonProperty(value = JSON_PROPERTY_SCREEN_RESOLUTION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setScreenResolution(@jakarta.annotation.Nullable List screenResolution) { this.screenResolution = screenResolution; } - public RawDeviceAttributes touchSupport(@jakarta.annotation.Nullable TouchSupport touchSupport) { this.touchSupport = touchSupport; return this; @@ -458,19 +390,16 @@ public RawDeviceAttributes touchSupport(@jakarta.annotation.Nullable TouchSuppor @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TOUCH_SUPPORT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public TouchSupport getTouchSupport() { return touchSupport; } - @JsonProperty(value = JSON_PROPERTY_TOUCH_SUPPORT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTouchSupport(@jakarta.annotation.Nullable TouchSupport touchSupport) { this.touchSupport = touchSupport; } - public RawDeviceAttributes oscpu(@jakarta.annotation.Nullable String oscpu) { this.oscpu = oscpu; return this; @@ -483,19 +412,16 @@ public RawDeviceAttributes oscpu(@jakarta.annotation.Nullable String oscpu) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OSCPU, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getOscpu() { return oscpu; } - @JsonProperty(value = JSON_PROPERTY_OSCPU, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOscpu(@jakarta.annotation.Nullable String oscpu) { this.oscpu = oscpu; } - public RawDeviceAttributes architecture(@jakarta.annotation.Nullable Integer architecture) { this.architecture = architecture; return this; @@ -508,19 +434,16 @@ public RawDeviceAttributes architecture(@jakarta.annotation.Nullable Integer arc @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ARCHITECTURE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getArchitecture() { return architecture; } - @JsonProperty(value = JSON_PROPERTY_ARCHITECTURE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setArchitecture(@jakarta.annotation.Nullable Integer architecture) { this.architecture = architecture; } - public RawDeviceAttributes cookiesEnabled(@jakarta.annotation.Nullable Boolean cookiesEnabled) { this.cookiesEnabled = cookiesEnabled; return this; @@ -533,20 +456,18 @@ public RawDeviceAttributes cookiesEnabled(@jakarta.annotation.Nullable Boolean c @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_COOKIES_ENABLED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getCookiesEnabled() { return cookiesEnabled; } - @JsonProperty(value = JSON_PROPERTY_COOKIES_ENABLED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setCookiesEnabled(@jakarta.annotation.Nullable Boolean cookiesEnabled) { this.cookiesEnabled = cookiesEnabled; } - - public RawDeviceAttributes hardwareConcurrency(@jakarta.annotation.Nullable Integer hardwareConcurrency) { + public RawDeviceAttributes hardwareConcurrency( + @jakarta.annotation.Nullable Integer hardwareConcurrency) { this.hardwareConcurrency = hardwareConcurrency; return this; } @@ -559,44 +480,38 @@ public RawDeviceAttributes hardwareConcurrency(@jakarta.annotation.Nullable Inte @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_HARDWARE_CONCURRENCY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getHardwareConcurrency() { return hardwareConcurrency; } - @JsonProperty(value = JSON_PROPERTY_HARDWARE_CONCURRENCY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setHardwareConcurrency(@jakarta.annotation.Nullable Integer hardwareConcurrency) { this.hardwareConcurrency = hardwareConcurrency; } - public RawDeviceAttributes dateTimeLocale(@jakarta.annotation.Nullable String dateTimeLocale) { this.dateTimeLocale = dateTimeLocale; return this; } /** - * Locale derived from the Intl.DateTimeFormat API. Negative values indicate known error states. The negative statuses can be: - \"-1\": A permanent status for browsers that don't support Intl API. - \"-2\": A permanent status for browsers that don't supportDateTimeFormat constructor. - \"-3\": A permanent status for browsers in which DateTimeFormat locale is undefined or null. + * Locale derived from the Intl.DateTimeFormat API. Negative values indicate known error states. The negative statuses can be: - \"-1\": A permanent status for browsers that don't support Intl API. - \"-2\": A permanent status for browsers that don't supportDateTimeFormat constructor. - \"-3\": A permanent status for browsers in which DateTimeFormat locale is undefined or null. * @return dateTimeLocale */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DATE_TIME_LOCALE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getDateTimeLocale() { return dateTimeLocale; } - @JsonProperty(value = JSON_PROPERTY_DATE_TIME_LOCALE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDateTimeLocale(@jakarta.annotation.Nullable String dateTimeLocale) { this.dateTimeLocale = dateTimeLocale; } - public RawDeviceAttributes vendor(@jakarta.annotation.Nullable String vendor) { this.vendor = vendor; return this; @@ -609,19 +524,16 @@ public RawDeviceAttributes vendor(@jakarta.annotation.Nullable String vendor) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_VENDOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getVendor() { return vendor; } - @JsonProperty(value = JSON_PROPERTY_VENDOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVendor(@jakarta.annotation.Nullable String vendor) { this.vendor = vendor; } - public RawDeviceAttributes colorDepth(@jakarta.annotation.Nullable Integer colorDepth) { this.colorDepth = colorDepth; return this; @@ -634,19 +546,16 @@ public RawDeviceAttributes colorDepth(@jakarta.annotation.Nullable Integer color @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_COLOR_DEPTH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer getColorDepth() { return colorDepth; } - @JsonProperty(value = JSON_PROPERTY_COLOR_DEPTH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setColorDepth(@jakarta.annotation.Nullable Integer colorDepth) { this.colorDepth = colorDepth; } - public RawDeviceAttributes platform(@jakarta.annotation.Nullable String platform) { this.platform = platform; return this; @@ -659,19 +568,16 @@ public RawDeviceAttributes platform(@jakarta.annotation.Nullable String platform @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PLATFORM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getPlatform() { return platform; } - @JsonProperty(value = JSON_PROPERTY_PLATFORM, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlatform(@jakarta.annotation.Nullable String platform) { this.platform = platform; } - public RawDeviceAttributes sessionStorage(@jakarta.annotation.Nullable Boolean sessionStorage) { this.sessionStorage = sessionStorage; return this; @@ -684,19 +590,16 @@ public RawDeviceAttributes sessionStorage(@jakarta.annotation.Nullable Boolean s @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SESSION_STORAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getSessionStorage() { return sessionStorage; } - @JsonProperty(value = JSON_PROPERTY_SESSION_STORAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSessionStorage(@jakarta.annotation.Nullable Boolean sessionStorage) { this.sessionStorage = sessionStorage; } - public RawDeviceAttributes localStorage(@jakarta.annotation.Nullable Boolean localStorage) { this.localStorage = localStorage; return this; @@ -709,44 +612,38 @@ public RawDeviceAttributes localStorage(@jakarta.annotation.Nullable Boolean loc @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_LOCAL_STORAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getLocalStorage() { return localStorage; } - @JsonProperty(value = JSON_PROPERTY_LOCAL_STORAGE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLocalStorage(@jakarta.annotation.Nullable Boolean localStorage) { this.localStorage = localStorage; } - public RawDeviceAttributes audio(@jakarta.annotation.Nullable Double audio) { this.audio = audio; return this; } /** - * AudioContext fingerprint or negative status when unavailable. The negative statuses can be: - -1: A permanent status for those browsers which are known to always suspend audio context - -2: A permanent status for browsers that don't support the signal - -3: A temporary status that means that an unexpected timeout has happened + * AudioContext fingerprint or negative status when unavailable. The negative statuses can be: - -1: A permanent status for those browsers which are known to always suspend audio context - -2: A permanent status for browsers that don't support the signal - -3: A temporary status that means that an unexpected timeout has happened * @return audio */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_AUDIO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getAudio() { return audio; } - @JsonProperty(value = JSON_PROPERTY_AUDIO, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAudio(@jakarta.annotation.Nullable Double audio) { this.audio = audio; } - public RawDeviceAttributes plugins(@jakarta.annotation.Nullable List plugins) { this.plugins = plugins; return this; @@ -767,19 +664,16 @@ public RawDeviceAttributes addPluginsItem(PluginsInner pluginsItem) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PLUGINS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getPlugins() { return plugins; } - @JsonProperty(value = JSON_PROPERTY_PLUGINS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPlugins(@jakarta.annotation.Nullable List plugins) { this.plugins = plugins; } - public RawDeviceAttributes indexedDb(@jakarta.annotation.Nullable Boolean indexedDb) { this.indexedDb = indexedDb; return this; @@ -792,19 +686,16 @@ public RawDeviceAttributes indexedDb(@jakarta.annotation.Nullable Boolean indexe @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_INDEXED_DB, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getIndexedDb() { return indexedDb; } - @JsonProperty(value = JSON_PROPERTY_INDEXED_DB, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIndexedDb(@jakarta.annotation.Nullable Boolean indexedDb) { this.indexedDb = indexedDb; } - public RawDeviceAttributes math(@jakarta.annotation.Nullable String math) { this.math = math; return this; @@ -817,19 +708,16 @@ public RawDeviceAttributes math(@jakarta.annotation.Nullable String math) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MATH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getMath() { return math; } - @JsonProperty(value = JSON_PROPERTY_MATH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMath(@jakarta.annotation.Nullable String math) { this.math = math; } - /** * Return true if this RawDeviceAttributes object is equal to o. */ @@ -842,36 +730,61 @@ public boolean equals(Object o) { return false; } RawDeviceAttributes rawDeviceAttributes = (RawDeviceAttributes) o; - return Objects.equals(this.fontPreferences, rawDeviceAttributes.fontPreferences) && - Objects.equals(this.emoji, rawDeviceAttributes.emoji) && - Objects.equals(this.fonts, rawDeviceAttributes.fonts) && - Objects.equals(this.deviceMemory, rawDeviceAttributes.deviceMemory) && - Objects.equals(this.timezone, rawDeviceAttributes.timezone) && - Objects.equals(this.canvas, rawDeviceAttributes.canvas) && - Objects.equals(this.languages, rawDeviceAttributes.languages) && - Objects.equals(this.webglExtensions, rawDeviceAttributes.webglExtensions) && - Objects.equals(this.webglBasics, rawDeviceAttributes.webglBasics) && - Objects.equals(this.screenResolution, rawDeviceAttributes.screenResolution) && - Objects.equals(this.touchSupport, rawDeviceAttributes.touchSupport) && - Objects.equals(this.oscpu, rawDeviceAttributes.oscpu) && - Objects.equals(this.architecture, rawDeviceAttributes.architecture) && - Objects.equals(this.cookiesEnabled, rawDeviceAttributes.cookiesEnabled) && - Objects.equals(this.hardwareConcurrency, rawDeviceAttributes.hardwareConcurrency) && - Objects.equals(this.dateTimeLocale, rawDeviceAttributes.dateTimeLocale) && - Objects.equals(this.vendor, rawDeviceAttributes.vendor) && - Objects.equals(this.colorDepth, rawDeviceAttributes.colorDepth) && - Objects.equals(this.platform, rawDeviceAttributes.platform) && - Objects.equals(this.sessionStorage, rawDeviceAttributes.sessionStorage) && - Objects.equals(this.localStorage, rawDeviceAttributes.localStorage) && - Objects.equals(this.audio, rawDeviceAttributes.audio) && - Objects.equals(this.plugins, rawDeviceAttributes.plugins) && - Objects.equals(this.indexedDb, rawDeviceAttributes.indexedDb) && - Objects.equals(this.math, rawDeviceAttributes.math); + return Objects.equals(this.fontPreferences, rawDeviceAttributes.fontPreferences) + && Objects.equals(this.emoji, rawDeviceAttributes.emoji) + && Objects.equals(this.fonts, rawDeviceAttributes.fonts) + && Objects.equals(this.deviceMemory, rawDeviceAttributes.deviceMemory) + && Objects.equals(this.timezone, rawDeviceAttributes.timezone) + && Objects.equals(this.canvas, rawDeviceAttributes.canvas) + && Objects.equals(this.languages, rawDeviceAttributes.languages) + && Objects.equals(this.webglExtensions, rawDeviceAttributes.webglExtensions) + && Objects.equals(this.webglBasics, rawDeviceAttributes.webglBasics) + && Objects.equals(this.screenResolution, rawDeviceAttributes.screenResolution) + && Objects.equals(this.touchSupport, rawDeviceAttributes.touchSupport) + && Objects.equals(this.oscpu, rawDeviceAttributes.oscpu) + && Objects.equals(this.architecture, rawDeviceAttributes.architecture) + && Objects.equals(this.cookiesEnabled, rawDeviceAttributes.cookiesEnabled) + && Objects.equals(this.hardwareConcurrency, rawDeviceAttributes.hardwareConcurrency) + && Objects.equals(this.dateTimeLocale, rawDeviceAttributes.dateTimeLocale) + && Objects.equals(this.vendor, rawDeviceAttributes.vendor) + && Objects.equals(this.colorDepth, rawDeviceAttributes.colorDepth) + && Objects.equals(this.platform, rawDeviceAttributes.platform) + && Objects.equals(this.sessionStorage, rawDeviceAttributes.sessionStorage) + && Objects.equals(this.localStorage, rawDeviceAttributes.localStorage) + && Objects.equals(this.audio, rawDeviceAttributes.audio) + && Objects.equals(this.plugins, rawDeviceAttributes.plugins) + && Objects.equals(this.indexedDb, rawDeviceAttributes.indexedDb) + && Objects.equals(this.math, rawDeviceAttributes.math); } @Override public int hashCode() { - return Objects.hash(fontPreferences, emoji, fonts, deviceMemory, timezone, canvas, languages, webglExtensions, webglBasics, screenResolution, touchSupport, oscpu, architecture, cookiesEnabled, hardwareConcurrency, dateTimeLocale, vendor, colorDepth, platform, sessionStorage, localStorage, audio, plugins, indexedDb, math); + return Objects.hash( + fontPreferences, + emoji, + fonts, + deviceMemory, + timezone, + canvas, + languages, + webglExtensions, + webglBasics, + screenResolution, + touchSupport, + oscpu, + architecture, + cookiesEnabled, + hardwareConcurrency, + dateTimeLocale, + vendor, + colorDepth, + platform, + sessionStorage, + localStorage, + audio, + plugins, + indexedDb, + math); } @Override @@ -892,7 +805,9 @@ public String toString() { sb.append(" oscpu: ").append(toIndentedString(oscpu)).append("\n"); sb.append(" architecture: ").append(toIndentedString(architecture)).append("\n"); sb.append(" cookiesEnabled: ").append(toIndentedString(cookiesEnabled)).append("\n"); - sb.append(" hardwareConcurrency: ").append(toIndentedString(hardwareConcurrency)).append("\n"); + sb.append(" hardwareConcurrency: ") + .append(toIndentedString(hardwareConcurrency)) + .append("\n"); sb.append(" dateTimeLocale: ").append(toIndentedString(dateTimeLocale)).append("\n"); sb.append(" vendor: ").append(toIndentedString(vendor)).append("\n"); sb.append(" colorDepth: ").append(toIndentedString(colorDepth)).append("\n"); @@ -917,6 +832,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/RequestHeaderModifications.java b/sdk/src/main/java/com/fingerprint/v4/model/RequestHeaderModifications.java index 1529b209..a59b93f8 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/RequestHeaderModifications.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/RequestHeaderModifications.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,25 +10,14 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.RuleActionHeaderField; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * The set of header modifications to apply, in the following order: remove, set, append. @@ -38,22 +27,20 @@ RequestHeaderModifications.JSON_PROPERTY_SET, RequestHeaderModifications.JSON_PROPERTY_APPEND }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class RequestHeaderModifications { public static final String JSON_PROPERTY_REMOVE = "remove"; - @jakarta.annotation.Nullable - private List remove = new ArrayList<>(); + @jakarta.annotation.Nullable private List remove = new ArrayList<>(); public static final String JSON_PROPERTY_SET = "set"; - @jakarta.annotation.Nullable - private List set = new ArrayList<>(); + @jakarta.annotation.Nullable private List set = new ArrayList<>(); public static final String JSON_PROPERTY_APPEND = "append"; - @jakarta.annotation.Nullable - private List append = new ArrayList<>(); + @jakarta.annotation.Nullable private List append = new ArrayList<>(); - public RequestHeaderModifications() { - } + public RequestHeaderModifications() {} public RequestHeaderModifications remove(@jakarta.annotation.Nullable List remove) { this.remove = remove; @@ -75,20 +62,18 @@ public RequestHeaderModifications addRemoveItem(String removeItem) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_REMOVE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getRemove() { return remove; } - @JsonProperty(value = JSON_PROPERTY_REMOVE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRemove(@jakarta.annotation.Nullable List remove) { this.remove = remove; } - - public RequestHeaderModifications set(@jakarta.annotation.Nullable List set) { + public RequestHeaderModifications set( + @jakarta.annotation.Nullable List set) { this.set = set; return this; } @@ -108,20 +93,18 @@ public RequestHeaderModifications addSetItem(RuleActionHeaderField setItem) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SET, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getSet() { return set; } - @JsonProperty(value = JSON_PROPERTY_SET, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setSet(@jakarta.annotation.Nullable List set) { this.set = set; } - - public RequestHeaderModifications append(@jakarta.annotation.Nullable List append) { + public RequestHeaderModifications append( + @jakarta.annotation.Nullable List append) { this.append = append; return this; } @@ -141,19 +124,16 @@ public RequestHeaderModifications addAppendItem(RuleActionHeaderField appendItem @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_APPEND, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getAppend() { return append; } - @JsonProperty(value = JSON_PROPERTY_APPEND, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAppend(@jakarta.annotation.Nullable List append) { this.append = append; } - /** * Return true if this RequestHeaderModifications object is equal to o. */ @@ -166,9 +146,9 @@ public boolean equals(Object o) { return false; } RequestHeaderModifications requestHeaderModifications = (RequestHeaderModifications) o; - return Objects.equals(this.remove, requestHeaderModifications.remove) && - Objects.equals(this.set, requestHeaderModifications.set) && - Objects.equals(this.append, requestHeaderModifications.append); + return Objects.equals(this.remove, requestHeaderModifications.remove) + && Objects.equals(this.set, requestHeaderModifications.set) + && Objects.equals(this.append, requestHeaderModifications.append); } @Override @@ -197,6 +177,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/RuleActionHeaderField.java b/sdk/src/main/java/com/fingerprint/v4/model/RuleActionHeaderField.java index f82683ec..bc2f0d57 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/RuleActionHeaderField.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/RuleActionHeaderField.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,22 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * RuleActionHeaderField @@ -34,18 +24,17 @@ RuleActionHeaderField.JSON_PROPERTY_NAME, RuleActionHeaderField.JSON_PROPERTY_VALUE }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class RuleActionHeaderField { public static final String JSON_PROPERTY_NAME = "name"; - @jakarta.annotation.Nonnull - private String name; + @jakarta.annotation.Nonnull private String name; public static final String JSON_PROPERTY_VALUE = "value"; - @jakarta.annotation.Nonnull - private String value; + @jakarta.annotation.Nonnull private String value; - public RuleActionHeaderField() { - } + public RuleActionHeaderField() {} public RuleActionHeaderField name(@jakarta.annotation.Nonnull String name) { this.name = name; @@ -59,19 +48,16 @@ public RuleActionHeaderField name(@jakarta.annotation.Nonnull String name) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getName() { return name; } - @JsonProperty(value = JSON_PROPERTY_NAME, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setName(@jakarta.annotation.Nonnull String name) { this.name = name; } - public RuleActionHeaderField value(@jakarta.annotation.Nonnull String value) { this.value = value; return this; @@ -84,19 +70,16 @@ public RuleActionHeaderField value(@jakarta.annotation.Nonnull String value) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_VALUE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getValue() { return value; } - @JsonProperty(value = JSON_PROPERTY_VALUE, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setValue(@jakarta.annotation.Nonnull String value) { this.value = value; } - /** * Return true if this RuleActionHeaderField object is equal to o. */ @@ -109,8 +92,8 @@ public boolean equals(Object o) { return false; } RuleActionHeaderField ruleActionHeaderField = (RuleActionHeaderField) o; - return Objects.equals(this.name, ruleActionHeaderField.name) && - Objects.equals(this.value, ruleActionHeaderField.value); + return Objects.equals(this.name, ruleActionHeaderField.name) + && Objects.equals(this.value, ruleActionHeaderField.value); } @Override @@ -138,6 +121,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/RuleActionType.java b/sdk/src/main/java/com/fingerprint/v4/model/RuleActionType.java index 9a6a6dde..c89f8720 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/RuleActionType.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/RuleActionType.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,29 +10,20 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Locale; /** * Describes the action to take with the request. */ public enum RuleActionType { - ALLOW("allow"), - - BLOCK("block"); + + BLOCK("block"), + + UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED("unsupported_value_sdk_upgrade_required"); private String value; @@ -57,7 +48,6 @@ public static RuleActionType fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED; } } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/SDK.java b/sdk/src/main/java/com/fingerprint/v4/model/SDK.java index 7f861bcc..52f51f84 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/SDK.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/SDK.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,25 +10,16 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; +import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.Integration; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * Contains information about the SDK used to perform the request. @@ -38,19 +29,23 @@ SDK.JSON_PROPERTY_VERSION, SDK.JSON_PROPERTY_INTEGRATIONS }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class SDK { /** * Platform of the SDK used for the identification request. */ public enum PlatformEnum { JS(String.valueOf("js")), - + ANDROID(String.valueOf("android")), - + IOS(String.valueOf("ios")), - - UNKNOWN(String.valueOf("unknown")); + + UNKNOWN(String.valueOf("unknown")), + + UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED("unsupported_value_sdk_upgrade_required"); private String value; @@ -75,24 +70,20 @@ public static PlatformEnum fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED; } } public static final String JSON_PROPERTY_PLATFORM = "platform"; - @jakarta.annotation.Nonnull - private PlatformEnum platform; + @jakarta.annotation.Nonnull private PlatformEnum platform; public static final String JSON_PROPERTY_VERSION = "version"; - @jakarta.annotation.Nonnull - private String version; + @jakarta.annotation.Nonnull private String version; public static final String JSON_PROPERTY_INTEGRATIONS = "integrations"; - @jakarta.annotation.Nullable - private List integrations = new ArrayList<>(); + @jakarta.annotation.Nullable private List integrations = new ArrayList<>(); - public SDK() { - } + public SDK() {} public SDK platform(@jakarta.annotation.Nonnull PlatformEnum platform) { this.platform = platform; @@ -106,44 +97,38 @@ public SDK platform(@jakarta.annotation.Nonnull PlatformEnum platform) { @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_PLATFORM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public PlatformEnum getPlatform() { return platform; } - @JsonProperty(value = JSON_PROPERTY_PLATFORM, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setPlatform(@jakarta.annotation.Nonnull PlatformEnum platform) { this.platform = platform; } - public SDK version(@jakarta.annotation.Nonnull String version) { this.version = version; return this; } /** - * Version string of the SDK used for the identification request. For example: `\"3.12.1\"` + * Version string of the SDK used for the identification request. For example: `\"3.12.1\"` * @return version */ @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_VERSION, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getVersion() { return version; } - @JsonProperty(value = JSON_PROPERTY_VERSION, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setVersion(@jakarta.annotation.Nonnull String version) { this.version = version; } - public SDK integrations(@jakarta.annotation.Nullable List integrations) { this.integrations = integrations; return this; @@ -164,19 +149,16 @@ public SDK addIntegrationsItem(Integration integrationsItem) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_INTEGRATIONS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getIntegrations() { return integrations; } - @JsonProperty(value = JSON_PROPERTY_INTEGRATIONS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIntegrations(@jakarta.annotation.Nullable List integrations) { this.integrations = integrations; } - /** * Return true if this SDK object is equal to o. */ @@ -189,9 +171,9 @@ public boolean equals(Object o) { return false; } SDK SDK = (SDK) o; - return Objects.equals(this.platform, SDK.platform) && - Objects.equals(this.version, SDK.version) && - Objects.equals(this.integrations, SDK.integrations); + return Objects.equals(this.platform, SDK.platform) + && Objects.equals(this.version, SDK.version) + && Objects.equals(this.integrations, SDK.integrations); } @Override @@ -220,6 +202,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/SearchEventsBot.java b/sdk/src/main/java/com/fingerprint/v4/model/SearchEventsBot.java index 148cca0b..6663be5f 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/SearchEventsBot.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/SearchEventsBot.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,33 +10,24 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Locale; /** - * 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 `botd.bot` property set to a valid value are returned. Events without a `botd` Smart Signal result are left out of the response. + * 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. */ public enum SearchEventsBot { - ALL("all"), - + GOOD("good"), - + BAD("bad"), - - NONE("none"); + + NONE("none"), + + UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED("unsupported_value_sdk_upgrade_required"); private String value; @@ -61,7 +52,6 @@ public static SearchEventsBot fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED; } } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/SearchEventsSdkPlatform.java b/sdk/src/main/java/com/fingerprint/v4/model/SearchEventsSdkPlatform.java index b10091d5..1e8fa911 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/SearchEventsSdkPlatform.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/SearchEventsSdkPlatform.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,31 +10,22 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Locale; /** - * Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. + * Filter events by the SDK Platform associated with the identification event (`sdk.platform` property) . `js` - Javascript agent (Web). `ios` - Apple iOS based devices. `android` - Android based devices. */ public enum SearchEventsSdkPlatform { - JS("js"), - + ANDROID("android"), - - IOS("ios"); + + IOS("ios"), + + UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED("unsupported_value_sdk_upgrade_required"); private String value; @@ -59,7 +50,6 @@ public static SearchEventsSdkPlatform fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED; } } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/SearchEventsVpnConfidence.java b/sdk/src/main/java/com/fingerprint/v4/model/SearchEventsVpnConfidence.java index d1487cc6..556e2d51 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/SearchEventsVpnConfidence.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/SearchEventsVpnConfidence.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,31 +10,22 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Locale; /** - * Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. + * Filter events by VPN Detection result confidence level. `high` - events with high VPN Detection confidence. `medium` - events with medium VPN Detection confidence. `low` - events with low VPN Detection confidence. > Note: When using this parameter, only events with the `vpn.confidence` property set to a valid value are returned. Events without a `vpn` Smart Signal result are left out of the response. */ public enum SearchEventsVpnConfidence { - HIGH("high"), - + MEDIUM("medium"), - - LOW("low"); + + LOW("low"), + + UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED("unsupported_value_sdk_upgrade_required"); private String value; @@ -59,7 +50,6 @@ public static SearchEventsVpnConfidence fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED; } } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/SupplementaryIDHighRecall.java b/sdk/src/main/java/com/fingerprint/v4/model/SupplementaryIDHighRecall.java index 97e34c50..ce461fef 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/SupplementaryIDHighRecall.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/SupplementaryIDHighRecall.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,23 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.IdentificationConfidence; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * A supplementary browser identifier that prioritizes coverage over precision. The High Recall ID algorithm matches more generously, i.e., this identifier will remain the same even when there are subtle differences between two requests. This algorithm does not create as many new visitor IDs as the standard algorithms do, but there could be an increase in false-positive identification. @@ -38,30 +27,26 @@ SupplementaryIDHighRecall.JSON_PROPERTY_FIRST_SEEN_AT, SupplementaryIDHighRecall.JSON_PROPERTY_LAST_SEEN_AT }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class SupplementaryIDHighRecall { public static final String JSON_PROPERTY_VISITOR_ID = "visitor_id"; - @jakarta.annotation.Nonnull - private String visitorId; + @jakarta.annotation.Nonnull private String visitorId; public static final String JSON_PROPERTY_VISITOR_FOUND = "visitor_found"; - @jakarta.annotation.Nonnull - private Boolean visitorFound; + @jakarta.annotation.Nonnull private Boolean visitorFound; public static final String JSON_PROPERTY_CONFIDENCE = "confidence"; - @jakarta.annotation.Nullable - private IdentificationConfidence confidence; + @jakarta.annotation.Nullable private IdentificationConfidence confidence; public static final String JSON_PROPERTY_FIRST_SEEN_AT = "first_seen_at"; - @jakarta.annotation.Nullable - private Long firstSeenAt; + @jakarta.annotation.Nullable private Long firstSeenAt; public static final String JSON_PROPERTY_LAST_SEEN_AT = "last_seen_at"; - @jakarta.annotation.Nullable - private Long lastSeenAt; + @jakarta.annotation.Nullable private Long lastSeenAt; - public SupplementaryIDHighRecall() { - } + public SupplementaryIDHighRecall() {} public SupplementaryIDHighRecall visitorId(@jakarta.annotation.Nonnull String visitorId) { this.visitorId = visitorId; @@ -75,19 +60,16 @@ public SupplementaryIDHighRecall visitorId(@jakarta.annotation.Nonnull String vi @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_VISITOR_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public String getVisitorId() { return visitorId; } - @JsonProperty(value = JSON_PROPERTY_VISITOR_ID, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setVisitorId(@jakarta.annotation.Nonnull String visitorId) { this.visitorId = visitorId; } - public SupplementaryIDHighRecall visitorFound(@jakarta.annotation.Nonnull Boolean visitorFound) { this.visitorFound = visitorFound; return this; @@ -100,20 +82,18 @@ public SupplementaryIDHighRecall visitorFound(@jakarta.annotation.Nonnull Boolea @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_VISITOR_FOUND, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Boolean getVisitorFound() { return visitorFound; } - @JsonProperty(value = JSON_PROPERTY_VISITOR_FOUND, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void setVisitorFound(@jakarta.annotation.Nonnull Boolean visitorFound) { this.visitorFound = visitorFound; } - - public SupplementaryIDHighRecall confidence(@jakarta.annotation.Nullable IdentificationConfidence confidence) { + public SupplementaryIDHighRecall confidence( + @jakarta.annotation.Nullable IdentificationConfidence confidence) { this.confidence = confidence; return this; } @@ -125,69 +105,60 @@ public SupplementaryIDHighRecall confidence(@jakarta.annotation.Nullable Identif @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CONFIDENCE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public IdentificationConfidence getConfidence() { return confidence; } - @JsonProperty(value = JSON_PROPERTY_CONFIDENCE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setConfidence(@jakarta.annotation.Nullable IdentificationConfidence confidence) { this.confidence = confidence; } - public SupplementaryIDHighRecall firstSeenAt(@jakarta.annotation.Nullable Long firstSeenAt) { this.firstSeenAt = firstSeenAt; return this; } /** - * Unix epoch time milliseconds timestamp indicating the time at which this ID was first seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + * Unix epoch time milliseconds timestamp indicating the time at which this ID was first seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 * @return firstSeenAt */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_FIRST_SEEN_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getFirstSeenAt() { return firstSeenAt; } - @JsonProperty(value = JSON_PROPERTY_FIRST_SEEN_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setFirstSeenAt(@jakarta.annotation.Nullable Long firstSeenAt) { this.firstSeenAt = firstSeenAt; } - public SupplementaryIDHighRecall lastSeenAt(@jakarta.annotation.Nullable Long lastSeenAt) { this.lastSeenAt = lastSeenAt; return this; } /** - * Unix epoch time milliseconds timestamp indicating the time at which this ID was last seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 + * Unix epoch time milliseconds timestamp indicating the time at which this ID was last seen. example: `1758069706642` - Corresponding to Wed Sep 17 2025 00:41:46 GMT+0000 * @return lastSeenAt */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_LAST_SEEN_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getLastSeenAt() { return lastSeenAt; } - @JsonProperty(value = JSON_PROPERTY_LAST_SEEN_AT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setLastSeenAt(@jakarta.annotation.Nullable Long lastSeenAt) { this.lastSeenAt = lastSeenAt; } - /** * Return true if this SupplementaryIDHighRecall object is equal to o. */ @@ -200,11 +171,11 @@ public boolean equals(Object o) { return false; } SupplementaryIDHighRecall supplementaryIDHighRecall = (SupplementaryIDHighRecall) o; - return Objects.equals(this.visitorId, supplementaryIDHighRecall.visitorId) && - Objects.equals(this.visitorFound, supplementaryIDHighRecall.visitorFound) && - Objects.equals(this.confidence, supplementaryIDHighRecall.confidence) && - Objects.equals(this.firstSeenAt, supplementaryIDHighRecall.firstSeenAt) && - Objects.equals(this.lastSeenAt, supplementaryIDHighRecall.lastSeenAt); + return Objects.equals(this.visitorId, supplementaryIDHighRecall.visitorId) + && Objects.equals(this.visitorFound, supplementaryIDHighRecall.visitorFound) + && Objects.equals(this.confidence, supplementaryIDHighRecall.confidence) + && Objects.equals(this.firstSeenAt, supplementaryIDHighRecall.firstSeenAt) + && Objects.equals(this.lastSeenAt, supplementaryIDHighRecall.lastSeenAt); } @Override @@ -235,6 +206,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/TamperingDetails.java b/sdk/src/main/java/com/fingerprint/v4/model/TamperingDetails.java index d19f170b..ead8bd39 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/TamperingDetails.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/TamperingDetails.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,22 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * TamperingDetails @@ -34,18 +24,17 @@ TamperingDetails.JSON_PROPERTY_ANOMALY_SCORE, TamperingDetails.JSON_PROPERTY_ANTI_DETECT_BROWSER }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class TamperingDetails { public static final String JSON_PROPERTY_ANOMALY_SCORE = "anomaly_score"; - @jakarta.annotation.Nullable - private Double anomalyScore; + @jakarta.annotation.Nullable private Double anomalyScore; public static final String JSON_PROPERTY_ANTI_DETECT_BROWSER = "anti_detect_browser"; - @jakarta.annotation.Nullable - private Boolean antiDetectBrowser; + @jakarta.annotation.Nullable private Boolean antiDetectBrowser; - public TamperingDetails() { - } + public TamperingDetails() {} public TamperingDetails anomalyScore(@jakarta.annotation.Nullable Double anomalyScore) { this.anomalyScore = anomalyScore; @@ -53,7 +42,7 @@ public TamperingDetails anomalyScore(@jakarta.annotation.Nullable Double anomaly } /** - * Confidence score (`0.0 - 1.0`) for tampering detection: * Values above `0.5` indicate tampering. * Values below `0.5` indicate genuine browsers. + * Confidence score (`0.0 - 1.0`) for tampering detection: * Values above `0.5` indicate tampering. * Values below `0.5` indicate genuine browsers. * minimum: 0 * maximum: 1 * @return anomalyScore @@ -61,44 +50,39 @@ public TamperingDetails anomalyScore(@jakarta.annotation.Nullable Double anomaly @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ANOMALY_SCORE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Double getAnomalyScore() { return anomalyScore; } - @JsonProperty(value = JSON_PROPERTY_ANOMALY_SCORE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAnomalyScore(@jakarta.annotation.Nullable Double anomalyScore) { this.anomalyScore = anomalyScore; } - - public TamperingDetails antiDetectBrowser(@jakarta.annotation.Nullable Boolean antiDetectBrowser) { + public TamperingDetails antiDetectBrowser( + @jakarta.annotation.Nullable Boolean antiDetectBrowser) { this.antiDetectBrowser = antiDetectBrowser; return this; } /** - * True if the identified browser resembles an \"anti-detect\" browser, such as Incognition, which attempts to evade identification by manipulating its fingerprint. + * True if the identified browser resembles an \"anti-detect\" browser, such as Incognition, which attempts to evade identification by manipulating its fingerprint. * @return antiDetectBrowser */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_ANTI_DETECT_BROWSER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAntiDetectBrowser() { return antiDetectBrowser; } - @JsonProperty(value = JSON_PROPERTY_ANTI_DETECT_BROWSER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAntiDetectBrowser(@jakarta.annotation.Nullable Boolean antiDetectBrowser) { this.antiDetectBrowser = antiDetectBrowser; } - /** * Return true if this TamperingDetails object is equal to o. */ @@ -111,8 +95,8 @@ public boolean equals(Object o) { return false; } TamperingDetails tamperingDetails = (TamperingDetails) o; - return Objects.equals(this.anomalyScore, tamperingDetails.anomalyScore) && - Objects.equals(this.antiDetectBrowser, tamperingDetails.antiDetectBrowser); + return Objects.equals(this.anomalyScore, tamperingDetails.anomalyScore) + && Objects.equals(this.antiDetectBrowser, tamperingDetails.antiDetectBrowser); } @Override @@ -140,6 +124,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/TouchSupport.java b/sdk/src/main/java/com/fingerprint/v4/model/TouchSupport.java index 9c7e6b6d..6010dcfa 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/TouchSupport.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/TouchSupport.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,22 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * Browser-reported touch capabilities. @@ -35,22 +25,20 @@ TouchSupport.JSON_PROPERTY_TOUCH_START, TouchSupport.JSON_PROPERTY_MAX_TOUCH_POINTS }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class TouchSupport { public static final String JSON_PROPERTY_TOUCH_EVENT = "touch_event"; - @jakarta.annotation.Nullable - private Boolean touchEvent; + @jakarta.annotation.Nullable private Boolean touchEvent; public static final String JSON_PROPERTY_TOUCH_START = "touch_start"; - @jakarta.annotation.Nullable - private Boolean touchStart; + @jakarta.annotation.Nullable private Boolean touchStart; public static final String JSON_PROPERTY_MAX_TOUCH_POINTS = "max_touch_points"; - @jakarta.annotation.Nullable - private Long maxTouchPoints; + @jakarta.annotation.Nullable private Long maxTouchPoints; - public TouchSupport() { - } + public TouchSupport() {} public TouchSupport touchEvent(@jakarta.annotation.Nullable Boolean touchEvent) { this.touchEvent = touchEvent; @@ -64,19 +52,16 @@ public TouchSupport touchEvent(@jakarta.annotation.Nullable Boolean touchEvent) @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TOUCH_EVENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTouchEvent() { return touchEvent; } - @JsonProperty(value = JSON_PROPERTY_TOUCH_EVENT, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTouchEvent(@jakarta.annotation.Nullable Boolean touchEvent) { this.touchEvent = touchEvent; } - public TouchSupport touchStart(@jakarta.annotation.Nullable Boolean touchStart) { this.touchStart = touchStart; return this; @@ -89,19 +74,16 @@ public TouchSupport touchStart(@jakarta.annotation.Nullable Boolean touchStart) @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TOUCH_START, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTouchStart() { return touchStart; } - @JsonProperty(value = JSON_PROPERTY_TOUCH_START, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTouchStart(@jakarta.annotation.Nullable Boolean touchStart) { this.touchStart = touchStart; } - public TouchSupport maxTouchPoints(@jakarta.annotation.Nullable Long maxTouchPoints) { this.maxTouchPoints = maxTouchPoints; return this; @@ -114,19 +96,16 @@ public TouchSupport maxTouchPoints(@jakarta.annotation.Nullable Long maxTouchPoi @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_MAX_TOUCH_POINTS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Long getMaxTouchPoints() { return maxTouchPoints; } - @JsonProperty(value = JSON_PROPERTY_MAX_TOUCH_POINTS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setMaxTouchPoints(@jakarta.annotation.Nullable Long maxTouchPoints) { this.maxTouchPoints = maxTouchPoints; } - /** * Return true if this TouchSupport object is equal to o. */ @@ -139,9 +118,9 @@ public boolean equals(Object o) { return false; } TouchSupport touchSupport = (TouchSupport) o; - return Objects.equals(this.touchEvent, touchSupport.touchEvent) && - Objects.equals(this.touchStart, touchSupport.touchStart) && - Objects.equals(this.maxTouchPoints, touchSupport.maxTouchPoints); + return Objects.equals(this.touchEvent, touchSupport.touchEvent) + && Objects.equals(this.touchStart, touchSupport.touchStart) + && Objects.equals(this.maxTouchPoints, touchSupport.maxTouchPoints); } @Override @@ -170,6 +149,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/Velocity.java b/sdk/src/main/java/com/fingerprint/v4/model/Velocity.java index 7798fa3a..4a94bf1e 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/Velocity.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/Velocity.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,26 +10,15 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fingerprint.v4.model.VelocityData; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** - * 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 `24h` 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.['24h']`) 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. + * 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 `24h` 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.['24h']`) 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. */ @JsonPropertyOrder({ Velocity.JSON_PROPERTY_DISTINCT_IP, @@ -40,38 +29,33 @@ Velocity.JSON_PROPERTY_DISTINCT_IP_BY_LINKED_ID, Velocity.JSON_PROPERTY_DISTINCT_VISITOR_ID_BY_LINKED_ID }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class Velocity { public static final String JSON_PROPERTY_DISTINCT_IP = "distinct_ip"; - @jakarta.annotation.Nullable - private VelocityData distinctIp; + @jakarta.annotation.Nullable private VelocityData distinctIp; public static final String JSON_PROPERTY_DISTINCT_LINKED_ID = "distinct_linked_id"; - @jakarta.annotation.Nullable - private VelocityData distinctLinkedId; + @jakarta.annotation.Nullable private VelocityData distinctLinkedId; public static final String JSON_PROPERTY_DISTINCT_COUNTRY = "distinct_country"; - @jakarta.annotation.Nullable - private VelocityData distinctCountry; + @jakarta.annotation.Nullable private VelocityData distinctCountry; public static final String JSON_PROPERTY_EVENTS = "events"; - @jakarta.annotation.Nullable - private VelocityData events; + @jakarta.annotation.Nullable private VelocityData events; public static final String JSON_PROPERTY_IP_EVENTS = "ip_events"; - @jakarta.annotation.Nullable - private VelocityData ipEvents; + @jakarta.annotation.Nullable private VelocityData ipEvents; public static final String JSON_PROPERTY_DISTINCT_IP_BY_LINKED_ID = "distinct_ip_by_linked_id"; - @jakarta.annotation.Nullable - private VelocityData distinctIpByLinkedId; + @jakarta.annotation.Nullable private VelocityData distinctIpByLinkedId; - public static final String JSON_PROPERTY_DISTINCT_VISITOR_ID_BY_LINKED_ID = "distinct_visitor_id_by_linked_id"; - @jakarta.annotation.Nullable - private VelocityData distinctVisitorIdByLinkedId; + public static final String JSON_PROPERTY_DISTINCT_VISITOR_ID_BY_LINKED_ID = + "distinct_visitor_id_by_linked_id"; + @jakarta.annotation.Nullable private VelocityData distinctVisitorIdByLinkedId; - public Velocity() { - } + public Velocity() {} public Velocity distinctIp(@jakarta.annotation.Nullable VelocityData distinctIp) { this.distinctIp = distinctIp; @@ -85,19 +69,16 @@ public Velocity distinctIp(@jakarta.annotation.Nullable VelocityData distinctIp) @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DISTINCT_IP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public VelocityData getDistinctIp() { return distinctIp; } - @JsonProperty(value = JSON_PROPERTY_DISTINCT_IP, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDistinctIp(@jakarta.annotation.Nullable VelocityData distinctIp) { this.distinctIp = distinctIp; } - public Velocity distinctLinkedId(@jakarta.annotation.Nullable VelocityData distinctLinkedId) { this.distinctLinkedId = distinctLinkedId; return this; @@ -110,19 +91,16 @@ public Velocity distinctLinkedId(@jakarta.annotation.Nullable VelocityData disti @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DISTINCT_LINKED_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public VelocityData getDistinctLinkedId() { return distinctLinkedId; } - @JsonProperty(value = JSON_PROPERTY_DISTINCT_LINKED_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDistinctLinkedId(@jakarta.annotation.Nullable VelocityData distinctLinkedId) { this.distinctLinkedId = distinctLinkedId; } - public Velocity distinctCountry(@jakarta.annotation.Nullable VelocityData distinctCountry) { this.distinctCountry = distinctCountry; return this; @@ -135,19 +113,16 @@ public Velocity distinctCountry(@jakarta.annotation.Nullable VelocityData distin @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DISTINCT_COUNTRY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public VelocityData getDistinctCountry() { return distinctCountry; } - @JsonProperty(value = JSON_PROPERTY_DISTINCT_COUNTRY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setDistinctCountry(@jakarta.annotation.Nullable VelocityData distinctCountry) { this.distinctCountry = distinctCountry; } - public Velocity events(@jakarta.annotation.Nullable VelocityData events) { this.events = events; return this; @@ -160,19 +135,16 @@ public Velocity events(@jakarta.annotation.Nullable VelocityData events) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_EVENTS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public VelocityData getEvents() { return events; } - @JsonProperty(value = JSON_PROPERTY_EVENTS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setEvents(@jakarta.annotation.Nullable VelocityData events) { this.events = events; } - public Velocity ipEvents(@jakarta.annotation.Nullable VelocityData ipEvents) { this.ipEvents = ipEvents; return this; @@ -185,20 +157,18 @@ public Velocity ipEvents(@jakarta.annotation.Nullable VelocityData ipEvents) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_IP_EVENTS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public VelocityData getIpEvents() { return ipEvents; } - @JsonProperty(value = JSON_PROPERTY_IP_EVENTS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setIpEvents(@jakarta.annotation.Nullable VelocityData ipEvents) { this.ipEvents = ipEvents; } - - public Velocity distinctIpByLinkedId(@jakarta.annotation.Nullable VelocityData distinctIpByLinkedId) { + public Velocity distinctIpByLinkedId( + @jakarta.annotation.Nullable VelocityData distinctIpByLinkedId) { this.distinctIpByLinkedId = distinctIpByLinkedId; return this; } @@ -210,20 +180,19 @@ public Velocity distinctIpByLinkedId(@jakarta.annotation.Nullable VelocityData d @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DISTINCT_IP_BY_LINKED_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public VelocityData getDistinctIpByLinkedId() { return distinctIpByLinkedId; } - @JsonProperty(value = JSON_PROPERTY_DISTINCT_IP_BY_LINKED_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDistinctIpByLinkedId(@jakarta.annotation.Nullable VelocityData distinctIpByLinkedId) { + public void setDistinctIpByLinkedId( + @jakarta.annotation.Nullable VelocityData distinctIpByLinkedId) { this.distinctIpByLinkedId = distinctIpByLinkedId; } - - public Velocity distinctVisitorIdByLinkedId(@jakarta.annotation.Nullable VelocityData distinctVisitorIdByLinkedId) { + public Velocity distinctVisitorIdByLinkedId( + @jakarta.annotation.Nullable VelocityData distinctVisitorIdByLinkedId) { this.distinctVisitorIdByLinkedId = distinctVisitorIdByLinkedId; return this; } @@ -235,19 +204,17 @@ public Velocity distinctVisitorIdByLinkedId(@jakarta.annotation.Nullable Velocit @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_DISTINCT_VISITOR_ID_BY_LINKED_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public VelocityData getDistinctVisitorIdByLinkedId() { return distinctVisitorIdByLinkedId; } - @JsonProperty(value = JSON_PROPERTY_DISTINCT_VISITOR_ID_BY_LINKED_ID, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setDistinctVisitorIdByLinkedId(@jakarta.annotation.Nullable VelocityData distinctVisitorIdByLinkedId) { + public void setDistinctVisitorIdByLinkedId( + @jakarta.annotation.Nullable VelocityData distinctVisitorIdByLinkedId) { this.distinctVisitorIdByLinkedId = distinctVisitorIdByLinkedId; } - /** * Return true if this Velocity object is equal to o. */ @@ -260,18 +227,25 @@ public boolean equals(Object o) { return false; } Velocity velocity = (Velocity) o; - return Objects.equals(this.distinctIp, velocity.distinctIp) && - Objects.equals(this.distinctLinkedId, velocity.distinctLinkedId) && - Objects.equals(this.distinctCountry, velocity.distinctCountry) && - Objects.equals(this.events, velocity.events) && - Objects.equals(this.ipEvents, velocity.ipEvents) && - Objects.equals(this.distinctIpByLinkedId, velocity.distinctIpByLinkedId) && - Objects.equals(this.distinctVisitorIdByLinkedId, velocity.distinctVisitorIdByLinkedId); + return Objects.equals(this.distinctIp, velocity.distinctIp) + && Objects.equals(this.distinctLinkedId, velocity.distinctLinkedId) + && Objects.equals(this.distinctCountry, velocity.distinctCountry) + && Objects.equals(this.events, velocity.events) + && Objects.equals(this.ipEvents, velocity.ipEvents) + && Objects.equals(this.distinctIpByLinkedId, velocity.distinctIpByLinkedId) + && Objects.equals(this.distinctVisitorIdByLinkedId, velocity.distinctVisitorIdByLinkedId); } @Override public int hashCode() { - return Objects.hash(distinctIp, distinctLinkedId, distinctCountry, events, ipEvents, distinctIpByLinkedId, distinctVisitorIdByLinkedId); + return Objects.hash( + distinctIp, + distinctLinkedId, + distinctCountry, + events, + ipEvents, + distinctIpByLinkedId, + distinctVisitorIdByLinkedId); } @Override @@ -283,8 +257,12 @@ public String toString() { sb.append(" distinctCountry: ").append(toIndentedString(distinctCountry)).append("\n"); sb.append(" events: ").append(toIndentedString(events)).append("\n"); sb.append(" ipEvents: ").append(toIndentedString(ipEvents)).append("\n"); - sb.append(" distinctIpByLinkedId: ").append(toIndentedString(distinctIpByLinkedId)).append("\n"); - sb.append(" distinctVisitorIdByLinkedId: ").append(toIndentedString(distinctVisitorIdByLinkedId)).append("\n"); + sb.append(" distinctIpByLinkedId: ") + .append(toIndentedString(distinctIpByLinkedId)) + .append("\n"); + sb.append(" distinctVisitorIdByLinkedId: ") + .append(toIndentedString(distinctVisitorIdByLinkedId)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -299,6 +277,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/VelocityData.java b/sdk/src/main/java/com/fingerprint/v4/model/VelocityData.java index 438c4a96..cdb2db6f 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/VelocityData.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/VelocityData.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,47 +10,35 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** - * 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. */ @JsonPropertyOrder({ VelocityData.JSON_PROPERTY_5MINUTES, VelocityData.JSON_PROPERTY_1HOUR, VelocityData.JSON_PROPERTY_24HOURS }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class VelocityData { public static final String JSON_PROPERTY_5MINUTES = "5_minutes"; - @jakarta.annotation.Nonnull - private Integer _5minutes; + @jakarta.annotation.Nonnull private Integer _5minutes; public static final String JSON_PROPERTY_1HOUR = "1_hour"; - @jakarta.annotation.Nonnull - private Integer _1hour; + @jakarta.annotation.Nonnull private Integer _1hour; public static final String JSON_PROPERTY_24HOURS = "24_hours"; - @jakarta.annotation.Nullable - private Integer _24hours; + @jakarta.annotation.Nullable private Integer _24hours; - public VelocityData() { - } + public VelocityData() {} public VelocityData _5minutes(@jakarta.annotation.Nonnull Integer _5minutes) { this._5minutes = _5minutes; @@ -58,75 +46,66 @@ public VelocityData _5minutes(@jakarta.annotation.Nonnull Integer _5minutes) { } /** - * Count for the last 5 minutes of velocity data, from the time of the event. + * Count for the last 5 minutes of velocity data, from the time of the event. * @return _5minutes */ @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_5MINUTES, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer get5minutes() { return _5minutes; } - @JsonProperty(value = JSON_PROPERTY_5MINUTES, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void set5minutes(@jakarta.annotation.Nonnull Integer _5minutes) { this._5minutes = _5minutes; } - public VelocityData _1hour(@jakarta.annotation.Nonnull Integer _1hour) { this._1hour = _1hour; return this; } /** - * Count for the last 1 hour of velocity data, from the time of the event. + * Count for the last 1 hour of velocity data, from the time of the event. * @return _1hour */ @jakarta.annotation.Nonnull @JsonProperty(value = JSON_PROPERTY_1HOUR, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) - public Integer get1hour() { return _1hour; } - @JsonProperty(value = JSON_PROPERTY_1HOUR, required = true) @JsonInclude(value = JsonInclude.Include.ALWAYS) public void set1hour(@jakarta.annotation.Nonnull Integer _1hour) { this._1hour = _1hour; } - public VelocityData _24hours(@jakarta.annotation.Nullable Integer _24hours) { this._24hours = _24hours; return this; } /** - * 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. + * 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. * @return _24hours */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_24HOURS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Integer get24hours() { return _24hours; } - @JsonProperty(value = JSON_PROPERTY_24HOURS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void set24hours(@jakarta.annotation.Nullable Integer _24hours) { this._24hours = _24hours; } - /** * Return true if this VelocityData object is equal to o. */ @@ -139,9 +118,9 @@ public boolean equals(Object o) { return false; } VelocityData velocityData = (VelocityData) o; - return Objects.equals(this._5minutes, velocityData._5minutes) && - Objects.equals(this._1hour, velocityData._1hour) && - Objects.equals(this._24hours, velocityData._24hours); + return Objects.equals(this._5minutes, velocityData._5minutes) + && Objects.equals(this._1hour, velocityData._1hour) + && Objects.equals(this._24hours, velocityData._24hours); } @Override @@ -170,6 +149,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/VpnConfidence.java b/sdk/src/main/java/com/fingerprint/v4/model/VpnConfidence.java index 43ef0490..f76aec4c 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/VpnConfidence.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/VpnConfidence.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,31 +10,22 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - - import com.fasterxml.jackson.annotation.JsonCreator; import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Locale; /** * A confidence rating for the VPN detection result — \"low\", \"medium\", or \"high\". Depends on the combination of results returned from all VPN detection methods. */ public enum VpnConfidence { - LOW("low"), - + MEDIUM("medium"), - - HIGH("high"); + + HIGH("high"), + + UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED("unsupported_value_sdk_upgrade_required"); private String value; @@ -59,7 +50,6 @@ public static VpnConfidence fromValue(String value) { return b; } } - throw new IllegalArgumentException("Unexpected value '" + value + "'"); + return UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED; } } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/VpnMethods.java b/sdk/src/main/java/com/fingerprint/v4/model/VpnMethods.java index a600d9b8..8c373085 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/VpnMethods.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/VpnMethods.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,22 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * VpnMethods @@ -37,30 +27,26 @@ VpnMethods.JSON_PROPERTY_OS_MISMATCH, VpnMethods.JSON_PROPERTY_RELAY }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class VpnMethods { public static final String JSON_PROPERTY_TIMEZONE_MISMATCH = "timezone_mismatch"; - @jakarta.annotation.Nullable - private Boolean timezoneMismatch; + @jakarta.annotation.Nullable private Boolean timezoneMismatch; public static final String JSON_PROPERTY_PUBLIC_VPN = "public_vpn"; - @jakarta.annotation.Nullable - private Boolean publicVpn; + @jakarta.annotation.Nullable private Boolean publicVpn; public static final String JSON_PROPERTY_AUXILIARY_MOBILE = "auxiliary_mobile"; - @jakarta.annotation.Nullable - private Boolean auxiliaryMobile; + @jakarta.annotation.Nullable private Boolean auxiliaryMobile; public static final String JSON_PROPERTY_OS_MISMATCH = "os_mismatch"; - @jakarta.annotation.Nullable - private Boolean osMismatch; + @jakarta.annotation.Nullable private Boolean osMismatch; public static final String JSON_PROPERTY_RELAY = "relay"; - @jakarta.annotation.Nullable - private Boolean relay; + @jakarta.annotation.Nullable private Boolean relay; - public VpnMethods() { - } + public VpnMethods() {} public VpnMethods timezoneMismatch(@jakarta.annotation.Nullable Boolean timezoneMismatch) { this.timezoneMismatch = timezoneMismatch; @@ -74,19 +60,16 @@ public VpnMethods timezoneMismatch(@jakarta.annotation.Nullable Boolean timezone @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_TIMEZONE_MISMATCH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getTimezoneMismatch() { return timezoneMismatch; } - @JsonProperty(value = JSON_PROPERTY_TIMEZONE_MISMATCH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setTimezoneMismatch(@jakarta.annotation.Nullable Boolean timezoneMismatch) { this.timezoneMismatch = timezoneMismatch; } - public VpnMethods publicVpn(@jakarta.annotation.Nullable Boolean publicVpn) { this.publicVpn = publicVpn; return this; @@ -99,19 +82,16 @@ public VpnMethods publicVpn(@jakarta.annotation.Nullable Boolean publicVpn) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PUBLIC_VPN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getPublicVpn() { return publicVpn; } - @JsonProperty(value = JSON_PROPERTY_PUBLIC_VPN, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setPublicVpn(@jakarta.annotation.Nullable Boolean publicVpn) { this.publicVpn = publicVpn; } - public VpnMethods auxiliaryMobile(@jakarta.annotation.Nullable Boolean auxiliaryMobile) { this.auxiliaryMobile = auxiliaryMobile; return this; @@ -124,19 +104,16 @@ public VpnMethods auxiliaryMobile(@jakarta.annotation.Nullable Boolean auxiliary @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_AUXILIARY_MOBILE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getAuxiliaryMobile() { return auxiliaryMobile; } - @JsonProperty(value = JSON_PROPERTY_AUXILIARY_MOBILE, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setAuxiliaryMobile(@jakarta.annotation.Nullable Boolean auxiliaryMobile) { this.auxiliaryMobile = auxiliaryMobile; } - public VpnMethods osMismatch(@jakarta.annotation.Nullable Boolean osMismatch) { this.osMismatch = osMismatch; return this; @@ -149,44 +126,38 @@ public VpnMethods osMismatch(@jakarta.annotation.Nullable Boolean osMismatch) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_OS_MISMATCH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getOsMismatch() { return osMismatch; } - @JsonProperty(value = JSON_PROPERTY_OS_MISMATCH, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setOsMismatch(@jakarta.annotation.Nullable Boolean osMismatch) { this.osMismatch = osMismatch; } - public VpnMethods relay(@jakarta.annotation.Nullable Boolean relay) { this.relay = relay; return this; } /** - * Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. + * Request IP address belongs to a relay service provider, indicating the use of relay services like [Apple Private relay](https://support.apple.com/en-us/102602) or [Cloudflare Warp](https://developers.cloudflare.com/warp-client/). * Like VPNs, relay services anonymize the visitor's true IP address. * Unlike traditional VPNs, relay services don't let visitors spoof their location by choosing an exit node in a different country. This field allows you to differentiate VPN users and relay service users in your fraud prevention logic. * @return relay */ @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_RELAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public Boolean getRelay() { return relay; } - @JsonProperty(value = JSON_PROPERTY_RELAY, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRelay(@jakarta.annotation.Nullable Boolean relay) { this.relay = relay; } - /** * Return true if this VpnMethods object is equal to o. */ @@ -199,11 +170,11 @@ public boolean equals(Object o) { return false; } VpnMethods vpnMethods = (VpnMethods) o; - return Objects.equals(this.timezoneMismatch, vpnMethods.timezoneMismatch) && - Objects.equals(this.publicVpn, vpnMethods.publicVpn) && - Objects.equals(this.auxiliaryMobile, vpnMethods.auxiliaryMobile) && - Objects.equals(this.osMismatch, vpnMethods.osMismatch) && - Objects.equals(this.relay, vpnMethods.relay); + return Objects.equals(this.timezoneMismatch, vpnMethods.timezoneMismatch) + && Objects.equals(this.publicVpn, vpnMethods.publicVpn) + && Objects.equals(this.auxiliaryMobile, vpnMethods.auxiliaryMobile) + && Objects.equals(this.osMismatch, vpnMethods.osMismatch) + && Objects.equals(this.relay, vpnMethods.relay); } @Override @@ -234,6 +205,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/WebGlBasics.java b/sdk/src/main/java/com/fingerprint/v4/model/WebGlBasics.java index f4b98d2b..4d85e314 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/WebGlBasics.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/WebGlBasics.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,22 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; -import java.util.Arrays; import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * Render and vendor strings reported by the WebGL context. @@ -38,34 +28,29 @@ WebGlBasics.JSON_PROPERTY_RENDERER_UNMASKED, WebGlBasics.JSON_PROPERTY_SHADING_LANGUAGE_VERSION }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class WebGlBasics { public static final String JSON_PROPERTY_VERSION = "version"; - @jakarta.annotation.Nullable - private String version; + @jakarta.annotation.Nullable private String version; public static final String JSON_PROPERTY_VENDOR = "vendor"; - @jakarta.annotation.Nullable - private String vendor; + @jakarta.annotation.Nullable private String vendor; public static final String JSON_PROPERTY_VENDOR_UNMASKED = "vendor_unmasked"; - @jakarta.annotation.Nullable - private String vendorUnmasked; + @jakarta.annotation.Nullable private String vendorUnmasked; public static final String JSON_PROPERTY_RENDERER = "renderer"; - @jakarta.annotation.Nullable - private String renderer; + @jakarta.annotation.Nullable private String renderer; public static final String JSON_PROPERTY_RENDERER_UNMASKED = "renderer_unmasked"; - @jakarta.annotation.Nullable - private String rendererUnmasked; + @jakarta.annotation.Nullable private String rendererUnmasked; public static final String JSON_PROPERTY_SHADING_LANGUAGE_VERSION = "shading_language_version"; - @jakarta.annotation.Nullable - private String shadingLanguageVersion; + @jakarta.annotation.Nullable private String shadingLanguageVersion; - public WebGlBasics() { - } + public WebGlBasics() {} public WebGlBasics version(@jakarta.annotation.Nullable String version) { this.version = version; @@ -79,19 +64,16 @@ public WebGlBasics version(@jakarta.annotation.Nullable String version) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_VERSION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getVersion() { return version; } - @JsonProperty(value = JSON_PROPERTY_VERSION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVersion(@jakarta.annotation.Nullable String version) { this.version = version; } - public WebGlBasics vendor(@jakarta.annotation.Nullable String vendor) { this.vendor = vendor; return this; @@ -104,19 +86,16 @@ public WebGlBasics vendor(@jakarta.annotation.Nullable String vendor) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_VENDOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getVendor() { return vendor; } - @JsonProperty(value = JSON_PROPERTY_VENDOR, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVendor(@jakarta.annotation.Nullable String vendor) { this.vendor = vendor; } - public WebGlBasics vendorUnmasked(@jakarta.annotation.Nullable String vendorUnmasked) { this.vendorUnmasked = vendorUnmasked; return this; @@ -129,19 +108,16 @@ public WebGlBasics vendorUnmasked(@jakarta.annotation.Nullable String vendorUnma @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_VENDOR_UNMASKED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getVendorUnmasked() { return vendorUnmasked; } - @JsonProperty(value = JSON_PROPERTY_VENDOR_UNMASKED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setVendorUnmasked(@jakarta.annotation.Nullable String vendorUnmasked) { this.vendorUnmasked = vendorUnmasked; } - public WebGlBasics renderer(@jakarta.annotation.Nullable String renderer) { this.renderer = renderer; return this; @@ -154,19 +130,16 @@ public WebGlBasics renderer(@jakarta.annotation.Nullable String renderer) { @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_RENDERER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRenderer() { return renderer; } - @JsonProperty(value = JSON_PROPERTY_RENDERER, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRenderer(@jakarta.annotation.Nullable String renderer) { this.renderer = renderer; } - public WebGlBasics rendererUnmasked(@jakarta.annotation.Nullable String rendererUnmasked) { this.rendererUnmasked = rendererUnmasked; return this; @@ -179,20 +152,18 @@ public WebGlBasics rendererUnmasked(@jakarta.annotation.Nullable String renderer @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_RENDERER_UNMASKED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getRendererUnmasked() { return rendererUnmasked; } - @JsonProperty(value = JSON_PROPERTY_RENDERER_UNMASKED, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setRendererUnmasked(@jakarta.annotation.Nullable String rendererUnmasked) { this.rendererUnmasked = rendererUnmasked; } - - public WebGlBasics shadingLanguageVersion(@jakarta.annotation.Nullable String shadingLanguageVersion) { + public WebGlBasics shadingLanguageVersion( + @jakarta.annotation.Nullable String shadingLanguageVersion) { this.shadingLanguageVersion = shadingLanguageVersion; return this; } @@ -204,19 +175,17 @@ public WebGlBasics shadingLanguageVersion(@jakarta.annotation.Nullable String sh @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SHADING_LANGUAGE_VERSION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getShadingLanguageVersion() { return shadingLanguageVersion; } - @JsonProperty(value = JSON_PROPERTY_SHADING_LANGUAGE_VERSION, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setShadingLanguageVersion(@jakarta.annotation.Nullable String shadingLanguageVersion) { + public void setShadingLanguageVersion( + @jakarta.annotation.Nullable String shadingLanguageVersion) { this.shadingLanguageVersion = shadingLanguageVersion; } - /** * Return true if this WebGlBasics object is equal to o. */ @@ -229,17 +198,18 @@ public boolean equals(Object o) { return false; } WebGlBasics webGlBasics = (WebGlBasics) o; - return Objects.equals(this.version, webGlBasics.version) && - Objects.equals(this.vendor, webGlBasics.vendor) && - Objects.equals(this.vendorUnmasked, webGlBasics.vendorUnmasked) && - Objects.equals(this.renderer, webGlBasics.renderer) && - Objects.equals(this.rendererUnmasked, webGlBasics.rendererUnmasked) && - Objects.equals(this.shadingLanguageVersion, webGlBasics.shadingLanguageVersion); + return Objects.equals(this.version, webGlBasics.version) + && Objects.equals(this.vendor, webGlBasics.vendor) + && Objects.equals(this.vendorUnmasked, webGlBasics.vendorUnmasked) + && Objects.equals(this.renderer, webGlBasics.renderer) + && Objects.equals(this.rendererUnmasked, webGlBasics.rendererUnmasked) + && Objects.equals(this.shadingLanguageVersion, webGlBasics.shadingLanguageVersion); } @Override public int hashCode() { - return Objects.hash(version, vendor, vendorUnmasked, renderer, rendererUnmasked, shadingLanguageVersion); + return Objects.hash( + version, vendor, vendorUnmasked, renderer, rendererUnmasked, shadingLanguageVersion); } @Override @@ -251,7 +221,9 @@ public String toString() { sb.append(" vendorUnmasked: ").append(toIndentedString(vendorUnmasked)).append("\n"); sb.append(" renderer: ").append(toIndentedString(renderer)).append("\n"); sb.append(" rendererUnmasked: ").append(toIndentedString(rendererUnmasked)).append("\n"); - sb.append(" shadingLanguageVersion: ").append(toIndentedString(shadingLanguageVersion)).append("\n"); + sb.append(" shadingLanguageVersion: ") + .append(toIndentedString(shadingLanguageVersion)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -266,6 +238,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/model/WebGlExtensions.java b/sdk/src/main/java/com/fingerprint/v4/model/WebGlExtensions.java index 2043a483..60402b49 100644 --- a/sdk/src/main/java/com/fingerprint/v4/model/WebGlExtensions.java +++ b/sdk/src/main/java/com/fingerprint/v4/model/WebGlExtensions.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,24 +10,14 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.model; -import java.util.Objects; -import java.util.Map; -import java.util.HashMap; -import java.util.Locale; import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonCreator; -import com.fasterxml.jackson.annotation.JsonTypeName; -import com.fasterxml.jackson.annotation.JsonValue; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -import com.fasterxml.jackson.annotation.JsonPropertyOrder; -import com.fingerprint.v4.sdk.JSON; - +import java.util.Objects; /** * Hashes of WebGL context attributes and extension support. @@ -40,34 +30,29 @@ WebGlExtensions.JSON_PROPERTY_EXTENSION_PARAMETERS, WebGlExtensions.JSON_PROPERTY_UNSUPPORTED_EXTENSIONS }) -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class WebGlExtensions { public static final String JSON_PROPERTY_CONTEXT_ATTRIBUTES = "context_attributes"; - @jakarta.annotation.Nullable - private String contextAttributes; + @jakarta.annotation.Nullable private String contextAttributes; public static final String JSON_PROPERTY_PARAMETERS = "parameters"; - @jakarta.annotation.Nullable - private String parameters; + @jakarta.annotation.Nullable private String parameters; public static final String JSON_PROPERTY_SHADER_PRECISIONS = "shader_precisions"; - @jakarta.annotation.Nullable - private String shaderPrecisions; + @jakarta.annotation.Nullable private String shaderPrecisions; public static final String JSON_PROPERTY_EXTENSIONS = "extensions"; - @jakarta.annotation.Nullable - private String extensions; + @jakarta.annotation.Nullable private String extensions; public static final String JSON_PROPERTY_EXTENSION_PARAMETERS = "extension_parameters"; - @jakarta.annotation.Nullable - private String extensionParameters; + @jakarta.annotation.Nullable private String extensionParameters; public static final String JSON_PROPERTY_UNSUPPORTED_EXTENSIONS = "unsupported_extensions"; - @jakarta.annotation.Nullable - private List unsupportedExtensions = new ArrayList<>(); + @jakarta.annotation.Nullable private List unsupportedExtensions = new ArrayList<>(); - public WebGlExtensions() { - } + public WebGlExtensions() {} public WebGlExtensions contextAttributes(@jakarta.annotation.Nullable String contextAttributes) { this.contextAttributes = contextAttributes; @@ -81,19 +66,16 @@ public WebGlExtensions contextAttributes(@jakarta.annotation.Nullable String con @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_CONTEXT_ATTRIBUTES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getContextAttributes() { return contextAttributes; } - @JsonProperty(value = JSON_PROPERTY_CONTEXT_ATTRIBUTES, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setContextAttributes(@jakarta.annotation.Nullable String contextAttributes) { this.contextAttributes = contextAttributes; } - public WebGlExtensions parameters(@jakarta.annotation.Nullable String parameters) { this.parameters = parameters; return this; @@ -106,19 +88,16 @@ public WebGlExtensions parameters(@jakarta.annotation.Nullable String parameters @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_PARAMETERS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getParameters() { return parameters; } - @JsonProperty(value = JSON_PROPERTY_PARAMETERS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setParameters(@jakarta.annotation.Nullable String parameters) { this.parameters = parameters; } - public WebGlExtensions shaderPrecisions(@jakarta.annotation.Nullable String shaderPrecisions) { this.shaderPrecisions = shaderPrecisions; return this; @@ -131,19 +110,16 @@ public WebGlExtensions shaderPrecisions(@jakarta.annotation.Nullable String shad @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_SHADER_PRECISIONS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getShaderPrecisions() { return shaderPrecisions; } - @JsonProperty(value = JSON_PROPERTY_SHADER_PRECISIONS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setShaderPrecisions(@jakarta.annotation.Nullable String shaderPrecisions) { this.shaderPrecisions = shaderPrecisions; } - public WebGlExtensions extensions(@jakarta.annotation.Nullable String extensions) { this.extensions = extensions; return this; @@ -156,20 +132,18 @@ public WebGlExtensions extensions(@jakarta.annotation.Nullable String extensions @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_EXTENSIONS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getExtensions() { return extensions; } - @JsonProperty(value = JSON_PROPERTY_EXTENSIONS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExtensions(@jakarta.annotation.Nullable String extensions) { this.extensions = extensions; } - - public WebGlExtensions extensionParameters(@jakarta.annotation.Nullable String extensionParameters) { + public WebGlExtensions extensionParameters( + @jakarta.annotation.Nullable String extensionParameters) { this.extensionParameters = extensionParameters; return this; } @@ -181,20 +155,18 @@ public WebGlExtensions extensionParameters(@jakarta.annotation.Nullable String e @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_EXTENSION_PARAMETERS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public String getExtensionParameters() { return extensionParameters; } - @JsonProperty(value = JSON_PROPERTY_EXTENSION_PARAMETERS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) public void setExtensionParameters(@jakarta.annotation.Nullable String extensionParameters) { this.extensionParameters = extensionParameters; } - - public WebGlExtensions unsupportedExtensions(@jakarta.annotation.Nullable List unsupportedExtensions) { + public WebGlExtensions unsupportedExtensions( + @jakarta.annotation.Nullable List unsupportedExtensions) { this.unsupportedExtensions = unsupportedExtensions; return this; } @@ -214,19 +186,17 @@ public WebGlExtensions addUnsupportedExtensionsItem(String unsupportedExtensions @jakarta.annotation.Nullable @JsonProperty(value = JSON_PROPERTY_UNSUPPORTED_EXTENSIONS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public List getUnsupportedExtensions() { return unsupportedExtensions; } - @JsonProperty(value = JSON_PROPERTY_UNSUPPORTED_EXTENSIONS, required = false) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) - public void setUnsupportedExtensions(@jakarta.annotation.Nullable List unsupportedExtensions) { + public void setUnsupportedExtensions( + @jakarta.annotation.Nullable List unsupportedExtensions) { this.unsupportedExtensions = unsupportedExtensions; } - /** * Return true if this WebGlExtensions object is equal to o. */ @@ -239,17 +209,23 @@ public boolean equals(Object o) { return false; } WebGlExtensions webGlExtensions = (WebGlExtensions) o; - return Objects.equals(this.contextAttributes, webGlExtensions.contextAttributes) && - Objects.equals(this.parameters, webGlExtensions.parameters) && - Objects.equals(this.shaderPrecisions, webGlExtensions.shaderPrecisions) && - Objects.equals(this.extensions, webGlExtensions.extensions) && - Objects.equals(this.extensionParameters, webGlExtensions.extensionParameters) && - Objects.equals(this.unsupportedExtensions, webGlExtensions.unsupportedExtensions); + return Objects.equals(this.contextAttributes, webGlExtensions.contextAttributes) + && Objects.equals(this.parameters, webGlExtensions.parameters) + && Objects.equals(this.shaderPrecisions, webGlExtensions.shaderPrecisions) + && Objects.equals(this.extensions, webGlExtensions.extensions) + && Objects.equals(this.extensionParameters, webGlExtensions.extensionParameters) + && Objects.equals(this.unsupportedExtensions, webGlExtensions.unsupportedExtensions); } @Override public int hashCode() { - return Objects.hash(contextAttributes, parameters, shaderPrecisions, extensions, extensionParameters, unsupportedExtensions); + return Objects.hash( + contextAttributes, + parameters, + shaderPrecisions, + extensions, + extensionParameters, + unsupportedExtensions); } @Override @@ -260,8 +236,12 @@ public String toString() { sb.append(" parameters: ").append(toIndentedString(parameters)).append("\n"); sb.append(" shaderPrecisions: ").append(toIndentedString(shaderPrecisions)).append("\n"); sb.append(" extensions: ").append(toIndentedString(extensions)).append("\n"); - sb.append(" extensionParameters: ").append(toIndentedString(extensionParameters)).append("\n"); - sb.append(" unsupportedExtensions: ").append(toIndentedString(unsupportedExtensions)).append("\n"); + sb.append(" extensionParameters: ") + .append(toIndentedString(extensionParameters)) + .append("\n"); + sb.append(" unsupportedExtensions: ") + .append(toIndentedString(unsupportedExtensions)) + .append("\n"); sb.append("}"); return sb.toString(); } @@ -276,6 +256,4 @@ private String toIndentedString(Object o) { } return o.toString().replace("\n", "\n "); } - } - diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/ApiClient.java b/sdk/src/main/java/com/fingerprint/v4/sdk/ApiClient.java index af3e279e..f6d4d35a 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/ApiClient.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/ApiClient.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,9 +10,12 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.sdk; +import com.fingerprint.v4.sdk.auth.ApiKeyAuth; +import com.fingerprint.v4.sdk.auth.Authentication; +import com.fingerprint.v4.sdk.auth.HttpBasicAuth; +import com.fingerprint.v4.sdk.auth.HttpBearerAuth; import jakarta.ws.rs.client.Client; import jakarta.ws.rs.client.ClientBuilder; import jakarta.ws.rs.client.Entity; @@ -23,70 +26,57 @@ import jakarta.ws.rs.core.MediaType; import jakarta.ws.rs.core.Response; import jakarta.ws.rs.core.Response.Status; - -import org.glassfish.jersey.client.ClientConfig; -import org.glassfish.jersey.client.ClientProperties; -import org.glassfish.jersey.client.HttpUrlConnectorProvider; -import org.glassfish.jersey.jackson.JacksonFeature; -import org.glassfish.jersey.media.multipart.FormDataBodyPart; -import org.glassfish.jersey.media.multipart.FormDataContentDisposition; -import org.glassfish.jersey.media.multipart.MultiPart; -import org.glassfish.jersey.media.multipart.MultiPartFeature; - +import java.io.File; import java.io.IOException; import java.io.InputStream; - +import java.io.UnsupportedEncodingException; import java.net.URI; -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManager; -import javax.net.ssl.X509TrustManager; -import java.security.cert.X509Certificate; -import java.security.KeyManagementException; -import java.security.NoSuchAlgorithmException; -import java.security.SecureRandom; +import java.net.URLEncoder; import java.nio.file.Files; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; -import org.glassfish.jersey.logging.LoggingFeature; -import java.util.AbstractMap.SimpleEntry; -import java.util.logging.Level; -import java.util.logging.Logger; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.security.cert.X509Certificate; +import java.text.DateFormat; +import java.time.OffsetDateTime; +import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.Collections; -import java.util.Map; -import java.util.Map.Entry; +import java.util.Date; import java.util.HashMap; import java.util.LinkedHashMap; -import java.util.LinkedHashSet; import java.util.List; -import java.util.Arrays; -import java.util.ArrayList; -import java.util.Date; import java.util.Locale; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import java.time.OffsetDateTime; - -import java.net.URLEncoder; - -import java.io.File; -import java.io.UnsupportedEncodingException; - -import java.text.DateFormat; +import java.util.Map; +import java.util.Map.Entry; +import java.util.logging.Logger; import java.util.regex.Matcher; import java.util.regex.Pattern; - -import com.fingerprint.v4.sdk.auth.Authentication; -import com.fingerprint.v4.sdk.auth.HttpBasicAuth; -import com.fingerprint.v4.sdk.auth.HttpBearerAuth; -import com.fingerprint.v4.sdk.auth.ApiKeyAuth; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.client.ClientProperties; +import org.glassfish.jersey.client.HttpUrlConnectorProvider; +import org.glassfish.jersey.jackson.JacksonFeature; +import org.glassfish.jersey.logging.LoggingFeature; +import org.glassfish.jersey.media.multipart.FormDataBodyPart; +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.MultiPart; +import org.glassfish.jersey.media.multipart.MultiPartFeature; /** *

ApiClient class.

*/ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class ApiClient extends JavaTimeFormatter { - protected static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + protected static final Pattern JSON_MIME_PATTERN = + Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); protected Map defaultHeaderMap = new HashMap<>(); protected Map defaultCookieMap = new HashMap<>(); @@ -94,23 +84,13 @@ public class ApiClient extends JavaTimeFormatter { protected String userAgent; protected static final Logger log = Logger.getLogger(ApiClient.class.getName()); - protected List servers = new ArrayList<>(Arrays.asList( - new ServerConfiguration( - "https://api.fpjs.io/v4", - "Global", - new LinkedHashMap<>() - ), - new ServerConfiguration( - "https://eu.api.fpjs.io/v4", - "EU", - new LinkedHashMap<>() - ), - new ServerConfiguration( - "https://ap.api.fpjs.io/v4", - "Asia (Mumbai)", - new LinkedHashMap<>() - ) - )); + protected List servers = + new ArrayList<>( + Arrays.asList( + new ServerConfiguration("https://api.fpjs.io/v4", "Global", new LinkedHashMap<>()), + new ServerConfiguration("https://eu.api.fpjs.io/v4", "EU", new LinkedHashMap<>()), + new ServerConfiguration( + "https://ap.api.fpjs.io/v4", "Asia (Mumbai)", new LinkedHashMap<>()))); protected Integer serverIndex = 0; protected Map serverVariables = null; protected Map> operationServers = new HashMap<>(); @@ -142,6 +122,8 @@ public ApiClient() { * * @param authMap A hash map containing authentication parameters. */ + // Suppress a known issue warning with the HTTP client extension mechanism + @SuppressWarnings("this-escape") public ApiClient(Map authMap) { json = new JSON(); httpClient = buildHttpClient(); @@ -283,7 +265,7 @@ public ApiClient setServerVariables(Map serverVariables) { protected void updateBasePath() { if (serverIndex != null) { - setBasePath(servers.get(serverIndex).URL(serverVariables)); + setBasePath(servers.get(serverIndex).URL(serverVariables)); } } @@ -425,7 +407,7 @@ public ApiClient setUserAgent(String userAgent) { * * @return User-Agent string */ - public String getUserAgent(){ + public String getUserAgent() { return userAgent; } @@ -627,8 +609,8 @@ public String parameterToString(Object param) { return formatOffsetDateTime((OffsetDateTime) param); } else if (param instanceof Collection) { StringBuilder b = new StringBuilder(); - for(Object o : (Collection)param) { - if(b.length() > 0) { + for (Object o : (Collection) param) { + if (b.length() > 0) { b.append(','); } b.append(String.valueOf(o)); @@ -647,7 +629,7 @@ public String parameterToString(Object param) { * @param value Value * @return List of pairs */ - public List parameterToPairs(String collectionFormat, String name, Object value){ + public List parameterToPairs(String collectionFormat, String name, Object value) { List params = new ArrayList<>(); // preconditions @@ -661,12 +643,13 @@ public List parameterToPairs(String collectionFormat, String name, Object return params; } - if (valueCollection.isEmpty()){ + if (valueCollection.isEmpty()) { return params; } // get the collection format (default: csv) - String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); + String format = + (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); // create the params based on the collection format if ("multi".equals(format)) { @@ -689,7 +672,7 @@ public List parameterToPairs(String collectionFormat, String name, Object delimiter = "|"; } - StringBuilder sb = new StringBuilder() ; + StringBuilder sb = new StringBuilder(); for (Object item : valueCollection) { sb.append(delimiter); sb.append(parameterToString(item)); @@ -782,13 +765,16 @@ public String escapeString(String str) { * @return Entity * @throws ApiException API exception */ - public Entity serialize(Object obj, Map formParams, String contentType, boolean isBodyNullable) throws ApiException { + public Entity serialize( + Object obj, Map formParams, String contentType, boolean isBodyNullable) + throws ApiException { Entity entity; if (contentType.startsWith("multipart/form-data")) { MultiPart multiPart = new MultiPart(); - for (Entry param: formParams.entrySet()) { + for (Entry param : formParams.entrySet()) { if (param.getValue() instanceof Iterable) { - ((Iterable)param.getValue()).forEach(v -> addParamToMultipart(v, param.getKey(), multiPart)); + ((Iterable) param.getValue()) + .forEach(v -> addParamToMultipart(v, param.getKey(), multiPart)); } else { addParamToMultipart(param.getValue(), param.getKey(), multiPart); } @@ -796,7 +782,7 @@ public Entity serialize(Object obj, Map formParams, String co entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE); } else if (contentType.startsWith("application/x-www-form-urlencoded")) { Form form = new Form(); - for (Entry param: formParams.entrySet()) { + for (Entry param : formParams.entrySet()) { form.param(param.getKey(), parameterToString(param.getValue())); } entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); @@ -804,13 +790,27 @@ public Entity serialize(Object obj, Map formParams, String co // We let jersey handle the serialization if (isBodyNullable) { // payload is nullable if (obj instanceof String) { - entity = Entity.entity(obj == null ? "null" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); + entity = + Entity.entity( + obj == null + ? "null" + : "\"" + + ((String) obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + + "\"", + contentType); } else { entity = Entity.entity(obj == null ? "null" : obj, contentType); } } else { if (obj instanceof String) { - entity = Entity.entity(obj == null ? "" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); + entity = + Entity.entity( + obj == null + ? "" + : "\"" + + ((String) obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + + "\"", + contentType); } else { entity = Entity.entity(obj == null ? "" : obj, contentType); } @@ -830,8 +830,8 @@ public Entity serialize(Object obj, Map formParams, String co protected void addParamToMultipart(Object value, String key, MultiPart multiPart) { if (value instanceof File) { File file = (File) value; - FormDataContentDisposition contentDisp = FormDataContentDisposition.name(key) - .fileName(file.getName()).size(file.length()).build(); + FormDataContentDisposition contentDisp = + FormDataContentDisposition.name(key).fileName(file.getName()).size(file.length()).build(); // Attempt to probe the content type for the file so that the form part is more correctly // and precisely identified, but fall back to application/octet-stream if that fails. @@ -847,7 +847,7 @@ protected void addParamToMultipart(Object value, String key, MultiPart multiPart FormDataContentDisposition contentDisp = FormDataContentDisposition.name(key).build(); multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(value))); } - } + } /** * Serialize the given Java object into string according the given @@ -860,14 +860,21 @@ protected void addParamToMultipart(Object value, String key, MultiPart multiPart * @return String * @throws ApiException API exception */ - public String serializeToString(Object obj, Map formParams, String contentType, boolean isBodyNullable) throws ApiException { + public String serializeToString( + Object obj, Map formParams, String contentType, boolean isBodyNullable) + throws ApiException { try { if (contentType.startsWith("multipart/form-data")) { - throw new ApiException("multipart/form-data not yet supported for serializeToString (http signature authentication)"); + throw new ApiException( + "multipart/form-data not yet supported for serializeToString (http signature authentication)"); } else if (contentType.startsWith("application/x-www-form-urlencoded")) { String formString = ""; for (Entry param : formParams.entrySet()) { - formString = param.getKey() + "=" + URLEncoder.encode(parameterToString(param.getValue()), "UTF-8") + "&"; + formString = + param.getKey() + + "=" + + URLEncoder.encode(parameterToString(param.getValue()), "UTF-8") + + "&"; } if (formString.length() == 0) { // empty string @@ -927,7 +934,10 @@ public T deserialize(Response response, GenericType returnType) throws Ap public File downloadFileFromResponse(Response response) throws ApiException { try { File file = prepareDownloadFile(response); - Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING); + Files.copy( + response.readEntity(InputStream.class), + file.toPath(), + StandardCopyOption.REPLACE_EXISTING); return file; } catch (IOException e) { throw new ApiException(e); @@ -948,8 +958,7 @@ public File prepareDownloadFile(Response response) throws IOException { // Get filename from the Content-Disposition header. Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); Matcher matcher = pattern.matcher(contentDisposition); - if (matcher.find()) - filename = matcher.group(1); + if (matcher.find()) filename = matcher.group(1); } String prefix; @@ -966,14 +975,11 @@ public File prepareDownloadFile(Response response) throws IOException { suffix = filename.substring(pos); } // Files.createTempFile requires the prefix to be at least three characters long - if (prefix.length() < 3) - prefix = "download-"; + if (prefix.length() < 3) prefix = "download-"; } - if (tempFolderPath == null) - return Files.createTempFile(prefix, suffix).toFile(); - else - return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + if (tempFolderPath == null) return Files.createTempFile(prefix, suffix).toFile(); + else return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); } /** @@ -1016,13 +1022,15 @@ public ApiResponse invokeAPI( List serverConfigurations; if (serverIndex != null && (serverConfigurations = operationServers.get(operation)) != null) { int index = operationServerIndex.getOrDefault(operation, serverIndex).intValue(); - Map variables = operationServerVariables.getOrDefault(operation, serverVariables); + Map variables = + operationServerVariables.getOrDefault(operation, serverVariables); if (index < 0 || index >= serverConfigurations.size()) { throw new ArrayIndexOutOfBoundsException( String.format( Locale.ROOT, "Invalid index %d when selecting the host settings. Must be less than %d", - index, serverConfigurations.size())); + index, + serverConfigurations.size())); } targetURL = serverConfigurations.get(index).URL(variables) + path; } else { @@ -1039,13 +1047,7 @@ public ApiResponse invokeAPI( if (authNames != null) { // update different parameters (e.g. headers) for authentication updateParamsForAuth( - authNames, - queryParams, - allHeaderParams, - cookieParams, - null, - method, - target.getUri()); + authNames, queryParams, allHeaderParams, cookieParams, null, method, target.getUri()); } if (queryParams != null) { @@ -1126,7 +1128,8 @@ public ApiResponse invokeAPI( } } - protected Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity entity) { + protected Response sendRequest( + String method, Invocation.Builder invocationBuilder, Entity entity) { Response response; if ("POST".equals(method)) { response = invocationBuilder.post(entity); @@ -1150,8 +1153,34 @@ protected Response sendRequest(String method, Invocation.Builder invocationBuild * @deprecated Add qualified name of the operation as a first parameter. */ @Deprecated - public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, boolean isBodyNullable) throws ApiException { - return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable); + public ApiResponse invokeAPI( + String path, + String method, + List queryParams, + Object body, + Map headerParams, + Map cookieParams, + Map formParams, + String accept, + String contentType, + String[] authNames, + GenericType returnType, + boolean isBodyNullable) + throws ApiException { + return invokeAPI( + null, + path, + method, + queryParams, + body, + headerParams, + cookieParams, + formParams, + accept, + contentType, + authNames, + returnType, + isBodyNullable); } /** @@ -1190,13 +1219,21 @@ public ClientConfig getDefaultClientConfig() { protected void applyDebugSetting(ClientConfig clientConfig) { if (debugging) { - clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); - clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); + clientConfig.register( + new LoggingFeature( + java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), + java.util.logging.Level.INFO, + LoggingFeature.Verbosity.PAYLOAD_ANY, + 1024 * 50 /* Log payloads up to 50K */)); + clientConfig.property( + LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); // Set logger to ALL - java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); + java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME) + .setLevel(java.util.logging.Level.ALL); } else { // suppress warnings for payloads with DELETE calls: - java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); + java.util.logging.Logger.getLogger("org.glassfish.jersey.client") + .setLevel(java.util.logging.Level.SEVERE); } } @@ -1230,21 +1267,23 @@ protected void customizeClientBuilder(ClientBuilder clientBuilder) { * @throws java.security.KeyManagementException if any. * @throws java.security.NoSuchAlgorithmException if any. */ - protected void disableCertificateValidation(ClientBuilder clientBuilder) throws KeyManagementException, NoSuchAlgorithmException { - TrustManager[] trustAllCerts = new X509TrustManager[] { - new X509TrustManager() { - @Override - public X509Certificate[] getAcceptedIssuers() { - return null; - } - @Override - public void checkClientTrusted(X509Certificate[] certs, String authType) { - } - @Override - public void checkServerTrusted(X509Certificate[] certs, String authType) { - } - } - }; + protected void disableCertificateValidation(ClientBuilder clientBuilder) + throws KeyManagementException, NoSuchAlgorithmException { + TrustManager[] trustAllCerts = + new X509TrustManager[] { + new X509TrustManager() { + @Override + public X509Certificate[] getAcceptedIssuers() { + return null; + } + + @Override + public void checkClientTrusted(X509Certificate[] certs, String authType) {} + + @Override + public void checkServerTrusted(X509Certificate[] certs, String authType) {} + } + }; SSLContext sslContext = SSLContext.getInstance("TLS"); sslContext.init(null, trustAllCerts, new SecureRandom()); clientBuilder.sslContext(sslContext); @@ -1258,7 +1297,7 @@ public void checkServerTrusted(X509Certificate[] certs, String authType) { */ protected Map> buildResponseHeaders(Response response) { Map> responseHeaders = new HashMap<>(); - for (Entry> entry: response.getHeaders().entrySet()) { + for (Entry> entry : response.getHeaders().entrySet()) { List values = entry.getValue(); List headers = new ArrayList<>(); for (Object o : values) { @@ -1279,8 +1318,15 @@ protected Map> buildResponseHeaders(Response response) { * @param method HTTP method (e.g. POST) * @param uri HTTP URI */ - protected void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, - Map cookieParams, String payload, String method, URI uri) throws ApiException { + protected void updateParamsForAuth( + String[] authNames, + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException { for (String authName : authNames) { Authentication auth = authentications.get(authName); if (auth == null) { @@ -1289,4 +1335,4 @@ protected void updateParamsForAuth(String[] authNames, List queryParams, M auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); } } -} \ No newline at end of file +} diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/ApiException.java b/sdk/src/main/java/com/fingerprint/v4/sdk/ApiException.java index 8c457cb3..92347e0c 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/ApiException.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/ApiException.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,87 +10,96 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.sdk; -import java.util.Map; import java.util.List; +import java.util.Map; /** * API Exception */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class ApiException extends Exception { - private static final long serialVersionUID = 1L; - - private int code = 0; - private Map> responseHeaders = null; - private String responseBody = null; - - public ApiException() {} - - public ApiException(Throwable throwable) { - super(throwable); - } - - public ApiException(String message) { - super(message); - } - - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { - super(message, throwable); - this.code = code; - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } - - public ApiException(String message, int code, Map> responseHeaders, String responseBody) { - this(message, (Throwable) null, code, responseHeaders, responseBody); - } - - public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { - this(message, throwable, code, responseHeaders, null); - } - - public ApiException(int code, Map> responseHeaders, String responseBody) { - this((String) null, (Throwable) null, code, responseHeaders, responseBody); - } - - public ApiException(int code, String message) { - super(message); - this.code = code; - } - - public ApiException(int code, String message, Map> responseHeaders, String responseBody) { - this(code, message); - this.responseHeaders = responseHeaders; - this.responseBody = responseBody; - } - - /** - * Get the HTTP status code. - * - * @return HTTP status code - */ - public int getCode() { - return code; - } - - /** - * Get the HTTP response headers. - * - * @return A map of list of string - */ - public Map> getResponseHeaders() { - return responseHeaders; - } - - /** - * Get the HTTP response body. - * - * @return Response body in the form of string - */ - public String getResponseBody() { - return responseBody; - } + private static final long serialVersionUID = 5994704121876855946L; + + private int code = 0; + private transient Map> responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException( + String message, + Throwable throwable, + int code, + Map> responseHeaders, + String responseBody) { + super(message, throwable); + this.code = code; + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + public ApiException( + String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException( + String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, Map> responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException( + int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + this.responseHeaders = responseHeaders; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } } diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/ApiResponse.java b/sdk/src/main/java/com/fingerprint/v4/sdk/ApiResponse.java index 7dab6f56..1c8be77f 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/ApiResponse.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/ApiResponse.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,7 +10,6 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.sdk; import java.util.List; @@ -22,53 +21,53 @@ * @param The type of data that is deserialized from response body */ public class ApiResponse { - private final int statusCode; - private final Map> headers; - private final T data; + private final int statusCode; + private final Map> headers; + private final T data; - /** - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - */ - public ApiResponse(int statusCode, Map> headers) { - this(statusCode, headers, null); - } + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + */ + public ApiResponse(int statusCode, Map> headers) { + this(statusCode, headers, null); + } - /** - * @param statusCode The status code of HTTP response - * @param headers The headers of HTTP response - * @param data The object deserialized from response bod - */ - public ApiResponse(int statusCode, Map> headers, T data) { - this.statusCode = statusCode; - this.headers = headers; - this.data = data; - } + /** + * @param statusCode The status code of HTTP response + * @param headers The headers of HTTP response + * @param data The object deserialized from response bod + */ + public ApiResponse(int statusCode, Map> headers, T data) { + this.statusCode = statusCode; + this.headers = headers; + this.data = data; + } - /** - * Get the status code - * - * @return status code - */ - public int getStatusCode() { - return statusCode; - } + /** + * Get the status code + * + * @return status code + */ + public int getStatusCode() { + return statusCode; + } - /** - * Get the headers - * - * @return map of headers - */ - public Map> getHeaders() { - return headers; - } + /** + * Get the headers + * + * @return map of headers + */ + public Map> getHeaders() { + return headers; + } - /** - * Get the data - * - * @return data - */ - public T getData() { - return data; - } + /** + * Get the data + * + * @return data + */ + public T getData() { + return data; + } } diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/Configuration.java b/sdk/src/main/java/com/fingerprint/v4/sdk/Configuration.java index 484bb0de..e326a165 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/Configuration.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/Configuration.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,100 +10,103 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.sdk; import java.util.Objects; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Supplier; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0")public class Configuration { - private static final AtomicReference defaultApiClient = new AtomicReference<>(); - private static volatile Supplier apiClientFactory = ApiClient::new; +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") +public class Configuration { + private static final AtomicReference defaultApiClient = new AtomicReference<>(); + private static volatile Supplier apiClientFactory = ApiClient::new; - /** - * Get the default API client, which would be used when creating API - * instances without providing an API client. - * - * @return Default API client - */ - public static ApiClient getDefaultApiClient() { - ApiClient client = defaultApiClient.get(); - if (client == null) { - client = defaultApiClient.updateAndGet(val -> { + /** + * Get the default API client, which would be used when creating API + * instances without providing an API client. + * + * @return Default API client + */ + public static ApiClient getDefaultApiClient() { + ApiClient client = defaultApiClient.get(); + if (client == null) { + client = + defaultApiClient.updateAndGet( + val -> { if (val != null) { // changed by another thread - return val; + return val; } return apiClientFactory.get(); - }); - } - return client; - } - - public static ApiClient getDefaultApiClient(String apiKey, Region region) { - ApiClient client = getDefaultApiClient(); - client.setBearerToken(apiKey); - client.setBasePath(region.toString()); - return client; + }); } + return client; + } - public static ApiClient getDefaultApiClient(String apiKey, String regionStr) { - ApiClient client = getDefaultApiClient(); - switch (regionStr) { - case "eu": - case "EU": - case "EUROPE": - case "europe": - client.setBasePath(Region.EUROPE.toString()); - break; - case "global": - case "GLOBAL": - case "us": - case "US": - case "usa": - case "USA": - case "America": - case "america": - case "AMERICA": - client.setBasePath(Region.GLOBAL.toString()); - break; - case "asia": - case "Asia": - case "as": - case "AS": - client.setBasePath(Region.ASIA.toString()); - break; - default: - client.setBasePath(regionStr); - } - client.setBearerToken(apiKey); - return client; - } + public static ApiClient getDefaultApiClient(String apiKey, Region region) { + ApiClient client = getDefaultApiClient(); + client.setBearerToken(apiKey); + client.setBasePath(region.toString()); + return client; + } - public static ApiClient getDefaultApiClient(String apiKey) { - ApiClient client = getDefaultApiClient(); - client.setBearerToken(apiKey); + public static ApiClient getDefaultApiClient(String apiKey, String regionStr) { + ApiClient client = getDefaultApiClient(); + switch (regionStr) { + case "eu": + case "EU": + case "EUROPE": + case "europe": + client.setBasePath(Region.EUROPE.toString()); + break; + case "global": + case "GLOBAL": + case "us": + case "US": + case "usa": + case "USA": + case "America": + case "america": + case "AMERICA": client.setBasePath(Region.GLOBAL.toString()); - return client; + break; + case "asia": + case "Asia": + case "as": + case "AS": + client.setBasePath(Region.ASIA.toString()); + break; + default: + client.setBasePath(regionStr); } + client.setBearerToken(apiKey); + return client; + } - /** - * Set the default API client, which would be used when creating API - * instances without providing an API client. - * - * @param apiClient API client - */ - public static void setDefaultApiClient(ApiClient apiClient) { - defaultApiClient.set(apiClient); - } + public static ApiClient getDefaultApiClient(String apiKey) { + ApiClient client = getDefaultApiClient(); + client.setBearerToken(apiKey); + client.setBasePath(Region.GLOBAL.toString()); + return client; + } - /** - * set the callback used to create new ApiClient objects - */ - public static void setApiClientFactory(Supplier factory) { - apiClientFactory = Objects.requireNonNull(factory); - } + /** + * Set the default API client, which would be used when creating API + * instances without providing an API client. + * + * @param apiClient API client + */ + public static void setDefaultApiClient(ApiClient apiClient) { + defaultApiClient.set(apiClient); + } - private Configuration() { - } + /** + * set the callback used to create new ApiClient objects + */ + public static void setApiClientFactory(Supplier factory) { + apiClientFactory = Objects.requireNonNull(factory); + } + + private Configuration() {} } diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/JSON.java b/sdk/src/main/java/com/fingerprint/v4/sdk/JSON.java index bab95a90..63f7d2c2 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/JSON.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/JSON.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,28 +10,29 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.sdk; import com.fasterxml.jackson.annotation.*; import com.fasterxml.jackson.databind.*; import com.fasterxml.jackson.databind.json.JsonMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; - +import jakarta.ws.rs.core.GenericType; +import jakarta.ws.rs.ext.ContextResolver; import java.text.DateFormat; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Set; -import jakarta.ws.rs.core.GenericType; -import jakarta.ws.rs.ext.ContextResolver; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class JSON implements ContextResolver { private ObjectMapper mapper; public JSON() { - mapper = JsonMapper.builder() + mapper = + JsonMapper.builder() .serializationInclusion(JsonInclude.Include.NON_NULL) .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) @@ -63,7 +64,9 @@ public ObjectMapper getContext(Class type) { * * @return object mapper */ - public ObjectMapper getMapper() { return mapper; } + public ObjectMapper getMapper() { + return mapper; + } /** * Returns the target model class that should be used to deserialize the input data. @@ -101,11 +104,6 @@ private static class ClassDiscriminatorMapping { } } - // Return the name of the discriminator property for this model class. - String getDiscriminatorPropertyName() { - return discriminatorName; - } - // Return the discriminator value or null if the discriminator is not // present in the payload. String getDiscriminatorValue(JsonNode node) { @@ -177,7 +175,8 @@ Class getClassForElement(JsonNode node, Set> visitedClasses) { * @param modelClass A OpenAPI model class. * @param inst The instance object. */ - public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { + public static boolean isInstanceOf( + Class modelClass, Object inst, Set> visitedClasses) { if (modelClass.isInstance(inst)) { // This handles the 'allOf' use case with single parent inheritance. return true; @@ -212,48 +211,50 @@ public static boolean isInstanceOf(Class modelClass, Object inst, Set, Map>> modelDescendants = new HashMap<>(); /** - * Register a model class discriminator. - * - * @param modelClass the model class - * @param discriminatorPropertyName the name of the discriminator property - * @param mappings a map with the discriminator mappings. - */ - public static void registerDiscriminator(Class modelClass, String discriminatorPropertyName, Map> mappings) { - ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator( + Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = + new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); modelDiscriminators.put(modelClass, m); } /** - * Register the oneOf/anyOf descendants of the modelClass. - * - * @param modelClass the model class - * @param descendants a map of oneOf/anyOf descendants. - */ - public static void registerDescendants(Class modelClass, Map> descendants) { + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants( + Class modelClass, Map> descendants) { modelDescendants.put(modelClass, descendants); } private static JSON json; - static - { + static { json = new JSON(); } /** - * Get the default JSON instance. - * - * @return the default JSON instance - */ + * Get the default JSON instance. + * + * @return the default JSON instance + */ public static JSON getDefault() { return json; } /** - * Set the default JSON instance. - * - * @param json JSON instance to be used - */ + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ public static void setDefault(JSON json) { JSON.json = json; } diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/JavaTimeFormatter.java b/sdk/src/main/java/com/fingerprint/v4/sdk/JavaTimeFormatter.java index 820b32d0..7098ab65 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/JavaTimeFormatter.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/JavaTimeFormatter.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -20,7 +20,9 @@ * Class that add parsing/formatting support for Java 8+ {@code OffsetDateTime} class. * It's generated for java clients when {@code AbstractJavaCodegen#dateLibrary} specified as {@code java8}. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class JavaTimeFormatter { private DateTimeFormatter offsetDateTimeFormatter = DateTimeFormatter.ISO_OFFSET_DATE_TIME; @@ -65,4 +67,4 @@ public OffsetDateTime parseOffsetDateTime(String str) { public String formatOffsetDateTime(OffsetDateTime offsetDateTime) { return offsetDateTimeFormatter.format(offsetDateTime); } -} \ No newline at end of file +} diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/Pair.java b/sdk/src/main/java/com/fingerprint/v4/sdk/Pair.java index 41b66b63..4a7e5e84 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/Pair.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/Pair.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,10 +10,11 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.sdk; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class Pair { private final String name; private final String value; diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/RFC3339DateFormat.java b/sdk/src/main/java/com/fingerprint/v4/sdk/RFC3339DateFormat.java index 0b34cdec..f1274bc6 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/RFC3339DateFormat.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/RFC3339DateFormat.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -13,23 +13,23 @@ package com.fingerprint.v4.sdk; import com.fasterxml.jackson.databind.util.StdDateFormat; - import java.text.DateFormat; +import java.text.DecimalFormat; import java.text.FieldPosition; import java.text.ParsePosition; import java.util.Date; -import java.text.DecimalFormat; import java.util.GregorianCalendar; import java.util.TimeZone; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class RFC3339DateFormat extends DateFormat { private static final long serialVersionUID = 1L; private static final TimeZone TIMEZONE_Z = TimeZone.getTimeZone("UTC"); - private final StdDateFormat fmt = new StdDateFormat() - .withTimeZone(TIMEZONE_Z) - .withColonInTimeZone(true); + private final StdDateFormat fmt = + new StdDateFormat().withTimeZone(TIMEZONE_Z).withColonInTimeZone(true); public RFC3339DateFormat() { this.calendar = new GregorianCalendar(); diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/RFC3339InstantDeserializer.java b/sdk/src/main/java/com/fingerprint/v4/sdk/RFC3339InstantDeserializer.java index 04b65bc0..b8fad96a 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/RFC3339InstantDeserializer.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/RFC3339InstantDeserializer.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -12,6 +12,10 @@ package com.fingerprint.v4.sdk; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature; +import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer; import java.io.IOException; import java.time.Instant; import java.time.OffsetDateTime; @@ -23,78 +27,80 @@ import java.util.function.BiFunction; import java.util.function.Function; -import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.databind.DeserializationContext; -import com.fasterxml.jackson.datatype.jsr310.JavaTimeFeature; -import com.fasterxml.jackson.datatype.jsr310.deser.InstantDeserializer; - -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class RFC3339InstantDeserializer extends InstantDeserializer { - private static final long serialVersionUID = 1L; - private final static boolean DEFAULT_NORMALIZE_ZONE_ID = JavaTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault(); - private final static boolean DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS - = JavaTimeFeature.ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS.enabledByDefault(); + private static final long serialVersionUID = 1L; + private static final boolean DEFAULT_NORMALIZE_ZONE_ID = + JavaTimeFeature.NORMALIZE_DESERIALIZED_ZONE_ID.enabledByDefault(); + private static final boolean DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS = + JavaTimeFeature.ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS.enabledByDefault(); - public static final RFC3339InstantDeserializer INSTANT = new RFC3339InstantDeserializer<>( - Instant.class, DateTimeFormatter.ISO_INSTANT, - Instant::from, - a -> Instant.ofEpochMilli( a.value ), - a -> Instant.ofEpochSecond( a.integer, a.fraction ), - null, - true, // yes, replace zero offset with Z - DEFAULT_NORMALIZE_ZONE_ID, - DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS - ); + public static final RFC3339InstantDeserializer INSTANT = + new RFC3339InstantDeserializer<>( + Instant.class, + DateTimeFormatter.ISO_INSTANT, + Instant::from, + a -> Instant.ofEpochMilli(a.value), + a -> Instant.ofEpochSecond(a.integer, a.fraction), + null, + true, // yes, replace zero offset with Z + DEFAULT_NORMALIZE_ZONE_ID, + DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS); - public static final RFC3339InstantDeserializer OFFSET_DATE_TIME = new RFC3339InstantDeserializer<>( - OffsetDateTime.class, DateTimeFormatter.ISO_OFFSET_DATE_TIME, - OffsetDateTime::from, - a -> OffsetDateTime.ofInstant( Instant.ofEpochMilli( a.value ), a.zoneId ), - a -> OffsetDateTime.ofInstant( Instant.ofEpochSecond( a.integer, a.fraction ), a.zoneId ), - (d, z) -> ( d.isEqual( OffsetDateTime.MIN ) || d.isEqual( OffsetDateTime.MAX ) ? - d : - d.withOffsetSameInstant( z.getRules().getOffset( d.toLocalDateTime() ) ) ), - true, // yes, replace zero offset with Z - DEFAULT_NORMALIZE_ZONE_ID, - DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS - ); + public static final RFC3339InstantDeserializer OFFSET_DATE_TIME = + new RFC3339InstantDeserializer<>( + OffsetDateTime.class, + DateTimeFormatter.ISO_OFFSET_DATE_TIME, + OffsetDateTime::from, + a -> OffsetDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId), + a -> OffsetDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId), + (d, z) -> + (d.isEqual(OffsetDateTime.MIN) || d.isEqual(OffsetDateTime.MAX) + ? d + : d.withOffsetSameInstant(z.getRules().getOffset(d.toLocalDateTime()))), + true, // yes, replace zero offset with Z + DEFAULT_NORMALIZE_ZONE_ID, + DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS); - public static final RFC3339InstantDeserializer ZONED_DATE_TIME = new RFC3339InstantDeserializer<>( - ZonedDateTime.class, DateTimeFormatter.ISO_ZONED_DATE_TIME, - ZonedDateTime::from, - a -> ZonedDateTime.ofInstant( Instant.ofEpochMilli( a.value ), a.zoneId ), - a -> ZonedDateTime.ofInstant( Instant.ofEpochSecond( a.integer, a.fraction ), a.zoneId ), - ZonedDateTime::withZoneSameInstant, - false, // keep zero offset and Z separate since zones explicitly supported - DEFAULT_NORMALIZE_ZONE_ID, - DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS - ); + public static final RFC3339InstantDeserializer ZONED_DATE_TIME = + new RFC3339InstantDeserializer<>( + ZonedDateTime.class, + DateTimeFormatter.ISO_ZONED_DATE_TIME, + ZonedDateTime::from, + a -> ZonedDateTime.ofInstant(Instant.ofEpochMilli(a.value), a.zoneId), + a -> ZonedDateTime.ofInstant(Instant.ofEpochSecond(a.integer, a.fraction), a.zoneId), + ZonedDateTime::withZoneSameInstant, + false, // keep zero offset and Z separate since zones explicitly supported + DEFAULT_NORMALIZE_ZONE_ID, + DEFAULT_ALWAYS_ALLOW_STRINGIFIED_DATE_TIMESTAMPS); - protected RFC3339InstantDeserializer( - Class supportedType, - DateTimeFormatter formatter, - Function parsedToValue, - Function fromMilliseconds, - Function fromNanoseconds, - BiFunction adjust, - boolean replaceZeroOffsetAsZ, - boolean normalizeZoneId, - boolean readNumericStringsAsTimestamp) { - super( - supportedType, - formatter, - parsedToValue, - fromMilliseconds, - fromNanoseconds, - adjust, - replaceZeroOffsetAsZ, - normalizeZoneId, - readNumericStringsAsTimestamp - ); - } + protected RFC3339InstantDeserializer( + Class supportedType, + DateTimeFormatter formatter, + Function parsedToValue, + Function fromMilliseconds, + Function fromNanoseconds, + BiFunction adjust, + boolean replaceZeroOffsetAsZ, + boolean normalizeZoneId, + boolean readNumericStringsAsTimestamp) { + super( + supportedType, + formatter, + parsedToValue, + fromMilliseconds, + fromNanoseconds, + adjust, + replaceZeroOffsetAsZ, + normalizeZoneId, + readNumericStringsAsTimestamp); + } - @Override - protected T _fromString(JsonParser p, DeserializationContext ctxt, String string0) throws IOException { - return super._fromString(p, ctxt, string0.replace( ' ', 'T' )); - } -} \ No newline at end of file + @Override + protected T _fromString(JsonParser p, DeserializationContext ctxt, String string0) + throws IOException { + return super._fromString(p, ctxt, string0.replace(' ', 'T')); + } +} diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/RFC3339JavaTimeModule.java b/sdk/src/main/java/com/fingerprint/v4/sdk/RFC3339JavaTimeModule.java index 20678892..1a9d2001 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/RFC3339JavaTimeModule.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/RFC3339JavaTimeModule.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -12,28 +12,27 @@ package com.fingerprint.v4.sdk; +import com.fasterxml.jackson.databind.module.SimpleModule; import java.time.Instant; import java.time.OffsetDateTime; import java.time.ZonedDateTime; -import com.fasterxml.jackson.databind.module.SimpleModule; -import com.fasterxml.jackson.databind.Module.SetupContext; - -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class RFC3339JavaTimeModule extends SimpleModule { - private static final long serialVersionUID = 1L; - - public RFC3339JavaTimeModule() { - super("RFC3339JavaTimeModule"); - } + private static final long serialVersionUID = 1L; - @Override - public void setupModule(SetupContext context) { - super.setupModule(context); + public RFC3339JavaTimeModule() { + super("RFC3339JavaTimeModule"); + } - addDeserializer(Instant.class, RFC3339InstantDeserializer.INSTANT); - addDeserializer(OffsetDateTime.class, RFC3339InstantDeserializer.OFFSET_DATE_TIME); - addDeserializer(ZonedDateTime.class, RFC3339InstantDeserializer.ZONED_DATE_TIME); - } + @Override + public void setupModule(SetupContext context) { + super.setupModule(context); + addDeserializer(Instant.class, RFC3339InstantDeserializer.INSTANT); + addDeserializer(OffsetDateTime.class, RFC3339InstantDeserializer.OFFSET_DATE_TIME); + addDeserializer(ZonedDateTime.class, RFC3339InstantDeserializer.ZONED_DATE_TIME); + } } diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/Region.java b/sdk/src/main/java/com/fingerprint/v4/sdk/Region.java index 754f8132..a45c68da 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/Region.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/Region.java @@ -1,16 +1,16 @@ package com.fingerprint.v4.sdk; public enum Region { - GLOBAL ("https://api.fpjs.io/v4"), - EUROPE ("https://eu.api.fpjs.io/v4"), - ASIA ("https://ap.api.fpjs.io/v4"); - private final String url; + GLOBAL("https://api.fpjs.io/v4"), + EUROPE("https://eu.api.fpjs.io/v4"), + ASIA("https://ap.api.fpjs.io/v4"); + private final String url; - Region(String s) { - url = s; - } + Region(String s) { + url = s; + } - public String toString() { - return this.url; - } + public String toString() { + return this.url; + } } diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/ServerConfiguration.java b/sdk/src/main/java/com/fingerprint/v4/sdk/ServerConfiguration.java index b5a73e01..6802aecb 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/ServerConfiguration.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/ServerConfiguration.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,7 +10,6 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.sdk; import java.util.Map; @@ -18,55 +17,59 @@ /** * Representing a Server configuration. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class ServerConfiguration { - public String URL; - public String description; - public Map variables; + public String URL; + public String description; + public Map variables; - /** - * @param URL A URL to the target host. - * @param description A description of the host designated by the URL. - * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. - */ - public ServerConfiguration(String URL, String description, Map variables) { - this.URL = URL; - this.description = description; - this.variables = variables; - } + /** + * @param URL A URL to the target host. + * @param description A description of the host designated by the URL. + * @param variables A map between a variable name and its value. The value is used for substitution in the server's URL template. + */ + public ServerConfiguration( + String URL, String description, Map variables) { + this.URL = URL; + this.description = description; + this.variables = variables; + } - /** - * Format URL template using given variables. - * - * @param variables A map between a variable name and its value. - * @return Formatted URL. - */ - public String URL(Map variables) { - String url = this.URL; + /** + * Format URL template using given variables. + * + * @param variables A map between a variable name and its value. + * @return Formatted URL. + */ + public String URL(Map variables) { + String url = this.URL; - // go through variables and replace placeholders - for (Map.Entry variable: this.variables.entrySet()) { - String name = variable.getKey(); - ServerVariable serverVariable = variable.getValue(); - String value = serverVariable.defaultValue; + // go through variables and replace placeholders + for (Map.Entry variable : this.variables.entrySet()) { + String name = variable.getKey(); + ServerVariable serverVariable = variable.getValue(); + String value = serverVariable.defaultValue; - if (variables != null && variables.containsKey(name)) { - value = variables.get(name); - if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { - throw new IllegalArgumentException("The variable " + name + " in the server URL has invalid value " + value + "."); - } - } - url = url.replace("{" + name + "}", value); + if (variables != null && variables.containsKey(name)) { + value = variables.get(name); + if (serverVariable.enumValues.size() > 0 && !serverVariable.enumValues.contains(value)) { + throw new IllegalArgumentException( + "The variable " + name + " in the server URL has invalid value " + value + "."); } - return url; + } + url = url.replace("{" + name + "}", value); } + return url; + } - /** - * Format URL template using default server variables. - * - * @return Formatted URL. - */ - public String URL() { - return URL(null); - } + /** + * Format URL template using default server variables. + * + * @return Formatted URL. + */ + public String URL() { + return URL(null); + } } diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/ServerVariable.java b/sdk/src/main/java/com/fingerprint/v4/sdk/ServerVariable.java index d97fee44..bc2f24a9 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/ServerVariable.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/ServerVariable.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,7 +10,6 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.sdk; import java.util.HashSet; @@ -18,20 +17,22 @@ /** * Representing a Server Variable for server URL template substitution. */ -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class ServerVariable { - public String description; - public String defaultValue; - public HashSet enumValues = null; + public String description; + public String defaultValue; + public HashSet enumValues = null; - /** - * @param description A description for the server variable. - * @param defaultValue The default value to use for substitution. - * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. - */ - public ServerVariable(String description, String defaultValue, HashSet enumValues) { - this.description = description; - this.defaultValue = defaultValue; - this.enumValues = enumValues; - } + /** + * @param description A description for the server variable. + * @param defaultValue The default value to use for substitution. + * @param enumValues An enumeration of string values to be used if the substitution options are from a limited set. + */ + public ServerVariable(String description, String defaultValue, HashSet enumValues) { + this.description = description; + this.defaultValue = defaultValue; + this.enumValues = enumValues; + } } diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/StringUtil.java b/sdk/src/main/java/com/fingerprint/v4/sdk/StringUtil.java index ec0ef246..91624321 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/StringUtil.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/StringUtil.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,13 +10,14 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.sdk; import java.util.Collection; import java.util.Iterator; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class StringUtil { /** * Check if the given array contains the given value (with case-insensitive comparison). diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/WebhookValidation.java b/sdk/src/main/java/com/fingerprint/v4/sdk/WebhookValidation.java index 1f1dcc84..7d9c2a5f 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/WebhookValidation.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/WebhookValidation.java @@ -1,53 +1,53 @@ package com.fingerprint.v4.sdk; -import org.apache.commons.codec.binary.Hex; - -import javax.crypto.Mac; -import javax.crypto.spec.SecretKeySpec; import java.nio.charset.StandardCharsets; import java.security.InvalidKeyException; import java.security.NoSuchAlgorithmException; +import javax.crypto.Mac; +import javax.crypto.spec.SecretKeySpec; +import org.apache.commons.codec.binary.Hex; public class WebhookValidation { - /** - * Verifies the HMAC signature extracted from the "fpjs-event-signature" header of the incoming request. - * This is a part of the webhook signing process, which is available only for enterprise customers. - * @param header The value of the "fpjs-event-signature" header - * @param data The raw data of the incoming request - * @param secret The secret key used to sign the request - * @return true if the signature is valid - * @throws NoSuchAlgorithmException in case HMAC-SHA-256 isn't available - * @throws IllegalArgumentException if an invalid key is provided - */ - public static boolean isSignatureValid(String header, byte[] data, String secret) throws NoSuchAlgorithmException { - String[] signatures = header.split(","); - for (String signature : signatures) { - String[] parts = signature.split("="); - if (parts.length == 2) { - final String version = parts[0]; - final String hash = parts[1]; - if (version.equals("v1") && isValidHmacSignature(hash, data, secret)) { - return true; - } - } + /** + * Verifies the HMAC signature extracted from the "fpjs-event-signature" header of the incoming request. + * This is a part of the webhook signing process, which is available only for enterprise customers. + * @param header The value of the "fpjs-event-signature" header + * @param data The raw data of the incoming request + * @param secret The secret key used to sign the request + * @return true if the signature is valid + * @throws NoSuchAlgorithmException in case HMAC-SHA-256 isn't available + * @throws IllegalArgumentException if an invalid key is provided + */ + public static boolean isSignatureValid(String header, byte[] data, String secret) + throws NoSuchAlgorithmException { + String[] signatures = header.split(","); + for (String signature : signatures) { + String[] parts = signature.split("="); + if (parts.length == 2) { + final String version = parts[0]; + final String hash = parts[1]; + if (version.equals("v1") && isValidHmacSignature(hash, data, secret)) { + return true; } - return false; + } } + return false; + } - private static final String ALGORITHM = "HmacSHA256"; + private static final String ALGORITHM = "HmacSHA256"; - private static boolean isValidHmacSignature(String signature, byte[] data, String secret) throws NoSuchAlgorithmException { - SecretKeySpec spec = new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), ALGORITHM); - Mac mac = Mac.getInstance(ALGORITHM); - try { - mac.init(spec); - byte[] computed = mac.doFinal(data); - String computedHash = Hex.encodeHexString(computed).replace("-", "").toLowerCase(); - return computedHash.equals(signature); - } catch (InvalidKeyException e) { - return false; - } + private static boolean isValidHmacSignature(String signature, byte[] data, String secret) + throws NoSuchAlgorithmException { + SecretKeySpec spec = new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), ALGORITHM); + Mac mac = Mac.getInstance(ALGORITHM); + try { + mac.init(spec); + byte[] computed = mac.doFinal(data); + String computedHash = Hex.encodeHexString(computed).replace("-", "").toLowerCase(); + return computedHash.equals(signature); + } catch (InvalidKeyException e) { + return false; } - + } } diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/auth/ApiKeyAuth.java b/sdk/src/main/java/com/fingerprint/v4/sdk/auth/ApiKeyAuth.java index 498d84e8..f0845da8 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/auth/ApiKeyAuth.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/auth/ApiKeyAuth.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,17 +10,17 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.sdk.auth; -import com.fingerprint.v4.sdk.Pair; import com.fingerprint.v4.sdk.ApiException; - +import com.fingerprint.v4.sdk.Pair; import java.net.URI; -import java.util.Map; import java.util.List; +import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class ApiKeyAuth implements Authentication { private final String location; private final String paramName; @@ -58,7 +58,14 @@ public void setApiKeyPrefix(String apiKeyPrefix) { } @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + public void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException { if (apiKey == null) { return; } diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/auth/Authentication.java b/sdk/src/main/java/com/fingerprint/v4/sdk/auth/Authentication.java index 605217c6..07bf1177 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/auth/Authentication.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/auth/Authentication.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,25 +10,31 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.sdk.auth; -import com.fingerprint.v4.sdk.Pair; import com.fingerprint.v4.sdk.ApiException; - +import com.fingerprint.v4.sdk.Pair; import java.net.URI; -import java.util.Map; import java.util.List; +import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public interface Authentication { - /** - * Apply authentication settings to header and query params. - * - * @param queryParams List of query parameters - * @param headerParams Map of header parameters - * @param cookieParams Map of cookie parameters - */ - void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException; - + /** + * Apply authentication settings to header and query params. + * + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + */ + void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException; } diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/auth/HttpBasicAuth.java b/sdk/src/main/java/com/fingerprint/v4/sdk/auth/HttpBasicAuth.java index a36dd005..66abf632 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/auth/HttpBasicAuth.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/auth/HttpBasicAuth.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,20 +10,19 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.sdk.auth; -import com.fingerprint.v4.sdk.Pair; import com.fingerprint.v4.sdk.ApiException; - -import java.util.Base64; -import java.nio.charset.StandardCharsets; - +import com.fingerprint.v4.sdk.Pair; import java.net.URI; -import java.util.Map; +import java.nio.charset.StandardCharsets; +import java.util.Base64; import java.util.List; +import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class HttpBasicAuth implements Authentication { private String username; private String password; @@ -45,11 +44,20 @@ public void setPassword(String password) { } @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { + public void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException { if (username == null && password == null) { return; } String str = (username == null ? "" : username) + ":" + (password == null ? "" : password); - headerParams.put("Authorization", "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); + headerParams.put( + "Authorization", + "Basic " + Base64.getEncoder().encodeToString(str.getBytes(StandardCharsets.UTF_8))); } } diff --git a/sdk/src/main/java/com/fingerprint/v4/sdk/auth/HttpBearerAuth.java b/sdk/src/main/java/com/fingerprint/v4/sdk/auth/HttpBearerAuth.java index 3ccada09..5cce4f59 100644 --- a/sdk/src/main/java/com/fingerprint/v4/sdk/auth/HttpBearerAuth.java +++ b/sdk/src/main/java/com/fingerprint/v4/sdk/auth/HttpBearerAuth.java @@ -1,6 +1,6 @@ /* * Server API - * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. + * Fingerprint Server API allows you to get, search, and update Events in a server environment. It can be used for data exports, decision-making, and data analysis scenarios. Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device. * * The version of the OpenAPI document: 4 * Contact: support@fingerprint.com @@ -10,17 +10,17 @@ * Do not edit the class manually. */ - package com.fingerprint.v4.sdk.auth; -import com.fingerprint.v4.sdk.Pair; import com.fingerprint.v4.sdk.ApiException; - +import com.fingerprint.v4.sdk.Pair; import java.net.URI; -import java.util.Map; import java.util.List; +import java.util.Map; -@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.16.0") +@jakarta.annotation.Generated( + value = "org.openapitools.codegen.languages.JavaClientCodegen", + comments = "Generator version: 7.16.0") public class HttpBearerAuth implements Authentication { private final String scheme; private String bearerToken; @@ -48,12 +48,20 @@ public void setBearerToken(String bearerToken) { } @Override - public void applyToParams(List queryParams, Map headerParams, Map cookieParams, String payload, String method, URI uri) throws ApiException { - if(bearerToken == null) { + public void applyToParams( + List queryParams, + Map headerParams, + Map cookieParams, + String payload, + String method, + URI uri) + throws ApiException { + if (bearerToken == null) { return; } - headerParams.put("Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); + headerParams.put( + "Authorization", (scheme != null ? upperCaseBearer(scheme) + " " : "") + bearerToken); } private static String upperCaseBearer(String scheme) { diff --git a/sdk/src/test/java/com/fingerprint/v4/SealedTest.java b/sdk/src/test/java/com/fingerprint/v4/SealedTest.java index acac1238..c0abc72c 100644 --- a/sdk/src/test/java/com/fingerprint/v4/SealedTest.java +++ b/sdk/src/test/java/com/fingerprint/v4/SealedTest.java @@ -1,247 +1,252 @@ package com.fingerprint.v4; +import static org.junit.jupiter.api.Assertions.*; + import com.fasterxml.jackson.core.io.JsonEOFException; +import com.fingerprint.v4.Sealed.InvalidSealedDataException; import com.fingerprint.v4.model.Event; import com.fingerprint.v4.sdk.JSON; -import com.fingerprint.v4.Sealed; -import com.fingerprint.v4.Sealed.InvalidSealedDataException; +import java.util.Base64; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.TestInstance; -import java.util.Base64; - -import static org.junit.jupiter.api.Assertions.*; - @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class SealedTest { - @Test - public void unsealEventResponseTest() throws Exception { - byte[] sealedResult = Base64.getDecoder().decode("noXc7Xu7PIKu1tbMkMxLbQG4XU46Bv5dED98hqTkPYZnmb8PG81Q83Kpg541Vt4NQdkzfezDSVk8FP9ZzJ08L0MMb4S8bT78c10Op1LyKwZU6DGr1e3V+ZWcNzHVG1rPoL+eUHN6yR9MQp8/CmSUBQUPOOAUXdoqWohbfIGxoQIuQ5BtfpSJuYD6kTyswSi56wxzY/s24dMwgS2KnA81Y1pdi3ZVJKBdwGYGg4T5Dvcqu0GWv3sScKD9b4Tagfbe2m8nbXY/QtN770c7J1xo/TNXXdq4lyqaMyqIayHOwRBP58tNF8mACusm1pogOVIt456wIMetCGKxicPJr7m/Q02ONzhkMtzzXwgwriglGHfM7UbtTsCytCBP7J2vp0tEkHiq/X3qtuvSLJqNyRzwFJhgisKGftc5CIaT2VxVKKxkL/6Ws6FPm4sQB1UGtMCMftKpyb1lFzG9lwFkKvYN9+FGtvRM50mbrzz7ONDxbwykkxihAab36MIuk7dfhvnVLFAjrpuCkEFdWrtjVyWmM0xVeXpEUtP6Ijk5P+VuPZ1alV/JV1q4WvfrGMizEZbwbp6eQZg9mwKe4IX+FVi7sPF2S/CCLI/d90S5Yz6bBP9uiQ3pCVlYbVOkpwS0YQxnR+h5J50qodY7LuswNO5VlEgI0ztkjPQBr8koT4SM54X2z14tA2tKCxSv1psEL5HOk4IWN+9f3RVfDKBDruDiDd+BtZquhYLmOFat9K4h41NrPGAqv5tKmmJtx3llMs6LFHPKBlNlI5zgqE7T47xv2AWw5nqWM107t8lpRETIgJx+YN/Jv6byJSQm7afaeDtHXGceMPOKMziH1XgsiQiS56OsmyyRgaq5YCmMuaPw8gcgVa7RNZSafkP34aQBAuJOA3JFs5xcYcubKutD3h1mk697A8vwdtR/Gj0zTvuUnQ/9o3qHSLseAEIiY9/dS6WJnKXRKTonQi2F6DV9NTzFVQl99AH22jq6lIsjbEEKcq/ydFDUpgAq4lyp9nPBHuPXSojdG+1BWuUyjYykaqnLzzqKgRalGzeWmRHd2qeNw8Bz5OWYBw82C3gHRS2BB9VquIgEYktDvgJ5yRfDYkp8qgxHoYeR88ijccWgdvk+WH78OPdwqA7rqdAYcWqn9KNozoxuYddc0fnrHbgaWpanCmPp0gNEeb4r+i9FDGPSkgYBdyrEPHblsDN/Ad1dhLIHEDEtQyv13s6tDRgLVvhowrzqIM+5cm/abyTDhXzSYDfCw2Wf90cBOMsbQBB2N2YRqnrpA50PGp+0IwlPL7qZj1N4JGhvQD0ux8Ood6AiXpdguj7DMP+T0laHIjWee5/xGZB6g3EsCdOZJjVj7hSE/L3eV4No0WcLqJ5DPOgw+FnvQpxndCTc8DW83tNm624lm7scu0A499vEFj1dhtq5gUxsGcqzm09+Vk2V/d0sa77Xocqe3bcfS5lXc/pHrOc1qKlK8kTr2AYNwjeJJ14euuin361WBETd1I6n8eIs02HyBas09o9lT7Nq05jsnbxej6d0q6GH7IYusiBFTJaAZ6UXOV5i1NOcw9jaGyHms3M2N/b2cmXFYTIFZSjSfbqoI6YZF73sMPhEZqfZ5Jjq+ZLMC3A+yFPFJOW/0oolUGbcC8TBVmLi37Z9Wgc338w2Jf+I94SdViku"); - byte[] key = Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); - - Event expectedResponse = JSON.getDefault().getMapper().readValue("{\"linked_id\":\"somelinkedId\",\"tags\":{},\"timestamp\":1708102555327,\"event_id\":\"1708102555327.NLOjmg\",\"url\":\"https://www.example.com/login?hope{this{works[!\",\"ip_address\":\"61.127.217.15\",\"user_agent\":\"Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....\",\"browser_details\":{\"browser_name\":\"Chrome\",\"browser_major_version\":\"74\",\"browser_full_version\":\"74.0.3729\",\"os\":\"Windows\",\"os_version\":\"7\",\"device\":\"Other\"},\"identification\":{\"visitor_id\":\"Ibk1527CUFmcnjLwIs4A9\",\"confidence\":{\"score\":0.97,\"version\":\"1.1\"},\"visitor_found\":false,\"first_seen_at\":1708102555327,\"last_seen_at\":1708102555327},\"supplementary_id_high_recall\":{\"visitor_id\":\"3HNey93AkBW6CRbxV6xP\",\"visitor_found\":true,\"confidence\":{\"score\":0.97,\"version\":\"1.1\"},\"first_seen_at\":1708102555327,\"last_seen_at\":1708102555327},\"bot\":\"not_detected\",\"root_apps\":false,\"emulator\":false,\"ip_info\":{\"v4\":{\"address\":\"94.142.239.124\",\"geolocation\":{\"accuracy_radius\":20,\"latitude\":50.05,\"longitude\":14.4,\"postal_code\":\"150 00\",\"timezone\":\"Europe/Prague\",\"city_name\":\"Prague\",\"country_code\":\"CZ\",\"country_name\":\"Czechia\",\"continent_code\":\"EU\",\"continent_name\":\"Europe\",\"subdivisions\":[{\"iso_code\":\"10\",\"name\":\"Hlavni mesto Praha\"}]},\"asn\":\"7922\",\"asn_name\":\"COMCAST-7922\",\"asn_network\":\"73.136.0.0/13\",\"datacenter_result\":true,\"datacenter_name\":\"DediPath\"},\"v6\":{\"address\":\"2001:db8:3333:4444:5555:6666:7777:8888\",\"geolocation\":{\"accuracy_radius\":5,\"latitude\":49.982,\"longitude\":36.2566,\"postal_code\":\"10112\",\"timezone\":\"Europe/Berlin\",\"city_name\":\"Berlin\",\"country_code\":\"DE\",\"country_name\":\"Germany\",\"continent_code\":\"EU\",\"continent_name\":\"Europe\",\"subdivisions\":[{\"iso_code\":\"BE\",\"name\":\"Land Berlin\"}]},\"asn\":\"6805\",\"asn_name\":\"Telefonica Germany\",\"asn_network\":\"2a02:3100::/24\",\"datacenter_result\":false,\"datacenter_name\":\"\"}},\"ip_blocklist\":{\"email_spam\":false,\"attack_source\":false,\"tor_node\":false},\"proxy\":true,\"proxy_confidence\":\"low\",\"proxy_details\":{\"proxy_type\":\"residential\",\"last_seen_at\":1708102555327},\"vpn\":false,\"vpn_confidence\":\"high\",\"vpn_origin_timezone\":\"Europe/Berlin\",\"vpn_origin_country\":\"unknown\",\"vpn_methods\":{\"timezone_mismatch\":false,\"public_vpn\":false,\"auxiliary_mobile\":false,\"os_mismatch\":false,\"relay\":false},\"incognito\":false,\"tampering\":false,\"tampering_details\":{\"anomaly_score\":0.1955,\"anti_detect_browser\":false},\"cloned_app\":false,\"factory_reset_timestamp\":0,\"jailbroken\":false,\"frida\":false,\"privacy_settings\":false,\"virtual_machine\":false,\"location_spoofing\":false,\"velocity\":{\"distinct_ip\":{\"5_minutes\":1,\"1_hour\":1,\"24_hours\":1},\"distinct_country\":{\"5_minutes\":1,\"1_hour\":2,\"24_hours\":2},\"events\":{\"5_minutes\":1,\"1_hour\":5,\"24_hours\":5},\"ip_events\":{\"5_minutes\":1,\"1_hour\":5,\"24_hours\":5},\"distinct_ip_by_linked_id\":{\"5_minutes\":1,\"1_hour\":5,\"24_hours\":5},\"distinct_visitor_id_by_linked_id\":{\"5_minutes\":1,\"1_hour\":5,\"24_hours\":5}},\"developer_tools\":false,\"mitm_attack\":false,\"sdk\":{\"platform\":\"js\",\"version\":\"3.11.10\"},\"replayed\":false}", Event.class); - - Event eventResponse = Sealed.unsealEventResponse( - sealedResult, - new Sealed.DecryptionKey[]{ - new Sealed.DecryptionKey( - //Invalid key - Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), - Sealed.DecryptionAlgorithm.AES_256_GCM - ), - new Sealed.DecryptionKey( - key, - Sealed.DecryptionAlgorithm.AES_256_GCM - ) - } - ); - - assertEquals(expectedResponse, eventResponse); - } - - @Test - public void unsealEventResponseWithInvalidSealedResultTest() throws Exception { - // "{\"invalid\":true}" - byte[] sealedResult = Base64.getDecoder().decode("noXc7VOpBstjjcavDKSKr4HTavt4mdq8h6NC32T0hUtw9S0jXT8lPjZiWL8SyHxmrF3uTGqO+g=="); - byte[] key = Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); - - assertThrows(Sealed.InvalidSealedDataException.class, () -> Sealed.unsealEventResponse( - sealedResult, - new Sealed.DecryptionKey[]{ - new Sealed.DecryptionKey( - //Invalid key - Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), - Sealed.DecryptionAlgorithm.AES_256_GCM - ), - new Sealed.DecryptionKey( - //Invalid key - Base64.getDecoder().decode("aW52YWxpZA=="), - Sealed.DecryptionAlgorithm.AES_256_GCM - ), - new Sealed.DecryptionKey( - key, - Sealed.DecryptionAlgorithm.AES_256_GCM - ) - } - )); - } - - @Test - public void unsealEventResponseWithInvalidJsonSealedResultTest() throws Exception { - byte[] sealedResult = Base64.getDecoder().decode("noXc7VE/iOGp4qw5etO5BigT7Gq3Grr3vFf4O+kB+JGQFDBDPAy7afWfhz/AhDRiY86mH7GSfOhBbNL4Q/xAvJPLepFFFs2YKYKGH5KLLvTfTX9/MPR4xACLJTbBRk1oLrz7KvyUh8wJzRH15MFryFIgTprKQEAURxSxVfkwKFc/lQvth9A/VD+qfrfQPPfOevGydBSuwhInuOWXsrtT+Oy036o+sf3uR2sGSAVwqMkORNu1s4jvCvT+v5fQH0SVHp2E24tscteOEUNhYcfsWInoDKl2vFR04YX8TSXqC9/YWJDRv4rSV2H806HvKJguElS7Bk4PVGELNg6bYKTV+QVq70UM/X9aABbOy/maYVE1Cv2fV7lOsKj58i4XXMnBoHf6HSrdLBMuelcEbqmILlnouZr9EusGJw9s3bVFihC1ZJMBVkwuUn93eicqg2YjTN+pUevEyQuSYJ9UZ6sRPOGp8OwQNBEYJiMN7M5/5cO4jAB5W7Sgsn+tN5khUDevrXaAdj/q/a6Sq9sGTImySH6IWm8LY+TA13JRTztQne3aD0XmWT2QkTHZ9MP67zaRl5wcJaKWHMYuDcRXu8DJNHQS3IC7RMOKboJPSTrIgmCEeNP4ctdqV+piBC0AEX1zEO/tms3XmoLqGtflHxP/h20XVRlX5YAPyRWJju5gFdXNyLRU6IS2/crJiPocgyTJXtS8/Ffg6ksyg7NSO0Z3232cv1uAszeBsQmBxz6/kwpq5fiNDGTsQouS5g8GqePB34Dduasi/Hn9oHKnDOOpYUnCkIUSJrwJSwqh6Z6kWbZywdqhS6paGeYW+bcVo/zdBhIdS6OH8AAf+5NaZpqmUweTpRcI3/2BYRMhn5KNbVJMG0Egq986V9G0g2o3+7pkpFyHMBuMN4txwLmonU5Thgg="); - byte[] key = Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); - - assertThrows(JsonEOFException.class, () -> Sealed.unsealEventResponse( - sealedResult, - new Sealed.DecryptionKey[]{ - new Sealed.DecryptionKey( - //Invalid key - Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), - Sealed.DecryptionAlgorithm.AES_256_GCM - ), - new Sealed.DecryptionKey( - //Invalid key - Base64.getDecoder().decode("aW52YWxpZA=="), - Sealed.DecryptionAlgorithm.AES_256_GCM - ), - new Sealed.DecryptionKey( - key, - Sealed.DecryptionAlgorithm.AES_256_GCM - ) - } - )); - } - - @Test - public void unsealEventResponseWithNotCompressedSealedResultTest() throws Exception { - byte[] sealedResult = Base64.getDecoder().decode("noXc7dtuk0smGE+ZbaoXzrp6Rq8ySxLepejTsu7+jUXlPhV1w+WuHx9gbPhaENJnOQo8BcGmsaRhL5k2NVj+DRNzYO9cQD7wHxmXKCyTbl/dvSYOMoHziUZ2VbQ7tmaorFny26v8jROr/UBGfvPE0dLKC36IN9ZlJ3X0NZJO8SY+8bCr4mTrkVZsv/hpvZp+OjC4h7e5vxcpmnBWXzxfaO79Lq3aMRIEf9XfK7/bVIptHaEqtPKCTwl9rz1KUpUUNQSHTPM0NlqJe9bjYf5mr1uYvWHhcJoXSyRyVMxIv/quRiw3SKJzAMOTBiAvFICpWuRFa+T/xIMHK0g96w/IMQo0jdY1E067ZEvBUOBmsJnGJg1LllS3rbJVe+E2ClFNL8SzFphyvtlcfvYB+SVSD4bzI0w/YCldv5Sq42BFt5bn4n4aE5A6658DYsfSRYWqP6OpqPJx96cY34W7H1t/ZG0ulez6zF5NvWhc1HDQ1gMtXd+K/ogt1n+FyFtn8xzvtSGkmrc2jJgYNI5Pd0Z0ent73z0MKbJx9v2ta/emPEzPr3cndN5amdr6TmRkDU4bq0vyhAh87DJrAnJQLdrvYLddnrr8xTdeXxj1i1Yug6SGncPh9sbTYkdOfuamPAYOuiJVBAMcfYsYEiQndZe8mOQ4bpCr+hxAAqixhZ16pQ8CeUwa247+D2scRymLB8qJXlaERuFZtWGVAZ8VP/GS/9EXjrzpjGX9vlrIPeJP8fh2S5QPzw55cGNJ7JfAdOyManXnoEw2/QzDhSZQARVl+akFgSO0Y13YmbiL7H6HcKWGcJ2ipDKIaj2fJ7GE0Vzyt+CBEezSQR99Igd8x3p2JtvsVKp35iLPksjS1VqtSCTbuIRUlINlfQHNjeQiE/B/61jo3Mf7SmjYjqtvXt5e9RKb+CQku2qH4ZU8xN3DSg+4mLom3BgKBkm/MoyGBpMK41c96d2tRp3tp4hV0F6ac02Crg7P2lw8IUct+i2VJ8VUjcbRfTIPQs0HjNjM6/gLfLCkWOHYrlFjwusXWQCJz91Kq+hVxj7M9LtplPO4AUq6RUMNhlPGUmyOI2tcUMrjq9vMLXGlfdkH185zM4Mk+O7DRLC8683lXZFZvcBEmxr855PqLLH/9SpYKHBoGRatDRdQe3oRp6gHS0jpQ1SW/si4kvLKiUNjiBExvbQVOUV7/VFXvG1RpM9wbzSoOd40gg7ZzD/72QshUC/25DkM/Pm7RBzwtjgmnRKjT+mROeC/7VQLoz3amv09O8Mvbt+h/lX5+51Q834F7NgIGagbB20WtWcMtrmKrvCEZlaoiZrmYVSbi1RfknRK7CTPJkopw9IjO7Ut2EhKZ+jL4rwk6TlVm6EC6Kuj7KNqp6wB/UNe9eM2Eym/aiHAcja8XN4YQhSIuJD2Wxb0n3LkKnAjK1/GY65c8K6rZsVYQ0MQL1j4lMl0UZPjG/vzKyetIsVDyXc4J9ZhOEMYnt/LaxEeSt4EMJGBA9wpTmz33X4h3ij0Y3DY/rH7lrEScUknw20swTZRm5T6q1bnimj7M1OiOkebdI09MZ0nyaTWRHdB7B52C/moh89Q7qa2Fulp5h8Us1FYRkWBLt37a5rGI1IfVeP38KaPbagND+XzWpNqX4HVrAVPLQVK5EwUvGamED3ooJ0FMieTc0IH0N+IeUYG7Q8XmrRVBcw32W8pEfYLO9L71An/J0jQZCIP8DuQnUG0mOvunOuloBGvP/9LvkBlkamh68F0a5f5ny1jloyIFJhRh5dt2SBlbsXS9AKqUwARYSSsA9Ao4WJWOZMyjp8A+qIBAfW65MdhhUDKYMBgIAbMCc3uiptzElQQopE5TT5xIhwfYxa503jVzQbz1Q=="); - byte[] key = Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); - - Sealed.UnsealAggregateException exception = assertThrows(Sealed.UnsealAggregateException.class, () -> Sealed.unsealEventResponse( - sealedResult, - new Sealed.DecryptionKey[]{ - new Sealed.DecryptionKey( - //Invalid key - Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), - Sealed.DecryptionAlgorithm.AES_256_GCM - ), - new Sealed.DecryptionKey( - //Invalid key - Base64.getDecoder().decode("aW52YWxpZA=="), - Sealed.DecryptionAlgorithm.AES_256_GCM - ), - new Sealed.DecryptionKey( - key, - Sealed.DecryptionAlgorithm.AES_256_GCM - ) - } - )); - - Sealed.UnsealException unsealException = (Sealed.UnsealException) exception.getSuppressed()[2]; - - assertEquals(unsealException.getCause().getMessage(), "invalid distance too far back"); - } - - @Test - public void unsealEventResponseWithInvalidHeaderTest() throws Exception { - byte[] sealedResult = Base64.getDecoder().decode("noXc7xXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNxlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw=="); - byte[] key = Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); - - assertThrows(Sealed.InvalidSealedDataHeaderException.class, () -> Sealed.unsealEventResponse( + @Test + public void unsealEventResponseTest() throws Exception { + byte[] sealedResult = + Base64.getDecoder() + .decode( + "noXc7Xu7PIKu1tbMkMxLbQG4XU46Bv5dED98hqTkPYZnmb8PG81Q83Kpg541Vt4NQdkzfezDSVk8FP9ZzJ08L0MMb4S8bT78c10Op1LyKwZU6DGr1e3V+ZWcNzHVG1rPoL+eUHN6yR9MQp8/CmSUBQUPOOAUXdoqWohbfIGxoQIuQ5BtfpSJuYD6kTyswSi56wxzY/s24dMwgS2KnA81Y1pdi3ZVJKBdwGYGg4T5Dvcqu0GWv3sScKD9b4Tagfbe2m8nbXY/QtN770c7J1xo/TNXXdq4lyqaMyqIayHOwRBP58tNF8mACusm1pogOVIt456wIMetCGKxicPJr7m/Q02ONzhkMtzzXwgwriglGHfM7UbtTsCytCBP7J2vp0tEkHiq/X3qtuvSLJqNyRzwFJhgisKGftc5CIaT2VxVKKxkL/6Ws6FPm4sQB1UGtMCMftKpyb1lFzG9lwFkKvYN9+FGtvRM50mbrzz7ONDxbwykkxihAab36MIuk7dfhvnVLFAjrpuCkEFdWrtjVyWmM0xVeXpEUtP6Ijk5P+VuPZ1alV/JV1q4WvfrGMizEZbwbp6eQZg9mwKe4IX+FVi7sPF2S/CCLI/d90S5Yz6bBP9uiQ3pCVlYbVOkpwS0YQxnR+h5J50qodY7LuswNO5VlEgI0ztkjPQBr8koT4SM54X2z14tA2tKCxSv1psEL5HOk4IWN+9f3RVfDKBDruDiDd+BtZquhYLmOFat9K4h41NrPGAqv5tKmmJtx3llMs6LFHPKBlNlI5zgqE7T47xv2AWw5nqWM107t8lpRETIgJx+YN/Jv6byJSQm7afaeDtHXGceMPOKMziH1XgsiQiS56OsmyyRgaq5YCmMuaPw8gcgVa7RNZSafkP34aQBAuJOA3JFs5xcYcubKutD3h1mk697A8vwdtR/Gj0zTvuUnQ/9o3qHSLseAEIiY9/dS6WJnKXRKTonQi2F6DV9NTzFVQl99AH22jq6lIsjbEEKcq/ydFDUpgAq4lyp9nPBHuPXSojdG+1BWuUyjYykaqnLzzqKgRalGzeWmRHd2qeNw8Bz5OWYBw82C3gHRS2BB9VquIgEYktDvgJ5yRfDYkp8qgxHoYeR88ijccWgdvk+WH78OPdwqA7rqdAYcWqn9KNozoxuYddc0fnrHbgaWpanCmPp0gNEeb4r+i9FDGPSkgYBdyrEPHblsDN/Ad1dhLIHEDEtQyv13s6tDRgLVvhowrzqIM+5cm/abyTDhXzSYDfCw2Wf90cBOMsbQBB2N2YRqnrpA50PGp+0IwlPL7qZj1N4JGhvQD0ux8Ood6AiXpdguj7DMP+T0laHIjWee5/xGZB6g3EsCdOZJjVj7hSE/L3eV4No0WcLqJ5DPOgw+FnvQpxndCTc8DW83tNm624lm7scu0A499vEFj1dhtq5gUxsGcqzm09+Vk2V/d0sa77Xocqe3bcfS5lXc/pHrOc1qKlK8kTr2AYNwjeJJ14euuin361WBETd1I6n8eIs02HyBas09o9lT7Nq05jsnbxej6d0q6GH7IYusiBFTJaAZ6UXOV5i1NOcw9jaGyHms3M2N/b2cmXFYTIFZSjSfbqoI6YZF73sMPhEZqfZ5Jjq+ZLMC3A+yFPFJOW/0oolUGbcC8TBVmLi37Z9Wgc338w2Jf+I94SdViku"); + byte[] key = Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); + + Event expectedResponse = + JSON.getDefault() + .getMapper() + .readValue( + "{\"linked_id\":\"somelinkedId\",\"tags\":{},\"timestamp\":1708102555327,\"event_id\":\"1708102555327.NLOjmg\",\"url\":\"https://www.example.com/login?hope{this{works[!\",\"ip_address\":\"61.127.217.15\",\"user_agent\":\"Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....\",\"browser_details\":{\"browser_name\":\"Chrome\",\"browser_major_version\":\"74\",\"browser_full_version\":\"74.0.3729\",\"os\":\"Windows\",\"os_version\":\"7\",\"device\":\"Other\"},\"identification\":{\"visitor_id\":\"Ibk1527CUFmcnjLwIs4A9\",\"confidence\":{\"score\":0.97,\"version\":\"1.1\"},\"visitor_found\":false,\"first_seen_at\":1708102555327,\"last_seen_at\":1708102555327},\"supplementary_id_high_recall\":{\"visitor_id\":\"3HNey93AkBW6CRbxV6xP\",\"visitor_found\":true,\"confidence\":{\"score\":0.97,\"version\":\"1.1\"},\"first_seen_at\":1708102555327,\"last_seen_at\":1708102555327},\"bot\":\"not_detected\",\"root_apps\":false,\"emulator\":false,\"ip_info\":{\"v4\":{\"address\":\"94.142.239.124\",\"geolocation\":{\"accuracy_radius\":20,\"latitude\":50.05,\"longitude\":14.4,\"postal_code\":\"150 00\",\"timezone\":\"Europe/Prague\",\"city_name\":\"Prague\",\"country_code\":\"CZ\",\"country_name\":\"Czechia\",\"continent_code\":\"EU\",\"continent_name\":\"Europe\",\"subdivisions\":[{\"iso_code\":\"10\",\"name\":\"Hlavni mesto Praha\"}]},\"asn\":\"7922\",\"asn_name\":\"COMCAST-7922\",\"asn_network\":\"73.136.0.0/13\",\"datacenter_result\":true,\"datacenter_name\":\"DediPath\"},\"v6\":{\"address\":\"2001:db8:3333:4444:5555:6666:7777:8888\",\"geolocation\":{\"accuracy_radius\":5,\"latitude\":49.982,\"longitude\":36.2566,\"postal_code\":\"10112\",\"timezone\":\"Europe/Berlin\",\"city_name\":\"Berlin\",\"country_code\":\"DE\",\"country_name\":\"Germany\",\"continent_code\":\"EU\",\"continent_name\":\"Europe\",\"subdivisions\":[{\"iso_code\":\"BE\",\"name\":\"Land Berlin\"}]},\"asn\":\"6805\",\"asn_name\":\"Telefonica Germany\",\"asn_network\":\"2a02:3100::/24\",\"datacenter_result\":false,\"datacenter_name\":\"\"}},\"ip_blocklist\":{\"email_spam\":false,\"attack_source\":false,\"tor_node\":false},\"proxy\":true,\"proxy_confidence\":\"low\",\"proxy_details\":{\"proxy_type\":\"residential\",\"last_seen_at\":1708102555327},\"vpn\":false,\"vpn_confidence\":\"high\",\"vpn_origin_timezone\":\"Europe/Berlin\",\"vpn_origin_country\":\"unknown\",\"vpn_methods\":{\"timezone_mismatch\":false,\"public_vpn\":false,\"auxiliary_mobile\":false,\"os_mismatch\":false,\"relay\":false},\"incognito\":false,\"tampering\":false,\"tampering_details\":{\"anomaly_score\":0.1955,\"anti_detect_browser\":false},\"cloned_app\":false,\"factory_reset_timestamp\":0,\"jailbroken\":false,\"frida\":false,\"privacy_settings\":false,\"virtual_machine\":false,\"location_spoofing\":false,\"velocity\":{\"distinct_ip\":{\"5_minutes\":1,\"1_hour\":1,\"24_hours\":1},\"distinct_country\":{\"5_minutes\":1,\"1_hour\":2,\"24_hours\":2},\"events\":{\"5_minutes\":1,\"1_hour\":5,\"24_hours\":5},\"ip_events\":{\"5_minutes\":1,\"1_hour\":5,\"24_hours\":5},\"distinct_ip_by_linked_id\":{\"5_minutes\":1,\"1_hour\":5,\"24_hours\":5},\"distinct_visitor_id_by_linked_id\":{\"5_minutes\":1,\"1_hour\":5,\"24_hours\":5}},\"developer_tools\":false,\"mitm_attack\":false,\"sdk\":{\"platform\":\"js\",\"version\":\"3.11.10\"},\"replayed\":false}", + Event.class); + + Event eventResponse = + Sealed.unsealEventResponse( + sealedResult, + new Sealed.DecryptionKey[] { + new Sealed.DecryptionKey( + // Invalid key + Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), + Sealed.DecryptionAlgorithm.AES_256_GCM), + new Sealed.DecryptionKey(key, Sealed.DecryptionAlgorithm.AES_256_GCM) + }); + + assertEquals(expectedResponse, eventResponse); + } + + @Test + public void unsealEventResponseWithInvalidSealedResultTest() throws Exception { + // "{\"invalid\":true}" + byte[] sealedResult = + Base64.getDecoder() + .decode("noXc7VOpBstjjcavDKSKr4HTavt4mdq8h6NC32T0hUtw9S0jXT8lPjZiWL8SyHxmrF3uTGqO+g=="); + byte[] key = Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); + + assertThrows( + Sealed.InvalidSealedDataException.class, + () -> + Sealed.unsealEventResponse( sealedResult, - new Sealed.DecryptionKey[]{ - new Sealed.DecryptionKey( - //Invalid key - Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), - Sealed.DecryptionAlgorithm.AES_256_GCM - ), - new Sealed.DecryptionKey( - //Invalid key - Base64.getDecoder().decode("aW52YWxpZA=="), - Sealed.DecryptionAlgorithm.AES_256_GCM - ), - new Sealed.DecryptionKey( - key, - Sealed.DecryptionAlgorithm.AES_256_GCM - ) - } - )); - } - - @Test - public void unsealEventResponseWithEmptyDataTest() throws Exception { - byte[] sealedResult = new byte[0]; - byte[] key = Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); - - assertThrows(Sealed.InvalidSealedDataHeaderException.class, () -> Sealed.unsealEventResponse( + new Sealed.DecryptionKey[] { + new Sealed.DecryptionKey( + // Invalid key + Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), + Sealed.DecryptionAlgorithm.AES_256_GCM), + new Sealed.DecryptionKey( + // Invalid key + Base64.getDecoder().decode("aW52YWxpZA=="), + Sealed.DecryptionAlgorithm.AES_256_GCM), + new Sealed.DecryptionKey(key, Sealed.DecryptionAlgorithm.AES_256_GCM) + })); + } + + @Test + public void unsealEventResponseWithInvalidJsonSealedResultTest() throws Exception { + byte[] sealedResult = + Base64.getDecoder() + .decode( + "noXc7VE/iOGp4qw5etO5BigT7Gq3Grr3vFf4O+kB+JGQFDBDPAy7afWfhz/AhDRiY86mH7GSfOhBbNL4Q/xAvJPLepFFFs2YKYKGH5KLLvTfTX9/MPR4xACLJTbBRk1oLrz7KvyUh8wJzRH15MFryFIgTprKQEAURxSxVfkwKFc/lQvth9A/VD+qfrfQPPfOevGydBSuwhInuOWXsrtT+Oy036o+sf3uR2sGSAVwqMkORNu1s4jvCvT+v5fQH0SVHp2E24tscteOEUNhYcfsWInoDKl2vFR04YX8TSXqC9/YWJDRv4rSV2H806HvKJguElS7Bk4PVGELNg6bYKTV+QVq70UM/X9aABbOy/maYVE1Cv2fV7lOsKj58i4XXMnBoHf6HSrdLBMuelcEbqmILlnouZr9EusGJw9s3bVFihC1ZJMBVkwuUn93eicqg2YjTN+pUevEyQuSYJ9UZ6sRPOGp8OwQNBEYJiMN7M5/5cO4jAB5W7Sgsn+tN5khUDevrXaAdj/q/a6Sq9sGTImySH6IWm8LY+TA13JRTztQne3aD0XmWT2QkTHZ9MP67zaRl5wcJaKWHMYuDcRXu8DJNHQS3IC7RMOKboJPSTrIgmCEeNP4ctdqV+piBC0AEX1zEO/tms3XmoLqGtflHxP/h20XVRlX5YAPyRWJju5gFdXNyLRU6IS2/crJiPocgyTJXtS8/Ffg6ksyg7NSO0Z3232cv1uAszeBsQmBxz6/kwpq5fiNDGTsQouS5g8GqePB34Dduasi/Hn9oHKnDOOpYUnCkIUSJrwJSwqh6Z6kWbZywdqhS6paGeYW+bcVo/zdBhIdS6OH8AAf+5NaZpqmUweTpRcI3/2BYRMhn5KNbVJMG0Egq986V9G0g2o3+7pkpFyHMBuMN4txwLmonU5Thgg="); + byte[] key = Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); + + assertThrows( + JsonEOFException.class, + () -> + Sealed.unsealEventResponse( sealedResult, - new Sealed.DecryptionKey[]{ - new Sealed.DecryptionKey( - //Invalid key - Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), - Sealed.DecryptionAlgorithm.AES_256_GCM - ), - new Sealed.DecryptionKey( - //Invalid key - Base64.getDecoder().decode("aW52YWxpZA=="), - Sealed.DecryptionAlgorithm.AES_256_GCM - ), - new Sealed.DecryptionKey( - key, - Sealed.DecryptionAlgorithm.AES_256_GCM - ) - } - )); - } - - @Test - public void unsealEventResponseWithEmptyEventTest() throws Exception { - byte[] sealedResult = Base64.getDecoder().decode("noXc7enbFVmf0ITsHkrqGgSDC0UNR/MIVD3hvIBk8qL1Y2/SHzr5S2E="); - byte[] key = Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); - - InvalidSealedDataException ex = assertThrows(Sealed.InvalidSealedDataException.class, () -> Sealed.unsealEventResponse( + new Sealed.DecryptionKey[] { + new Sealed.DecryptionKey( + // Invalid key + Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), + Sealed.DecryptionAlgorithm.AES_256_GCM), + new Sealed.DecryptionKey( + // Invalid key + Base64.getDecoder().decode("aW52YWxpZA=="), + Sealed.DecryptionAlgorithm.AES_256_GCM), + new Sealed.DecryptionKey(key, Sealed.DecryptionAlgorithm.AES_256_GCM) + })); + } + + @Test + public void unsealEventResponseWithNotCompressedSealedResultTest() throws Exception { + byte[] sealedResult = + Base64.getDecoder() + .decode( + "noXc7dtuk0smGE+ZbaoXzrp6Rq8ySxLepejTsu7+jUXlPhV1w+WuHx9gbPhaENJnOQo8BcGmsaRhL5k2NVj+DRNzYO9cQD7wHxmXKCyTbl/dvSYOMoHziUZ2VbQ7tmaorFny26v8jROr/UBGfvPE0dLKC36IN9ZlJ3X0NZJO8SY+8bCr4mTrkVZsv/hpvZp+OjC4h7e5vxcpmnBWXzxfaO79Lq3aMRIEf9XfK7/bVIptHaEqtPKCTwl9rz1KUpUUNQSHTPM0NlqJe9bjYf5mr1uYvWHhcJoXSyRyVMxIv/quRiw3SKJzAMOTBiAvFICpWuRFa+T/xIMHK0g96w/IMQo0jdY1E067ZEvBUOBmsJnGJg1LllS3rbJVe+E2ClFNL8SzFphyvtlcfvYB+SVSD4bzI0w/YCldv5Sq42BFt5bn4n4aE5A6658DYsfSRYWqP6OpqPJx96cY34W7H1t/ZG0ulez6zF5NvWhc1HDQ1gMtXd+K/ogt1n+FyFtn8xzvtSGkmrc2jJgYNI5Pd0Z0ent73z0MKbJx9v2ta/emPEzPr3cndN5amdr6TmRkDU4bq0vyhAh87DJrAnJQLdrvYLddnrr8xTdeXxj1i1Yug6SGncPh9sbTYkdOfuamPAYOuiJVBAMcfYsYEiQndZe8mOQ4bpCr+hxAAqixhZ16pQ8CeUwa247+D2scRymLB8qJXlaERuFZtWGVAZ8VP/GS/9EXjrzpjGX9vlrIPeJP8fh2S5QPzw55cGNJ7JfAdOyManXnoEw2/QzDhSZQARVl+akFgSO0Y13YmbiL7H6HcKWGcJ2ipDKIaj2fJ7GE0Vzyt+CBEezSQR99Igd8x3p2JtvsVKp35iLPksjS1VqtSCTbuIRUlINlfQHNjeQiE/B/61jo3Mf7SmjYjqtvXt5e9RKb+CQku2qH4ZU8xN3DSg+4mLom3BgKBkm/MoyGBpMK41c96d2tRp3tp4hV0F6ac02Crg7P2lw8IUct+i2VJ8VUjcbRfTIPQs0HjNjM6/gLfLCkWOHYrlFjwusXWQCJz91Kq+hVxj7M9LtplPO4AUq6RUMNhlPGUmyOI2tcUMrjq9vMLXGlfdkH185zM4Mk+O7DRLC8683lXZFZvcBEmxr855PqLLH/9SpYKHBoGRatDRdQe3oRp6gHS0jpQ1SW/si4kvLKiUNjiBExvbQVOUV7/VFXvG1RpM9wbzSoOd40gg7ZzD/72QshUC/25DkM/Pm7RBzwtjgmnRKjT+mROeC/7VQLoz3amv09O8Mvbt+h/lX5+51Q834F7NgIGagbB20WtWcMtrmKrvCEZlaoiZrmYVSbi1RfknRK7CTPJkopw9IjO7Ut2EhKZ+jL4rwk6TlVm6EC6Kuj7KNqp6wB/UNe9eM2Eym/aiHAcja8XN4YQhSIuJD2Wxb0n3LkKnAjK1/GY65c8K6rZsVYQ0MQL1j4lMl0UZPjG/vzKyetIsVDyXc4J9ZhOEMYnt/LaxEeSt4EMJGBA9wpTmz33X4h3ij0Y3DY/rH7lrEScUknw20swTZRm5T6q1bnimj7M1OiOkebdI09MZ0nyaTWRHdB7B52C/moh89Q7qa2Fulp5h8Us1FYRkWBLt37a5rGI1IfVeP38KaPbagND+XzWpNqX4HVrAVPLQVK5EwUvGamED3ooJ0FMieTc0IH0N+IeUYG7Q8XmrRVBcw32W8pEfYLO9L71An/J0jQZCIP8DuQnUG0mOvunOuloBGvP/9LvkBlkamh68F0a5f5ny1jloyIFJhRh5dt2SBlbsXS9AKqUwARYSSsA9Ao4WJWOZMyjp8A+qIBAfW65MdhhUDKYMBgIAbMCc3uiptzElQQopE5TT5xIhwfYxa503jVzQbz1Q=="); + byte[] key = Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); + + Sealed.UnsealAggregateException exception = + assertThrows( + Sealed.UnsealAggregateException.class, + () -> + Sealed.unsealEventResponse( + sealedResult, + new Sealed.DecryptionKey[] { + new Sealed.DecryptionKey( + // Invalid key + Base64.getDecoder() + .decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), + Sealed.DecryptionAlgorithm.AES_256_GCM), + new Sealed.DecryptionKey( + // Invalid key + Base64.getDecoder().decode("aW52YWxpZA=="), + Sealed.DecryptionAlgorithm.AES_256_GCM), + new Sealed.DecryptionKey(key, Sealed.DecryptionAlgorithm.AES_256_GCM) + })); + + Sealed.UnsealException unsealException = (Sealed.UnsealException) exception.getSuppressed()[2]; + + assertEquals(unsealException.getCause().getMessage(), "invalid distance too far back"); + } + + @Test + public void unsealEventResponseWithInvalidHeaderTest() throws Exception { + byte[] sealedResult = + Base64.getDecoder() + .decode( + "noXc7xXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNxlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw=="); + byte[] key = Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); + + assertThrows( + Sealed.InvalidSealedDataHeaderException.class, + () -> + Sealed.unsealEventResponse( sealedResult, - new Sealed.DecryptionKey[]{ - new Sealed.DecryptionKey( - key, - Sealed.DecryptionAlgorithm.AES_256_GCM - ) - } - )); - assertEquals("Invalid sealed data", ex.getMessage()); - } - - @Test - public void unsealEventResponseWithInvalidKeysTest() throws Exception { - byte[] sealedResult = Base64.getDecoder().decode("noXc7SXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNKlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw=="); - - assertThrows(Sealed.UnsealAggregateException.class, () -> Sealed.unsealEventResponse( + new Sealed.DecryptionKey[] { + new Sealed.DecryptionKey( + // Invalid key + Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), + Sealed.DecryptionAlgorithm.AES_256_GCM), + new Sealed.DecryptionKey( + // Invalid key + Base64.getDecoder().decode("aW52YWxpZA=="), + Sealed.DecryptionAlgorithm.AES_256_GCM), + new Sealed.DecryptionKey(key, Sealed.DecryptionAlgorithm.AES_256_GCM) + })); + } + + @Test + public void unsealEventResponseWithEmptyDataTest() throws Exception { + byte[] sealedResult = new byte[0]; + byte[] key = Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); + + assertThrows( + Sealed.InvalidSealedDataHeaderException.class, + () -> + Sealed.unsealEventResponse( sealedResult, - new Sealed.DecryptionKey[]{ - new Sealed.DecryptionKey( - //Invalid key - Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), - Sealed.DecryptionAlgorithm.AES_256_GCM - ), - new Sealed.DecryptionKey( - Base64.getDecoder().decode("p2PA7MGy5tx56cnyJacZMr96BCFwZeHjZV2EqMvTq54="), - Sealed.DecryptionAlgorithm.AES_256_GCM - ), - new Sealed.DecryptionKey( - Base64.getDecoder().decode("aW52YWxpZA=="), - Sealed.DecryptionAlgorithm.AES_256_GCM - ) - } - )); - } - - @Test - public void unsealEventResponseWithInvalidNonceTest() throws Exception { - byte[] sealedResult = new byte[]{(byte) 0x9E, (byte) 0x85, (byte) 0xDC, (byte) 0xED, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC}; - byte[] key = Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); - - Sealed.UnsealAggregateException exception = assertThrows(Sealed.UnsealAggregateException.class, () -> Sealed.unsealEventResponse( + new Sealed.DecryptionKey[] { + new Sealed.DecryptionKey( + // Invalid key + Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), + Sealed.DecryptionAlgorithm.AES_256_GCM), + new Sealed.DecryptionKey( + // Invalid key + Base64.getDecoder().decode("aW52YWxpZA=="), + Sealed.DecryptionAlgorithm.AES_256_GCM), + new Sealed.DecryptionKey(key, Sealed.DecryptionAlgorithm.AES_256_GCM) + })); + } + + @Test + public void unsealEventResponseWithEmptyEventTest() throws Exception { + byte[] sealedResult = + Base64.getDecoder().decode("noXc7enbFVmf0ITsHkrqGgSDC0UNR/MIVD3hvIBk8qL1Y2/SHzr5S2E="); + byte[] key = Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); + + InvalidSealedDataException ex = + assertThrows( + Sealed.InvalidSealedDataException.class, + () -> + Sealed.unsealEventResponse( + sealedResult, + new Sealed.DecryptionKey[] { + new Sealed.DecryptionKey(key, Sealed.DecryptionAlgorithm.AES_256_GCM) + })); + assertEquals("Invalid sealed data", ex.getMessage()); + } + + @Test + public void unsealEventResponseWithInvalidKeysTest() throws Exception { + byte[] sealedResult = + Base64.getDecoder() + .decode( + "noXc7SXO+mqeAGrvBMgObi/S0fXTpP3zupk8qFqsO/1zdtWCD169iLA3VkkZh9ICHpZ0oWRzqG0M9/TnCeKFohgBLqDp6O0zEfXOv6i5q++aucItznQdLwrKLP+O0blfb4dWVI8/aSbd4ELAZuJJxj9bCoVZ1vk+ShbUXCRZTD30OIEAr3eiG9aw00y1UZIqMgX6CkFlU9L9OnKLsNsyomPIaRHTmgVTI5kNhrnVNyNsnzt9rY7fUD52DQxJILVPrUJ1Q+qW7VyNslzGYBPG0DyYlKbRAomKJDQIkdj/Uwa6bhSTq4XYNVvbk5AJ/dGwvsVdOnkMT2Ipd67KwbKfw5bqQj/cw6bj8Cp2FD4Dy4Ud4daBpPRsCyxBM2jOjVz1B/lAyrOp8BweXOXYugwdPyEn38MBZ5oL4D38jIwR/QiVnMHpERh93jtgwh9Abza6i4/zZaDAbPhtZLXSM5ztdctv8bAb63CppLU541Kf4OaLO3QLvfLRXK2n8bwEwzVAqQ22dyzt6/vPiRbZ5akh8JB6QFXG0QJF9DejsIspKF3JvOKjG2edmC9o+GfL3hwDBiihYXCGY9lElZICAdt+7rZm5UxMx7STrVKy81xcvfaIp1BwGh/HyMsJnkE8IczzRFpLlHGYuNDxdLoBjiifrmHvOCUDcV8UvhSV+UAZtAVejdNGo5G/bz0NF21HUO4pVRPu6RqZIs/aX4hlm6iO/0Ru00ct8pfadUIgRcephTuFC2fHyZxNBC6NApRtLSNLfzYTTo/uSjgcu6rLWiNo5G7yfrM45RXjalFEFzk75Z/fu9lCJJa5uLFgDNKlU+IaFjArfXJCll3apbZp4/LNKiU35ZlB7ZmjDTrji1wLep8iRVVEGht/DW00MTok7Zn7Fv+MlxgWmbZB3BuezwTmXb/fNw=="); + + assertThrows( + Sealed.UnsealAggregateException.class, + () -> + Sealed.unsealEventResponse( sealedResult, - new Sealed.DecryptionKey[]{ - new Sealed.DecryptionKey( - //Invalid key - Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), - Sealed.DecryptionAlgorithm.AES_256_GCM - ), - new Sealed.DecryptionKey( - //Invalid key - Base64.getDecoder().decode("aW52YWxpZA=="), - Sealed.DecryptionAlgorithm.AES_256_GCM - ), - new Sealed.DecryptionKey( - key, - Sealed.DecryptionAlgorithm.AES_256_GCM - ) - } - )); - - Sealed.UnsealException unsealException = (Sealed.UnsealException) exception.getSuppressed()[2]; - - assertEquals(unsealException.getCause().getMessage(), "12 > 3"); - } + new Sealed.DecryptionKey[] { + new Sealed.DecryptionKey( + // Invalid key + Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), + Sealed.DecryptionAlgorithm.AES_256_GCM), + new Sealed.DecryptionKey( + Base64.getDecoder().decode("p2PA7MGy5tx56cnyJacZMr96BCFwZeHjZV2EqMvTq54="), + Sealed.DecryptionAlgorithm.AES_256_GCM), + new Sealed.DecryptionKey( + Base64.getDecoder().decode("aW52YWxpZA=="), + Sealed.DecryptionAlgorithm.AES_256_GCM) + })); + } + + @Test + public void unsealEventResponseWithInvalidNonceTest() throws Exception { + byte[] sealedResult = + new byte[] { + (byte) 0x9E, (byte) 0x85, (byte) 0xDC, (byte) 0xED, (byte) 0xAA, (byte) 0xBB, (byte) 0xCC + }; + byte[] key = Base64.getDecoder().decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq53="); + + Sealed.UnsealAggregateException exception = + assertThrows( + Sealed.UnsealAggregateException.class, + () -> + Sealed.unsealEventResponse( + sealedResult, + new Sealed.DecryptionKey[] { + new Sealed.DecryptionKey( + // Invalid key + Base64.getDecoder() + .decode("p2PA7MGy5tx56cnyJaFZMr96BCFwZeHjZV2EqMvTq54="), + Sealed.DecryptionAlgorithm.AES_256_GCM), + new Sealed.DecryptionKey( + // Invalid key + Base64.getDecoder().decode("aW52YWxpZA=="), + Sealed.DecryptionAlgorithm.AES_256_GCM), + new Sealed.DecryptionKey(key, Sealed.DecryptionAlgorithm.AES_256_GCM) + })); + + Sealed.UnsealException unsealException = (Sealed.UnsealException) exception.getSuppressed()[2]; + + assertEquals(unsealException.getCause().getMessage(), "12 > 3"); + } } diff --git a/sdk/src/test/java/com/fingerprint/v4/SerializationTest.java b/sdk/src/test/java/com/fingerprint/v4/SerializationTest.java index 893d1312..447363ad 100644 --- a/sdk/src/test/java/com/fingerprint/v4/SerializationTest.java +++ b/sdk/src/test/java/com/fingerprint/v4/SerializationTest.java @@ -1,48 +1,99 @@ package com.fingerprint.v4; +import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; + import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.SerializationFeature; +import com.fasterxml.jackson.databind.node.ObjectNode; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fingerprint.v4.model.Event; -import com.fingerprint.v4.sdk.ApiException; +import com.fingerprint.v4.model.EventRuleAction; import com.fingerprint.v4.sdk.JSON; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInstance; - import java.io.IOException; import java.io.InputStream; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertTrue; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class SerializationTest { - private InputStream getFileAsIOStream(final String fileName) { - InputStream ioStream = this.getClass() - .getClassLoader() - .getResourceAsStream(fileName); + private InputStream getFileAsIOStream(final String fileName) { + InputStream ioStream = this.getClass().getClassLoader().getResourceAsStream(fileName); - if (ioStream == null) { - throw new IllegalArgumentException(fileName + " is not found"); - } - return ioStream; + if (ioStream == null) { + throw new IllegalArgumentException(fileName + " is not found"); } + return ioStream; + } - private static ObjectMapper getMapper() { - ObjectMapper mapper = new ObjectMapper(); - mapper.registerModule(new JavaTimeModule()); - mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); - mapper.configure(SerializationFeature.INDENT_OUTPUT, true); - return mapper; - } + private static ObjectMapper getMapper() { + ObjectMapper mapper = new ObjectMapper(); + mapper.registerModule(new JavaTimeModule()); + mapper.configure(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS, false); + mapper.configure(SerializationFeature.INDENT_OUTPUT, true); + return mapper; + } - @Test - public void deserializeSerializeEvent() throws IOException { - ObjectMapper sdkObjectMapper = JSON.getDefault().getMapper(); - Event event = sdkObjectMapper.readValue(getFileAsIOStream("mocks/events/get_event_200.json"), Event.class); + @Test + public void deserializeSerializeEvent() throws IOException { + ObjectMapper sdkObjectMapper = JSON.getDefault().getMapper(); + Event event = + sdkObjectMapper.readValue( + getFileAsIOStream("mocks/events/get_event_200.json"), Event.class); - ObjectMapper springLikeObjectMapper = getMapper(); - springLikeObjectMapper.writeValueAsString(event); - } + ObjectMapper springLikeObjectMapper = getMapper(); + springLikeObjectMapper.writeValueAsString(event); + } + + @Test + public void deserializeEventWithUnknownBotResultValue() throws IOException { + ObjectMapper sdkObjectMapper = JSON.getDefault().getMapper(); + + ObjectNode eventNode = + sdkObjectMapper.readValue( + getFileAsIOStream("mocks/events/get_event_200.json"), ObjectNode.class); + + // Set bot to an unknown enum value + eventNode.put("bot", "unknown_future_value"); + + assertDoesNotThrow( + () -> { + // Convert the modified ObjectNode back to an Event object to test deserialization + sdkObjectMapper.treeToValue(eventNode, Event.class); + }); + } + + @Test + public void deserializeEventWithUnknownSdkPlatformValue() throws IOException { + ObjectMapper sdkObjectMapper = JSON.getDefault().getMapper(); + + ObjectNode eventNode = + sdkObjectMapper.readValue( + getFileAsIOStream("mocks/events/get_event_200.json"), ObjectNode.class); + + eventNode.withObject("/sdk").put("platform", "unknown_future_value"); + + assertDoesNotThrow( + () -> { + // Convert the modified ObjectNode back to an Event object to test deserialization + sdkObjectMapper.treeToValue(eventNode, Event.class); + }); + } + + @Test + public void deserializeEventWithUnknownRuleActionTypeValue() throws IOException { + ObjectMapper sdkObjectMapper = JSON.getDefault().getMapper(); + + ObjectNode eventNode = + sdkObjectMapper.readValue( + getFileAsIOStream("mocks/events/get_event_ruleset_200.json"), ObjectNode.class); + + eventNode.withObject("/rule_action").put("type", "unknown_future_value"); + + // Convert the modified ObjectNode back to an Event object to test deserialization + Event event = sdkObjectMapper.treeToValue(eventNode, Event.class); + + assertInstanceOf(EventRuleAction.UnknownEventRuleAction.class, event.getRuleAction()); + } } diff --git a/sdk/src/test/java/com/fingerprint/v4/WebhookValidationTest.java b/sdk/src/test/java/com/fingerprint/v4/WebhookValidationTest.java index 068849e2..806c2fba 100644 --- a/sdk/src/test/java/com/fingerprint/v4/WebhookValidationTest.java +++ b/sdk/src/test/java/com/fingerprint/v4/WebhookValidationTest.java @@ -1,48 +1,50 @@ package com.fingerprint.v4; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInstance; import com.fingerprint.v4.sdk.WebhookValidation; import java.nio.charset.StandardCharsets; import java.security.NoSuchAlgorithmException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class WebhookValidationTest { - private static final String validHeader = "v1=1b2c16b75bd2a870c114153ccda5bcfca63314bc722fa160d690de133ccbb9db"; - private static final String secret = "secret"; - private static final byte[] data = "data".getBytes(StandardCharsets.UTF_8); - - @Test - public void validHeaderTest() throws NoSuchAlgorithmException { - boolean result = WebhookValidation.isSignatureValid(validHeader, data, secret); - Assertions.assertTrue(result); - } - - @Test - public void invalidHeaderTest() throws NoSuchAlgorithmException { - boolean result = WebhookValidation.isSignatureValid("v2=wrong", data, secret); - assert !result; - } - - @Test - public void headerWithoutVersionTest() throws NoSuchAlgorithmException { - boolean result = WebhookValidation.isSignatureValid("secretonly", data, secret); - assert !result; - } - - @Test - public void emptySecretTest() throws NoSuchAlgorithmException { - Assertions.assertThrows(IllegalArgumentException.class, () -> { - WebhookValidation.isSignatureValid("v1=value", data, ""); + private static final String validHeader = + "v1=1b2c16b75bd2a870c114153ccda5bcfca63314bc722fa160d690de133ccbb9db"; + private static final String secret = "secret"; + private static final byte[] data = "data".getBytes(StandardCharsets.UTF_8); + + @Test + public void validHeaderTest() throws NoSuchAlgorithmException { + boolean result = WebhookValidation.isSignatureValid(validHeader, data, secret); + Assertions.assertTrue(result); + } + + @Test + public void invalidHeaderTest() throws NoSuchAlgorithmException { + boolean result = WebhookValidation.isSignatureValid("v2=wrong", data, secret); + assert !result; + } + + @Test + public void headerWithoutVersionTest() throws NoSuchAlgorithmException { + boolean result = WebhookValidation.isSignatureValid("secretonly", data, secret); + assert !result; + } + + @Test + public void emptySecretTest() throws NoSuchAlgorithmException { + Assertions.assertThrows( + IllegalArgumentException.class, + () -> { + WebhookValidation.isSignatureValid("v1=value", data, ""); }); - } - - @Test - public void emptyDataTest() throws NoSuchAlgorithmException { - boolean result = WebhookValidation.isSignatureValid(validHeader, "".getBytes(), secret); - assert !result; - } + } + @Test + public void emptyDataTest() throws NoSuchAlgorithmException { + boolean result = WebhookValidation.isSignatureValid(validHeader, "".getBytes(), secret); + assert !result; + } } diff --git a/sdk/src/test/java/com/fingerprint/v4/api/FingerprintApiTest.java b/sdk/src/test/java/com/fingerprint/v4/api/FingerprintApiTest.java index a30fde4a..fdd3fe0e 100644 --- a/sdk/src/test/java/com/fingerprint/v4/api/FingerprintApiTest.java +++ b/sdk/src/test/java/com/fingerprint/v4/api/FingerprintApiTest.java @@ -1,500 +1,570 @@ package com.fingerprint.v4.api; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.mockito.ArgumentMatchers.any; +import static org.mockito.ArgumentMatchers.argThat; +import static org.mockito.ArgumentMatchers.eq; + import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonProcessingException; -import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import com.fingerprint.v4.model.*; +import com.fingerprint.v4.model.ErrorCode; +import com.fingerprint.v4.model.ErrorResponse; +import com.fingerprint.v4.model.Event; +import com.fingerprint.v4.model.EventRuleActionBlock; +import com.fingerprint.v4.model.EventSearch; +import com.fingerprint.v4.model.EventUpdate; +import com.fingerprint.v4.model.ProxyDetails; +import com.fingerprint.v4.model.RuleActionType; +import com.fingerprint.v4.model.SearchEventsBot; +import com.fingerprint.v4.model.SearchEventsSdkPlatform; +import com.fingerprint.v4.model.SearchEventsVpnConfidence; +import com.fingerprint.v4.model.VelocityData; import com.fingerprint.v4.sdk.ApiClient; import com.fingerprint.v4.sdk.ApiException; import com.fingerprint.v4.sdk.ApiResponse; +import com.fingerprint.v4.sdk.JSON; import com.fingerprint.v4.sdk.Pair; -import jakarta.ws.rs.core.GenericType; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.TestInstance; -import org.mockito.Mockito; -import org.mockito.invocation.InvocationOnMock; - import java.io.IOException; import java.io.InputStream; import java.net.URLDecoder; import java.nio.charset.StandardCharsets; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; - -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.ArgumentMatchers.*; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.mockito.Mockito; +import org.mockito.invocation.InvocationOnMock; /** * API tests for FingerprintApi */ @TestInstance(TestInstance.Lifecycle.PER_CLASS) public class FingerprintApiTest { - private FingerprintApi api; - private static final String MOCK_REQUEST_ID = "0KSh65EnVoB85JBmloQK"; - private static final String MOCK_VISITOR_ID = "AcxioeQKffpXF8iGQK3P"; - private static final String MOCK_WEBHOOK_VISITOR_ID = "Ibk1527CUFmcnjLwIs4A9"; - private static final String MOCK_WEBHOOK_EVENT_ID = "1708102555327.NLOjmg"; - - private static final ObjectMapper MAPPER = getMapper(); - - private InputStream getFileAsIOStream(final String fileName) { - InputStream ioStream = this.getClass() - .getClassLoader() - .getResourceAsStream(fileName); - - if (ioStream == null) { - throw new IllegalArgumentException(fileName + " is not found"); - } - return ioStream; - } + private FingerprintApi api; + private static final String MOCK_REQUEST_ID = "0KSh65EnVoB85JBmloQK"; + private static final String MOCK_VISITOR_ID = "AcxioeQKffpXF8iGQK3P"; + private static final String MOCK_WEBHOOK_VISITOR_ID = "Ibk1527CUFmcnjLwIs4A9"; + private static final String MOCK_WEBHOOK_EVENT_ID = "1708102555327.NLOjmg"; - private void validateIntegrationInfo(List queryParams) { - List iiValues = queryParams.stream() - .filter(pair -> "ii".equals(pair.getName())) - .map(Pair::getValue) - .collect(Collectors.toList()); - assertEquals(1, iiValues.size()); - assertEquals(FingerprintApi.INTEGRATION_INFO, iiValues.get(0)); - } + private static final ObjectMapper MAPPER = JSON.getDefault().getMapper(); - @BeforeAll - public void before() { - ApiClient realApiClient = new ApiClient(); - ApiClient apiClient = Mockito.spy(realApiClient); - // apiClient.setBearerToken("MOCK_API_KEY"); - api = new FingerprintApi(apiClient); - } + private InputStream getFileAsIOStream(final String fileName) { + InputStream ioStream = this.getClass().getClassLoader().getResourceAsStream(fileName); - private static ObjectMapper getMapper() { - ObjectMapper mapper = new ObjectMapper().registerModule(new JavaTimeModule()); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - mapper.configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false); - return mapper; + if (ioStream == null) { + throw new IllegalArgumentException(fileName + " is not found"); } - - @FunctionalInterface - public interface ApiAnswerFunction { - ApiResponse apply(InvocationOnMock invocation) throws ApiException, IOException; + return ioStream; + } + + private void validateIntegrationInfo(List queryParams) { + List iiValues = + queryParams.stream() + .filter(pair -> "ii".equals(pair.getName())) + .map(Pair::getValue) + .collect(Collectors.toList()); + assertEquals(1, iiValues.size()); + assertEquals(FingerprintApi.INTEGRATION_INFO, iiValues.get(0)); + } + + @BeforeAll + public void before() { + ApiClient realApiClient = new ApiClient(); + ApiClient apiClient = Mockito.spy(realApiClient); + api = new FingerprintApi(apiClient); + } + + @FunctionalInterface + public interface ApiAnswerFunction { + ApiResponse apply(InvocationOnMock invocation) throws ApiException, IOException; + } + + private void addMock(String operation, String path, ApiAnswerFunction answerFunction) + throws ApiException { + ApiClient apiClient = api.getApiClient(); + String operationName = "FingerprintApi." + operation; + String httpMethod; + switch (operation) { + case "getEvent": + path = "/events/" + path; + httpMethod = "GET"; + break; + case "updateEvent": + path = "/events/" + path; + httpMethod = "PATCH"; + break; + case "deleteVisitorData": + path = "/visitors/" + path; + httpMethod = "DELETE"; + break; + case "searchEvents": + path = "/events"; + httpMethod = "GET"; + break; + default: + throw new IllegalArgumentException("Unknown operation: " + operation); } - - private void addMock(String operation, String path, ApiAnswerFunction answerFunction) throws ApiException { - ApiClient apiClient = api.getApiClient(); - String operationName = "FingerprintApi." + operation; - String httpMethod; - switch (operation) { - case "getEvent": - path = "/events/" + path; - httpMethod = "GET"; - break; - case "updateEvent": - path = "/events/" + path; - httpMethod = "PATCH"; - break; - case "deleteVisitorData": - path = "/visitors/" + path; - httpMethod = "DELETE"; - break; - case "searchEvents": - path = "/events"; - httpMethod = "GET"; - break; - default: - throw new IllegalArgumentException("Unknown operation: " + operation); - } - Mockito.doAnswer(invocation -> { - validateIntegrationInfo(invocation.getArgument(3)); - ApiResponse result = answerFunction.apply(invocation); - if (result.getStatusCode() == 200) { + Mockito.doAnswer( + invocation -> { + validateIntegrationInfo(invocation.getArgument(3)); + ApiResponse result = answerFunction.apply(invocation); + if (result.getStatusCode() == 200) { return result; - } else { - throw new ApiException(result.getStatusCode(), result.getHeaders(), result.getData().toString()); - } - }).when(apiClient).invokeAPI( - eq(operationName), // operation, for example "FingerprintApi.getEvent" - eq(path), // path - eq(httpMethod), // HTTP-method - any(), // queryParams - argThat(body -> { - if (httpMethod.equals("PATCH")) { - return body != null; - } else { - return body == null; - } + } else { + String responseBody = MAPPER.writeValueAsString(result.getData()); + throw new ApiException(result.getStatusCode(), result.getHeaders(), responseBody); + } + }) + .when(apiClient) + .invokeAPI( + eq(operationName), // operation, for example + // "FingerprintApi.getEvent" + eq(path), // path + eq(httpMethod), // HTTP-method + any(), // queryParams + argThat( + body -> { + if (httpMethod.equals("PATCH")) { + return body != null; + } else { + return body == null; + } }), - any(), // headerParams - any(), // cookieParams - any(), // formParams - any(), // accept - any(), // contentType - any(), // authNames - any(), // returnType - eq(false) // isBodyNullable - ); - } - - ApiResponse mockFileToResponse(int statusCode, InvocationOnMock invocation, String path) throws IOException { - GenericType returnType = invocation.getArgument(11); - if (statusCode == 200) { - return new ApiResponse<>(statusCode, null, - path != null ? MAPPER.readValue(getFileAsIOStream(path), returnType.getRawType()) : null); - } else { - return new ApiResponse<>(statusCode, null, - new String(getFileAsIOStream(path).readAllBytes(), StandardCharsets.UTF_8)); - } + any(), // headerParams + any(), // cookieParams + any(), // formParams + any(), // accept + any(), // contentType + any(), // authNames + any(), // returnType + eq(false) // isBodyNullable + ); + } + + ApiResponse mockFileToResponse( + int statusCode, InvocationOnMock invocation, String path, Class responseType) + throws IOException { + return new ApiResponse( + statusCode, + null, + path != null ? MAPPER.readValue(getFileAsIOStream(path), responseType) : null); + } + + public static boolean listContainsPair(List pairs, String key, Object value) { + if (pairs == null) { + return false; } - - public static boolean listContainsPair(List pairs, String key, Object value) { - if (pairs == null) { - return false; - } - for (Pair pair : pairs) { - if (key.equals(pair.getName()) && value.equals(pair.getValue())) { - return true; - } - } - return false; + for (Pair pair : pairs) { + if (key.equals(pair.getName()) && value.equals(pair.getValue())) { + return true; + } } - - /** - * Get event by requestId - * This endpoint allows you to get events with all the information from each - * activated product (Fingerprint Pro or Bot Detection). Use the requestId as a - * URL path :request_id parameter. This API method is scoped to a request, i.e. - * all returned information is by requestId. - * - * @throws ApiException if the Api call fails - */ - @Test - public void getEventTest() throws ApiException { - addMock("getEvent", MOCK_REQUEST_ID, invocation -> { - return mockFileToResponse(200, invocation, "mocks/events/get_event_200.json"); + return false; + } + + /** + * Get event by requestId + * This endpoint allows you to get events with all the information from each + * activated product (Fingerprint Pro or Bot Detection). Use the requestId as a + * URL path :request_id parameter. This API method is scoped to a request, i.e. + * all returned information is by requestId. + * + * @throws ApiException if the Api call fails + */ + @Test + public void getEventTest() throws ApiException { + addMock( + "getEvent", + MOCK_REQUEST_ID, + invocation -> { + return mockFileToResponse( + 200, invocation, "mocks/events/get_event_200.json", Event.class); }); - Event response = api.getEvent(MOCK_REQUEST_ID); - assertNotNull(response); - assertNotNull(response.getIdentification()); - assertEquals("Ibk1527CUFmcnjLwIs4A9", response.getIdentification().getVisitorId()); - - assertFalse(response.getClonedApp()); - assertFalse(response.getEmulator()); - assertFalse(response.getFrida()); - assertFalse(response.getJailbroken()); - assertFalse(response.getIpBlocklist().getEmailSpam()); - assertFalse(response.getIpBlocklist().getTorNode()); - assertTrue(response.getProxy()); - assertEquals(ProxyDetails.ProxyTypeEnum.RESIDENTIAL, response.getProxyDetails().getProxyType()); - assertEquals(1708102555327L, response.getProxyDetails().getLastSeenAt()); - assertFalse(response.getTampering()); - assertFalse(response.getVpn()); - assertFalse(response.getVirtualMachine()); - assertInstanceOf(VelocityData.class, response.getVelocity().getDistinctCountry()); - assertFalse(response.getLocationSpoofing()); - assertEquals(0L, response.getFactoryResetTimestamp()); - } - - @Test - public void updateEventLinkedIdRequest() throws ApiException { - final String LINKED_ID = "myLinkedId"; - EventUpdate request = new EventUpdate(); - request.setLinkedId(LINKED_ID); - - addMock("updateEvent", MOCK_REQUEST_ID, invocation -> { - List queryParams = invocation.getArgument(3); - assertEquals(1, queryParams.size()); - - EventUpdate body = invocation.getArgument(4); - assertEquals(LINKED_ID, body.getLinkedId()); - assertNull(body.getTags()); - assertNull(body.getSuspect()); - return mockFileToResponse(200, invocation, null); + Event response = api.getEvent(MOCK_REQUEST_ID); + assertNotNull(response); + assertNotNull(response.getIdentification()); + assertEquals("Ibk1527CUFmcnjLwIs4A9", response.getIdentification().getVisitorId()); + + assertFalse(response.getClonedApp()); + assertFalse(response.getEmulator()); + assertFalse(response.getFrida()); + assertFalse(response.getJailbroken()); + assertFalse(response.getIpBlocklist().getEmailSpam()); + assertFalse(response.getIpBlocklist().getTorNode()); + assertTrue(response.getProxy()); + assertEquals(ProxyDetails.ProxyTypeEnum.RESIDENTIAL, response.getProxyDetails().getProxyType()); + assertEquals(1708102555327L, response.getProxyDetails().getLastSeenAt()); + assertFalse(response.getTampering()); + assertFalse(response.getVpn()); + assertFalse(response.getVirtualMachine()); + assertInstanceOf(VelocityData.class, response.getVelocity().getDistinctCountry()); + assertFalse(response.getLocationSpoofing()); + assertEquals(0L, response.getFactoryResetTimestamp()); + assertNotNull(response.getTags()); + assertTrue(response.getTags().isEmpty()); + } + + @Test + public void updateEventLinkedIdRequest() throws ApiException { + final String LINKED_ID = "myLinkedId"; + EventUpdate request = new EventUpdate(); + request.setLinkedId(LINKED_ID); + + addMock( + "updateEvent", + MOCK_REQUEST_ID, + invocation -> { + List queryParams = invocation.getArgument(3); + assertEquals(1, queryParams.size()); + + EventUpdate body = invocation.getArgument(4); + assertEquals(LINKED_ID, body.getLinkedId()); + assertNotNull(body.getTags()); + assertTrue(body.getTags().isEmpty()); + assertNull(body.getSuspect()); + return mockFileToResponse(200, invocation, null, Void.class); }); - api.updateEvent(MOCK_REQUEST_ID, request); - } - - @Test - public void updateEventTagRequest() throws ApiException { - final Map TAG = new HashMap<>(); - TAG.put("stringKey", "value"); - TAG.put("booleanPositiveKey", true); - TAG.put("booleanNegativeKey", false); - TAG.put("numberKey", 123); - TAG.put("arrayStringKey", new String[] { "value1", "value2" }); - TAG.put("arrayIntKey", new int[] { 1, 2, 7 }); - TAG.put("arrayEmptyKey", new int[] {}); - TAG.put("mapKey", new HashMap() { - { - put("key1", "value1"); - put("key2", 2); - } + api.updateEvent(MOCK_REQUEST_ID, request); + } + + @Test + public void updateEventTagRequest() throws ApiException { + final Map TAG = new HashMap<>(); + TAG.put("stringKey", "value"); + TAG.put("booleanPositiveKey", true); + TAG.put("booleanNegativeKey", false); + TAG.put("numberKey", 123); + TAG.put("arrayStringKey", new String[] {"value1", "value2"}); + TAG.put("arrayIntKey", new int[] {1, 2, 7}); + TAG.put("arrayEmptyKey", new int[] {}); + TAG.put( + "mapKey", + new HashMap() { + { + put("key1", "value1"); + put("key2", 2); + } }); - EventUpdate request = new EventUpdate(); - request.setTags(TAG); - - addMock("updateEvent", MOCK_REQUEST_ID, invocation -> { - List queryParams = invocation.getArgument(3); - assertEquals(1, queryParams.size()); - - EventUpdate body = invocation.getArgument(4); - assertNull(body.getLinkedId()); - assertEquals(TAG, body.getTags()); - assertNull(body.getSuspect()); - return mockFileToResponse(200, invocation, null); + EventUpdate request = new EventUpdate(); + request.setTags(TAG); + + addMock( + "updateEvent", + MOCK_REQUEST_ID, + invocation -> { + List queryParams = invocation.getArgument(3); + assertEquals(1, queryParams.size()); + + EventUpdate body = invocation.getArgument(4); + assertNull(body.getLinkedId()); + assertEquals(TAG, body.getTags()); + assertNull(body.getSuspect()); + return mockFileToResponse(200, invocation, null, Void.class); }); - api.updateEvent(MOCK_REQUEST_ID, request); - } - - @Test - public void updateEventSuspectPositiveRequest() throws ApiException { - EventUpdate request = new EventUpdate(); - request.setSuspect(true); - - addMock("updateEvent", MOCK_REQUEST_ID, invocation -> { - List queryParams = invocation.getArgument(3); - assertEquals(1, queryParams.size()); - - EventUpdate body = invocation.getArgument(4); - assertNull(body.getLinkedId()); - assertNull(body.getTags()); - assertTrue(body.getSuspect()); - return mockFileToResponse(200, invocation, null); + api.updateEvent(MOCK_REQUEST_ID, request); + } + + @Test + public void updateEventSuspectPositiveRequest() throws ApiException { + EventUpdate request = new EventUpdate(); + request.setSuspect(true); + + addMock( + "updateEvent", + MOCK_REQUEST_ID, + invocation -> { + List queryParams = invocation.getArgument(3); + assertEquals(1, queryParams.size()); + + EventUpdate body = invocation.getArgument(4); + assertNull(body.getLinkedId()); + assertNotNull(body.getTags()); + assertTrue(body.getTags().isEmpty()); + assertTrue(body.getSuspect()); + return mockFileToResponse(200, invocation, null, Void.class); }); - api.updateEvent(MOCK_REQUEST_ID, request); - } - - @Test - public void updateEventSuspectNegativeRequest() throws ApiException { - EventUpdate request = new EventUpdate(); - request.setSuspect(false); - - addMock("updateEvent", MOCK_REQUEST_ID, invocation -> { - List queryParams = invocation.getArgument(3); - assertEquals(1, queryParams.size()); - - EventUpdate body = invocation.getArgument(4); - assertNull(body.getLinkedId()); - assertNull(body.getTags()); - assertFalse(body.getSuspect()); - return mockFileToResponse(200, invocation, null); + api.updateEvent(MOCK_REQUEST_ID, request); + } + + @Test + public void updateEventSuspectNegativeRequest() throws ApiException { + EventUpdate request = new EventUpdate(); + request.setSuspect(false); + + addMock( + "updateEvent", + MOCK_REQUEST_ID, + invocation -> { + List queryParams = invocation.getArgument(3); + assertEquals(1, queryParams.size()); + + EventUpdate body = invocation.getArgument(4); + assertNull(body.getLinkedId()); + assertNotNull(body.getTags()); + assertTrue(body.getTags().isEmpty()); + assertFalse(body.getSuspect()); + return mockFileToResponse(200, invocation, null, Void.class); }); - api.updateEvent(MOCK_REQUEST_ID, request); - } - - @Test - public void updateMultipleFieldsEventRequest() throws ApiException { - final String LINKED_ID = "myLinkedId"; - final Map TAG = new HashMap<>(); - TAG.put("stringKey", "value"); - TAG.put("booleanKey", true); - TAG.put("numberKey", 123); - TAG.put("arrayStringKey", new String[] { "value1", "value2" }); - EventUpdate request = new EventUpdate(); - request.setLinkedId(LINKED_ID); - request.setTags(TAG); - request.setSuspect(true); - - addMock("updateEvent", MOCK_REQUEST_ID, invocation -> { - List queryParams = invocation.getArgument(3); - assertEquals(1, queryParams.size()); - - EventUpdate body = invocation.getArgument(4); - assertEquals(LINKED_ID, body.getLinkedId()); - assertEquals(TAG, body.getTags()); - assertTrue(body.getSuspect()); - return mockFileToResponse(200, invocation, null); + api.updateEvent(MOCK_REQUEST_ID, request); + } + + @Test + public void updateMultipleFieldsEventRequest() throws ApiException { + final String LINKED_ID = "myLinkedId"; + final Map TAG = new HashMap<>(); + TAG.put("stringKey", "value"); + TAG.put("booleanKey", true); + TAG.put("numberKey", 123); + TAG.put("arrayStringKey", new String[] {"value1", "value2"}); + EventUpdate request = new EventUpdate(); + request.setLinkedId(LINKED_ID); + request.setTags(TAG); + request.setSuspect(true); + + addMock( + "updateEvent", + MOCK_REQUEST_ID, + invocation -> { + List queryParams = invocation.getArgument(3); + assertEquals(1, queryParams.size()); + + EventUpdate body = invocation.getArgument(4); + assertEquals(LINKED_ID, body.getLinkedId()); + assertEquals(TAG, body.getTags()); + assertTrue(body.getSuspect()); + return mockFileToResponse(200, invocation, null, Void.class); }); - api.updateEvent(MOCK_REQUEST_ID, request); - } - - @Test - public void deleteVisitorDataTest() throws ApiException { - addMock("deleteVisitorData", MOCK_VISITOR_ID, invocation -> { - List queryParams = invocation.getArgument(3); - assertEquals(1, queryParams.size()); - - return mockFileToResponse(200, invocation, null); + api.updateEvent(MOCK_REQUEST_ID, request); + } + + @Test + public void deleteVisitorDataTest() throws ApiException { + addMock( + "deleteVisitorData", + MOCK_VISITOR_ID, + invocation -> { + List queryParams = invocation.getArgument(3); + assertEquals(1, queryParams.size()); + + return mockFileToResponse(200, invocation, null, Void.class); }); - api.deleteVisitorData(MOCK_VISITOR_ID); - } - - /** - * Webhook - * Check that webhook correctly deserializes the JSON payload to the - * WebhookVisit object. - * - * @throws Exception if the file reading or deserialization fails. - */ - @Test - public void webhookTest() throws Exception { - ObjectMapper mapper = new ObjectMapper().registerModule(new JavaTimeModule()); - mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); - - Event event = mapper.readValue(getFileAsIOStream("mocks/webhook/webhook_event.json"), Event.class); - - assertEquals(MOCK_WEBHOOK_VISITOR_ID, event.getIdentification().getVisitorId()); - assertEquals(MOCK_WEBHOOK_EVENT_ID, event.getEventId()); - } - - @Test - public void searchEventsMinimumParamsTest() throws ApiException { - int LIMIT = 1; - addMock("searchEvents", null, invocation -> { - List queryParams = invocation.getArgument(3); - assertEquals(2, queryParams.size()); - assertTrue(listContainsPair(queryParams, "limit", String.valueOf(LIMIT))); - - return mockFileToResponse(200, invocation, "mocks/events/search/get_event_search_200.json"); + api.deleteVisitorData(MOCK_VISITOR_ID); + } + + /** + * Webhook + * Check that webhook correctly deserializes the JSON payload to the + * WebhookVisit object. + * + * @throws Exception if the file reading or deserialization fails. + */ + @Test + public void webhookTest() throws Exception { + ObjectMapper mapper = new ObjectMapper().registerModule(new JavaTimeModule()); + mapper.setSerializationInclusion(JsonInclude.Include.NON_NULL); + + Event event = + mapper.readValue(getFileAsIOStream("mocks/webhook/webhook_event.json"), Event.class); + + assertEquals(MOCK_WEBHOOK_VISITOR_ID, event.getIdentification().getVisitorId()); + assertEquals(MOCK_WEBHOOK_EVENT_ID, event.getEventId()); + } + + @Test + public void searchEventsMinimumParamsTest() throws ApiException { + int LIMIT = 1; + addMock( + "searchEvents", + null, + invocation -> { + List queryParams = invocation.getArgument(3); + assertEquals(2, queryParams.size()); + assertTrue(listContainsPair(queryParams, "limit", String.valueOf(LIMIT))); + + return mockFileToResponse( + 200, invocation, "mocks/events/search/get_event_search_200.json", EventSearch.class); }); - EventSearch response = api.searchEvents(new FingerprintApi.SearchEventsOptionalParams().setLimit(LIMIT)); - List events = response.getEvents(); - - assertEquals(events.size(), 1); - Event event = events.get(0); - - assertNotNull(event); - assertNotNull(event.getIdentification()); - assertEquals("Ibk1527CUFmcnjLwIs4A9", event.getIdentification().getVisitorId()); - - assertFalse(event.getClonedApp()); - assertFalse(event.getEmulator()); - assertFalse(event.getFrida()); - assertFalse(event.getJailbroken()); - assertFalse(event.getIpBlocklist().getAttackSource()); - assertFalse(event.getIpBlocklist().getTorNode()); - assertTrue(event.getProxy()); - assertFalse(event.getTampering()); - assertFalse(event.getVpn()); - assertFalse(event.getVirtualMachine()); - assertInstanceOf(VelocityData.class, event.getVelocity().getDistinctVisitorIdByLinkedId()); - assertFalse(event.getLocationSpoofing()); - assertEquals(0L, event.getFactoryResetTimestamp()); - } - - @Test - public void searchEventsMaximumParamsTest() throws ApiException { - final int LIMIT = 1; - final String PAGINATION_KEY = "1741187431959"; - final SearchEventsBot BOT = SearchEventsBot.GOOD; - final String IP_ADDRESS = "192.168.0.1/32"; - final String LINKED_ID = "some_id"; - final Long START = 1582299576511L; - final Long END = 1582299576513L; - final Boolean REVERSE = true; - final Boolean SUSPECT = false; - final Boolean ANTI_DETECT_BROWSER = true; - final Boolean CLONED_APP = true; - final Boolean FACTORY_RESET = true; - final Boolean FRIDA = true; - final Boolean JAILBROKEN = true; - final Float MIN_SUSPECT_SCORE = 0.5f; - final Boolean PRIVACY_SETTINGS = true; - final Boolean ROOT_APPS = true; - final Boolean TAMPERING = true; - final Boolean VIRTUAL_MACHINE = true; - final Boolean VPN = true; - final SearchEventsVpnConfidence VPN_CONFIDENCE = SearchEventsVpnConfidence.MEDIUM; - final Boolean EMULATOR = true; - final Boolean INCOGNITO = true; - final Boolean IP_BLOCKLIST = true; - final Boolean DATACENTER = true; - final Boolean DEVELOPER_TOOLS = true; - final Boolean LOCATION_SPOOFING = true; - final Boolean MITM_ATTACK = true; - final Boolean PROXY = true; - final String SDK_VERSION = "testSdkVersion"; - final SearchEventsSdkPlatform SDK_PLATFORM = SearchEventsSdkPlatform.JS; - final List ENVIRONMENT = new ArrayList(); - ENVIRONMENT.add("env1"); - ENVIRONMENT.add("env2"); - final String PROXIMITY_ID = "testProximityId"; - final String ASN = "testAsn"; - // final Integer PROXIMITY_PRECISION_RADIUS = 10; - - Map expectedQueryParams = new HashMap<>(); - expectedQueryParams.put("limit", String.valueOf(LIMIT)); - expectedQueryParams.put("pagination_key", PAGINATION_KEY); - expectedQueryParams.put("visitor_id", MOCK_VISITOR_ID); - expectedQueryParams.put("bot", String.valueOf(BOT)); - expectedQueryParams.put("ip_address", IP_ADDRESS); - expectedQueryParams.put("linked_id", LINKED_ID); - expectedQueryParams.put("start", START.toString()); - expectedQueryParams.put("end", END.toString()); - expectedQueryParams.put("reverse", String.valueOf(REVERSE)); - expectedQueryParams.put("suspect", String.valueOf(SUSPECT)); - expectedQueryParams.put("anti_detect_browser", String.valueOf(ANTI_DETECT_BROWSER)); - expectedQueryParams.put("cloned_app", String.valueOf(CLONED_APP)); - expectedQueryParams.put("factory_reset", String.valueOf(FACTORY_RESET)); - expectedQueryParams.put("frida", String.valueOf(FRIDA)); - expectedQueryParams.put("jailbroken", String.valueOf(JAILBROKEN)); - expectedQueryParams.put("min_suspect_score", MIN_SUSPECT_SCORE.toString()); - expectedQueryParams.put("privacy_settings", String.valueOf(PRIVACY_SETTINGS)); - expectedQueryParams.put("root_apps", String.valueOf(ROOT_APPS)); - expectedQueryParams.put("tampering", String.valueOf(TAMPERING)); - expectedQueryParams.put("virtual_machine", String.valueOf(VIRTUAL_MACHINE)); - expectedQueryParams.put("vpn", String.valueOf(VPN)); - expectedQueryParams.put("vpn_confidence", String.valueOf(VPN_CONFIDENCE)); - expectedQueryParams.put("emulator", String.valueOf(EMULATOR)); - expectedQueryParams.put("incognito", String.valueOf(INCOGNITO)); - // expectedQueryParams.put("ip_blocklist", String.valueOf(IP_BLOCKLIST)); - // expectedQueryParams.put("datacenter", String.valueOf(DATACENTER)); - expectedQueryParams.put("developer_tools", String.valueOf(DEVELOPER_TOOLS)); - expectedQueryParams.put("location_spoofing", String.valueOf(LOCATION_SPOOFING)); - expectedQueryParams.put("mitm_attack", String.valueOf(MITM_ATTACK)); - expectedQueryParams.put("proxy", String.valueOf(PROXY)); - expectedQueryParams.put("sdk_version", SDK_VERSION); - expectedQueryParams.put("sdk_platform", String.valueOf(SDK_PLATFORM)); - expectedQueryParams.put("proximity_id", PROXIMITY_ID); - expectedQueryParams.put("asn", ASN); - // expectedQueryParams.put("proximity_precision_radius", - // String.valueOf(PROXIMITY_PRECISION_RADIUS)); - - addMock("searchEvents", null, invocation -> { - List queryParams = invocation.getArgument(3); - // base expected + 1 for "ii" + N for each environment entry - assertEquals(expectedQueryParams.size() + 1 + ENVIRONMENT.size(), queryParams.size()); - for (Map.Entry expected : expectedQueryParams.entrySet()) { - assertTrue(listContainsPair(queryParams, expected.getKey(), expected.getValue())); - } - - List actualEnv = queryParams.stream() - .filter(p -> "environment".equals(p.getName()) || "environment[]".equals(p.getName())) - .map(Pair::getValue) - // if your Pair values might be percent-encoded, decode them - .map(v -> URLDecoder.decode(v, StandardCharsets.UTF_8)) - .collect(Collectors.toList()); - - assertEquals(ENVIRONMENT, actualEnv); - - return mockFileToResponse(200, invocation, "mocks/events/search/get_event_search_200.json"); + EventSearch response = + api.searchEvents(new FingerprintApi.SearchEventsOptionalParams().setLimit(LIMIT)); + List events = response.getEvents(); + + assertEquals(events.size(), 1); + Event event = events.get(0); + + assertNotNull(event); + assertNotNull(event.getIdentification()); + assertEquals("Ibk1527CUFmcnjLwIs4A9", event.getIdentification().getVisitorId()); + + assertFalse(event.getClonedApp()); + assertFalse(event.getEmulator()); + assertFalse(event.getFrida()); + assertFalse(event.getJailbroken()); + assertFalse(event.getIpBlocklist().getAttackSource()); + assertFalse(event.getIpBlocklist().getTorNode()); + assertTrue(event.getProxy()); + assertFalse(event.getTampering()); + assertFalse(event.getVpn()); + assertFalse(event.getVirtualMachine()); + assertInstanceOf(VelocityData.class, event.getVelocity().getDistinctVisitorIdByLinkedId()); + assertFalse(event.getLocationSpoofing()); + assertEquals(0L, event.getFactoryResetTimestamp()); + } + + @Test + public void searchEventsMaximumParamsTest() throws ApiException { + final int LIMIT = 1; + final String PAGINATION_KEY = "1741187431959"; + final SearchEventsBot BOT = SearchEventsBot.GOOD; + final String IP_ADDRESS = "192.168.0.1/32"; + final String ASN = "testAsn"; + final String LINKED_ID = "some_id"; + final String URL = "https://example.com/page"; + final String BUNDLE_ID = "com.example.bundleId"; + final String PACKAGE_NAME = "com.example"; + final String ORIGIN = "https://example.com"; + final Long START = 1582299576511L; + final Long END = 1582299576513L; + final Boolean REVERSE = true; + final Boolean SUSPECT = false; + final Boolean ANTI_DETECT_BROWSER = true; + final Boolean CLONED_APP = true; + final Boolean FACTORY_RESET = true; + final Boolean FRIDA = true; + final Boolean JAILBROKEN = true; + final Float MIN_SUSPECT_SCORE = 0.5f; + final Boolean PRIVACY_SETTINGS = true; + final Boolean ROOT_APPS = true; + final Boolean TAMPERING = true; + final Boolean VIRTUAL_MACHINE = true; + final Boolean VPN = true; + final SearchEventsVpnConfidence VPN_CONFIDENCE = SearchEventsVpnConfidence.MEDIUM; + final Boolean EMULATOR = true; + final Boolean INCOGNITO = true; + final Boolean DEVELOPER_TOOLS = true; + final Boolean LOCATION_SPOOFING = true; + final Boolean MITM_ATTACK = true; + final Boolean PROXY = true; + final String SDK_VERSION = "testSdkVersion"; + final SearchEventsSdkPlatform SDK_PLATFORM = SearchEventsSdkPlatform.JS; + final List ENVIRONMENT = new ArrayList(); + ENVIRONMENT.add("env1"); + ENVIRONMENT.add("env2"); + final String PROXIMITY_ID = "testProximityId"; + final Long TOTAL_HITS = 10L; + final Boolean TOR_NODE = true; + + Map expectedQueryParams = new HashMap<>(); + expectedQueryParams.put("limit", String.valueOf(LIMIT)); + expectedQueryParams.put("pagination_key", PAGINATION_KEY); + expectedQueryParams.put("visitor_id", MOCK_VISITOR_ID); + expectedQueryParams.put("bot", String.valueOf(BOT)); + expectedQueryParams.put("ip_address", IP_ADDRESS); + expectedQueryParams.put("asn", ASN); + expectedQueryParams.put("linked_id", LINKED_ID); + expectedQueryParams.put("url", URL); + expectedQueryParams.put("bundle_id", BUNDLE_ID); + expectedQueryParams.put("package_name", PACKAGE_NAME); + expectedQueryParams.put("origin", ORIGIN); + expectedQueryParams.put("start", START.toString()); + expectedQueryParams.put("end", END.toString()); + expectedQueryParams.put("reverse", String.valueOf(REVERSE)); + expectedQueryParams.put("suspect", String.valueOf(SUSPECT)); + expectedQueryParams.put("anti_detect_browser", String.valueOf(ANTI_DETECT_BROWSER)); + expectedQueryParams.put("cloned_app", String.valueOf(CLONED_APP)); + expectedQueryParams.put("factory_reset", String.valueOf(FACTORY_RESET)); + expectedQueryParams.put("frida", String.valueOf(FRIDA)); + expectedQueryParams.put("jailbroken", String.valueOf(JAILBROKEN)); + expectedQueryParams.put("min_suspect_score", MIN_SUSPECT_SCORE.toString()); + expectedQueryParams.put("privacy_settings", String.valueOf(PRIVACY_SETTINGS)); + expectedQueryParams.put("root_apps", String.valueOf(ROOT_APPS)); + expectedQueryParams.put("tampering", String.valueOf(TAMPERING)); + expectedQueryParams.put("virtual_machine", String.valueOf(VIRTUAL_MACHINE)); + expectedQueryParams.put("vpn", String.valueOf(VPN)); + expectedQueryParams.put("vpn_confidence", String.valueOf(VPN_CONFIDENCE)); + expectedQueryParams.put("emulator", String.valueOf(EMULATOR)); + expectedQueryParams.put("incognito", String.valueOf(INCOGNITO)); + expectedQueryParams.put("developer_tools", String.valueOf(DEVELOPER_TOOLS)); + expectedQueryParams.put("location_spoofing", String.valueOf(LOCATION_SPOOFING)); + expectedQueryParams.put("mitm_attack", String.valueOf(MITM_ATTACK)); + expectedQueryParams.put("proxy", String.valueOf(PROXY)); + expectedQueryParams.put("sdk_version", SDK_VERSION); + expectedQueryParams.put("sdk_platform", String.valueOf(SDK_PLATFORM)); + expectedQueryParams.put("proximity_id", PROXIMITY_ID); + expectedQueryParams.put("total_hits", String.valueOf(TOTAL_HITS)); + expectedQueryParams.put("tor_node", String.valueOf(TOR_NODE)); + + addMock( + "searchEvents", + null, + invocation -> { + List queryParams = invocation.getArgument(3); + // base expected + 1 for "ii" + N for each environment entry + assertEquals(expectedQueryParams.size() + 1 + ENVIRONMENT.size(), queryParams.size()); + for (Map.Entry expected : expectedQueryParams.entrySet()) { + assertTrue(listContainsPair(queryParams, expected.getKey(), expected.getValue())); + } + + List actualEnv = + queryParams.stream() + .filter( + p -> "environment".equals(p.getName()) || "environment[]".equals(p.getName())) + .map(Pair::getValue) + // if your Pair values might be percent-encoded, decode them + .map(v -> URLDecoder.decode(v, StandardCharsets.UTF_8)) + .collect(Collectors.toList()); + + assertEquals(ENVIRONMENT, actualEnv); + + return mockFileToResponse( + 200, invocation, "mocks/events/search/get_event_search_200.json", EventSearch.class); }); - EventSearch response = api.searchEvents(new FingerprintApi.SearchEventsOptionalParams() + EventSearch response = + api.searchEvents( + new FingerprintApi.SearchEventsOptionalParams() .setLimit(LIMIT) .setPaginationKey(PAGINATION_KEY) .setVisitorId(MOCK_VISITOR_ID) - .setBot(BOT).setIpAddress(IP_ADDRESS) - .setLinkedId(LINKED_ID).setStart(START) - .setEnd(END).setReverse(REVERSE) + .setBot(BOT) + .setIpAddress(IP_ADDRESS) + .setAsn(ASN) + .setLinkedId(LINKED_ID) + .setUrl(URL) + .setBundleId(BUNDLE_ID) + .setPackageName(PACKAGE_NAME) + .setOrigin(ORIGIN) + .setStart(START) + .setEnd(END) + .setReverse(REVERSE) .setSuspect(SUSPECT) + .setVpn(VPN) + .setVirtualMachine(VIRTUAL_MACHINE) + .setTampering(TAMPERING) .setAntiDetectBrowser(ANTI_DETECT_BROWSER) - .setClonedApp(CLONED_APP) - .setFactoryReset(FACTORY_RESET) - .setFrida(FRIDA) - .setJailbroken(JAILBROKEN) - .setMinSuspectScore(MIN_SUSPECT_SCORE) + .setIncognito(INCOGNITO) .setPrivacySettings(PRIVACY_SETTINGS) + .setJailbroken(JAILBROKEN) + .setFrida(FRIDA) + .setFactoryReset(FACTORY_RESET) + .setClonedApp(CLONED_APP) + .setEmulator(EMULATOR) .setRootApps(ROOT_APPS) - .setTampering(TAMPERING) - .setVirtualMachine(VIRTUAL_MACHINE) - .setVpn(VPN) .setVpnConfidence(VPN_CONFIDENCE) - .setEmulator(EMULATOR) - .setIncognito(INCOGNITO) - // .setIpBlocklist(IP_BLOCKLIST) - // .setDatacenter(DATACENTER) + .setMinSuspectScore(MIN_SUSPECT_SCORE) .setDeveloperTools(DEVELOPER_TOOLS) .setLocationSpoofing(LOCATION_SPOOFING) .setMitmAttack(MITM_ATTACK) @@ -503,48 +573,102 @@ public void searchEventsMaximumParamsTest() throws ApiException { .setSdkPlatform(SDK_PLATFORM) .setEnvironment(ENVIRONMENT) .setProximityId(PROXIMITY_ID) - .setAsn(ASN) - // .setProximityPrecisionRadius(PROXIMITY_PRECISION_RADIUS) - ); - List events = response.getEvents(); - assertEquals(events.size(), 1); - } - - @Test - public void searchEvents400ErrorTest() throws ApiException, JsonProcessingException { - int LIMIT = 1; - addMock("searchEvents", null, invocation -> { - List queryParams = invocation.getArgument(3); - assertEquals(1, queryParams.size()); - - return mockFileToResponse(400, invocation, "mocks/errors/400_ip_address_invalid.json"); + .setTotalHits(TOTAL_HITS) + .setTorNode(TOR_NODE)); + List events = response.getEvents(); + assertEquals(events.size(), 1); + } + + @Test + public void searchEvents400ErrorTest() throws ApiException, JsonProcessingException { + addMock( + "searchEvents", + null, + invocation -> { + List queryParams = invocation.getArgument(3); + assertEquals(1, queryParams.size()); + assertEquals(FingerprintApi.INTEGRATION_INFO, queryParams.get(0).getValue()); + + return mockFileToResponse( + 400, invocation, "mocks/errors/400_ip_address_invalid.json", ErrorResponse.class); }); - ApiException exception = assertThrows(ApiException.class, - () -> api.searchEvents(null)); - - assertEquals(400, exception.getCode()); - ErrorResponse response = MAPPER.readValue(exception.getResponseBody(), ErrorResponse.class); - assertEquals(ErrorCode.REQUEST_CANNOT_BE_PARSED, response.getError().getCode()); - assertEquals("invalid ip address", response.getError().getMessage()); - } + ApiException exception = assertThrows(ApiException.class, () -> api.searchEvents(null)); + + assertEquals(400, exception.getCode()); + ErrorResponse response = MAPPER.readValue(exception.getResponseBody(), ErrorResponse.class); + assertEquals(ErrorCode.REQUEST_CANNOT_BE_PARSED, response.getError().getCode()); + assertEquals("invalid ip address", response.getError().getMessage()); + } + + @Test + public void searchEvents403ErrorTest() throws ApiException, JsonProcessingException { + addMock( + "searchEvents", + null, + invocation -> { + List queryParams = invocation.getArgument(3); + assertEquals(1, queryParams.size()); + assertEquals(FingerprintApi.INTEGRATION_INFO, queryParams.get(0).getValue()); + + return mockFileToResponse( + 403, invocation, "mocks/errors/403_feature_not_enabled.json", ErrorResponse.class); + }); - @Test - public void searchEvents403ErrorTest() throws ApiException, JsonProcessingException { - int LIMIT = 1; - addMock("searchEvents", null, invocation -> { - List queryParams = invocation.getArgument(3); - assertEquals(1, queryParams.size()); + ApiException exception = + assertThrows( + ApiException.class, + () -> api.searchEvents(new FingerprintApi.SearchEventsOptionalParams())); + + assertEquals(403, exception.getCode()); + ErrorResponse response = MAPPER.readValue(exception.getResponseBody(), ErrorResponse.class); + assertEquals(ErrorCode.FEATURE_NOT_ENABLED, response.getError().getCode()); + assertEquals("feature not enabled", response.getError().getMessage()); + } + + @Test + public void getEventEvaluateRulesetTest() throws ApiException { + addMock( + "getEvent", + MOCK_REQUEST_ID, + invocation -> { + return mockFileToResponse( + 200, invocation, "mocks/events/get_event_ruleset_200.json", Event.class); + }); - return mockFileToResponse(403, invocation, "mocks/errors/403_feature_not_enabled.json"); + Event response = api.getEvent(MOCK_REQUEST_ID); + assertNotNull(response); + assertNotNull(response.getRuleAction()); + assertInstanceOf(EventRuleActionBlock.class, response.getRuleAction()); + + EventRuleActionBlock ruleAction = (EventRuleActionBlock) response.getRuleAction(); + assertEquals(RuleActionType.BLOCK, ruleAction.getType()); + assertEquals(403, ruleAction.getStatusCode()); + assertEquals("{\"title\":\"Forbidden\"}", ruleAction.getBody()); + assertEquals("rs_b1k1blhqpOX3kU", ruleAction.getRulesetId()); + assertEquals("r_uE0af8497PFAOD", ruleAction.getRuleId()); + assertEquals("bot in [\"bad\"] || incognito", ruleAction.getRuleExpression()); + assertNotNull(ruleAction.getHeaders()); + assertEquals(1, ruleAction.getHeaders().size()); + assertEquals("Content-Type", ruleAction.getHeaders().get(0).getName()); + assertEquals("application/json", ruleAction.getHeaders().get(0).getValue()); + } + + @Test + public void getEventRulesetNotFoundErrorTest() throws ApiException, JsonProcessingException { + addMock( + "getEvent", + MOCK_REQUEST_ID, + invocation -> { + return mockFileToResponse( + 400, invocation, "mocks/errors/400_ruleset_not_found.json", ErrorResponse.class); }); - ApiException exception = assertThrows(ApiException.class, - () -> api.searchEvents(null)); + ApiException exception = assertThrows(ApiException.class, () -> api.getEvent(MOCK_REQUEST_ID)); - assertEquals(403, exception.getCode()); - ErrorResponse response = MAPPER.readValue(exception.getResponseBody(), ErrorResponse.class); - assertEquals(ErrorCode.FEATURE_NOT_ENABLED, response.getError().getCode()); - assertEquals("feature not enabled", response.getError().getMessage()); - } + assertEquals(400, exception.getCode()); + ErrorResponse response = MAPPER.readValue(exception.getResponseBody(), ErrorResponse.class); + assertEquals(ErrorCode.RULESET_NOT_FOUND, response.getError().getCode()); + assertEquals("ruleset not found", response.getError().getMessage()); + } } diff --git a/sdk/src/test/resources/mocks/errors/400_ruleset_not_found.json b/sdk/src/test/resources/mocks/errors/400_ruleset_not_found.json new file mode 100644 index 00000000..1e4ac5dd --- /dev/null +++ b/sdk/src/test/resources/mocks/errors/400_ruleset_not_found.json @@ -0,0 +1,6 @@ +{ + "error": { + "code": "ruleset_not_found", + "message": "ruleset not found" + } +} diff --git a/sdk/src/test/resources/mocks/events/get_event_ruleset_200.json b/sdk/src/test/resources/mocks/events/get_event_ruleset_200.json new file mode 100644 index 00000000..b02bfb2d --- /dev/null +++ b/sdk/src/test/resources/mocks/events/get_event_ruleset_200.json @@ -0,0 +1,296 @@ +{ + "linked_id": "somelinkedId", + "tags": {}, + "timestamp": 1708102555327, + "event_id": "1708102555327.NLOjmg", + "url": "https://www.example.com/login?hope{this{works[!", + "ip_address": "61.127.217.15", + "user_agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) ....", + "client_referrer": "https://example.com/blog/my-article", + "browser_details": { + "browser_name": "Chrome", + "browser_major_version": "74", + "browser_full_version": "74.0.3729", + "os": "Windows", + "os_version": "7", + "device": "Other" + }, + "identification": { + "visitor_id": "Ibk1527CUFmcnjLwIs4A9", + "confidence": { + "score": 0.97, + "version": "1.1" + }, + "visitor_found": false, + "first_seen_at": 1708102555327, + "last_seen_at": 1708102555327 + }, + "supplementary_id_high_recall": { + "visitor_id": "3HNey93AkBW6CRbxV6xP", + "visitor_found": true, + "confidence": { + "score": 0.97, + "version": "1.1" + }, + "first_seen_at": 1708102555327, + "last_seen_at": 1708102555327 + }, + "proximity": { + "id": "w1aTfd4MCvl", + "precision_radius": 10, + "confidence": 0.95 + }, + "bot": "not_detected", + "root_apps": false, + "emulator": false, + "ip_info": { + "v4": { + "address": "94.142.239.124", + "geolocation": { + "accuracy_radius": 20, + "latitude": 50.05, + "longitude": 14.4, + "postal_code": "150 00", + "timezone": "Europe/Prague", + "city_name": "Prague", + "country_code": "CZ", + "country_name": "Czechia", + "continent_code": "EU", + "continent_name": "Europe", + "subdivisions": [ + { + "iso_code": "10", + "name": "Hlavni mesto Praha" + } + ] + }, + "asn": "7922", + "asn_name": "COMCAST-7922", + "asn_network": "73.136.0.0/13", + "asn_type": "isp", + "datacenter_result": true, + "datacenter_name": "DediPath" + }, + "v6": { + "address": "2001:db8:3333:4444:5555:6666:7777:8888", + "geolocation": { + "accuracy_radius": 5, + "latitude": 49.982, + "longitude": 36.2566, + "postal_code": "10112", + "timezone": "Europe/Berlin", + "city_name": "Berlin", + "country_code": "DE", + "country_name": "Germany", + "continent_code": "EU", + "continent_name": "Europe", + "subdivisions": [ + { + "iso_code": "BE", + "name": "Land Berlin" + } + ] + }, + "asn": "6805", + "asn_name": "Telefonica Germany", + "asn_network": "2a02:3100::/24", + "asn_type": "isp", + "datacenter_result": false, + "datacenter_name": "" + } + }, + "ip_blocklist": { + "email_spam": false, + "attack_source": false, + "tor_node": false + }, + "proxy": true, + "proxy_confidence": "low", + "proxy_details": { + "proxy_type": "residential", + "last_seen_at": 1708102555327, + "provider": "Massive" + }, + "vpn": false, + "vpn_confidence": "high", + "vpn_origin_timezone": "Europe/Berlin", + "vpn_origin_country": "unknown", + "vpn_methods": { + "timezone_mismatch": false, + "public_vpn": false, + "auxiliary_mobile": false, + "os_mismatch": false, + "relay": false + }, + "incognito": false, + "tampering": false, + "tampering_details": { + "anomaly_score": 0.1955, + "anti_detect_browser": false + }, + "cloned_app": false, + "factory_reset_timestamp": 0, + "jailbroken": false, + "frida": false, + "privacy_settings": false, + "virtual_machine": false, + "location_spoofing": false, + "velocity": { + "distinct_ip": { + "5_minutes": 1, + "1_hour": 1, + "24_hours": 1 + }, + "distinct_country": { + "5_minutes": 1, + "1_hour": 2, + "24_hours": 2 + }, + "events": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "ip_events": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "distinct_ip_by_linked_id": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + }, + "distinct_visitor_id_by_linked_id": { + "5_minutes": 1, + "1_hour": 5, + "24_hours": 5 + } + }, + "developer_tools": false, + "mitm_attack": false, + "sdk": { + "platform": "js", + "version": "3.11.10", + "integrations": [ + { + "name": "fingerprint-pro-react", + "version": "3.11.10", + "subintegration": { + "name": "preact", + "version": "10.21.0" + } + } + ] + }, + "replayed": false, + "high_activity_device": false, + "raw_device_attributes": { + "math": "5f030fa7d2e5f9f757bfaf81642eb1a6", + "vendor": "Google Inc.", + "plugins": [ + { + "description": "Portable Document Format", + "mimeTypes": [ + { + "suffixes": "pdf", + "type": "application/pdf" + }, + { + "suffixes": "pdf", + "type": "text/pdf" + } + ], + "name": "PDF Viewer" + } + ], + "webgl_extensions": { + "context_attributes": "6b1ed336830d2bc96442a9d76373252a", + "extension_parameters": "86a8abb36f0cb30b5946dec0c761d042", + "extensions": "57233d7b10f89fcd1ff95e3837ccd72d", + "parameters": "ea118c48e308bc4b0677118bbb3019ec", + "shader_precisions": "f223dfbcd580cf142da156d93790eb83", + "unsupported_extensions": [] + }, + "cookies_enabled": true, + "webgl_basics": { + "renderer": "WebKit WebGL", + "renderer_unmasked": "ANGLE (Apple, ANGLE Metal Renderer: Apple M4, Unspecified Version)", + "shading_language_version": "WebGL GLSL ES 1.0 (OpenGL ES GLSL ES 1.0 Chromium)", + "vendor": "WebKit", + "vendor_unmasked": "Google Inc. (Apple)", + "version": "WebGL 1.0 (OpenGL ES 2.0 Chromium)" + }, + "canvas": { + "geometry": "db3c1462576a399a03ae93d0ab9eb5c4", + "text": "70c3d3f7eb4408dc37a6bf8af1c51029", + "winding": true + }, + "hardware_concurrency": 10, + "languages": [ + [ + "en-US" + ] + ], + "color_depth": 24, + "fonts": [ + "Arial Unicode MS", + "Gill Sans", + "Helvetica Neue", + "Menlo" + ], + "indexed_db": true, + "touch_support": { + "max_touch_points": 0, + "touch_event": false, + "touch_start": false + }, + "device_memory": 8, + "oscpu": "Windows NT 6.1; Win64; x64", + "architecture": 127, + "screen_resolution": [ + 1920, + 1080 + ], + "timezone": "America/Sao_Paulo", + "emoji": { + "bottom": 32, + "font": "Times", + "height": 18, + "left": 8, + "right": 1608, + "top": 14, + "width": 1600, + "x": 8, + "y": 14 + }, + "font_preferences": { + "apple": 147.5625, + "default": 147.5625, + "min": 9.234375, + "mono": 133.0625, + "sans": 144.015625, + "serif": 147.5625, + "system": 146.09375 + }, + "platform": "MacIntel", + "local_storage": true, + "session_storage": true, + "date_time_locale": "en-US", + "audio": 124.04347745512496 + }, + "rule_action": { + "type": "block", + "status_code": 403, + "headers": [ + { + "name": "Content-Type", + "value": "application/json" + } + ], + "body": "{\"title\":\"Forbidden\"}", + "ruleset_id": "rs_b1k1blhqpOX3kU", + "rule_id": "r_uE0af8497PFAOD", + "rule_expression": "bot in [\"bad\"] || incognito" + } +} \ No newline at end of file diff --git a/template/README.mustache b/template/README.mustache index e74804a8..c3c20368 100644 --- a/template/README.mustache +++ b/template/README.mustache @@ -134,12 +134,12 @@ defaultClient.setClientConfig(clientConfig); Please follow the [installation](#installation) instruction and execute the following Java code: ```java -package main; +package com.fingerprint.example; import com.fingerprint.v4.api.FingerprintApi; -import com.fingerprint.v4.model.Events; -import com.fingerprint.v4.model.UpdateEvents; -import com.fingerprint.v4.model.VisitorsGetResponse; +import com.fingerprint.v4.model.Event; +import com.fingerprint.v4.model.EventSearch; +import com.fingerprint.v4.model.EventUpdate; import com.fingerprint.v4.sdk.ApiClient; import com.fingerprint.v4.sdk.ApiException; import com.fingerprint.v4.sdk.Configuration; @@ -173,9 +173,9 @@ public class FingerprintApiExample { FingerprintApi api = new FingerprintApi(client); // Get an event with a given requestId try { - // Fetch the event with a given requestId - Event response = api.getEvent(FPJS_EVENT_ID); - System.out.println(response.getProducts().toString()); + // Fetch the event with a given eventId + Event event = api.getEvent(FPJS_EVENT_ID); + System.out.println(event.getIdentification().getVisitorId()); } catch (ApiException e) { System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage()); } @@ -183,14 +183,14 @@ public class FingerprintApiExample { // Search events with custom filters try { // By visitorId - SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setVisitorId(FPJS_VISITOR_ID)); + EventSearch response = api.searchEvents(new FingerprintApi.SearchEventsOptionalParams().setLimit(LIMIT).setVisitorId(FPJS_VISITOR_ID)); // Next page - // SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setPaginationKey(response.getPaginationKey()).setVisitorId(FPJS_VISITOR_ID)); + // EventSearch response = api.searchEvents(new FingerprintApi.SearchEventsOptionalParams().setLimit(LIMIT).setPaginationKey(PAGINATION_KEY).setVisitorId(FPJS_VISITOR_ID)); // Bad bot - // SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setBot("bad")); + // EventSearch response = api.searchEvents(new FingerprintApi.SearchEventsOptionalParams().setLimit(LIMIT).setBot(SearchEventsBot.BAD)); // Filtered by IP - // SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setIpAddress("192.168.0.1/32")); - System.out.println(response.getEvents().toString()); + // EventSearch response = api.searchEvents(new FingerprintApi.SearchEventsOptionalParams().setLimit(LIMIT).setIpAddress("192.168.0.1/32")); + System.out.println(response.getEvents()); } catch (ApiException e) { System.err.println("Exception when calling FingerprintApi.searchEvents:" + e.getMessage()); } @@ -198,7 +198,7 @@ public class FingerprintApiExample { // Update an event with a given requestId try { EventUpdate request = new EventUpdate(); - request.setLinkedId("myNewLinkedId"); + request.setLinkedId(FPJS_LINKED_ID); api.updateEvent(FPJS_EVENT_ID, request); } catch (ApiException e) { System.err.println("Exception when calling FingerprintApi.updateEvent:" + e.getMessage()); @@ -218,10 +218,10 @@ public class FingerprintApiExample { This SDK provides utility methods for decoding [sealed results](https://dev.fingerprint.com/docs/sealed-client-results). ```java -package com.fingerprint.v4.example; +package com.fingerprint.example; import com.fingerprint.v4.Sealed; -import com.fingerprint.v4.model.EventsGetResponse; +import com.fingerprint.v4.model.Event; import java.util.Base64; @@ -233,7 +233,7 @@ public class SealedResults { // Base64 encoded key generated in the dashboard. String SEALED_KEY = System.getenv("BASE64_KEY"); - final EventsGetResponse event = Sealed.unsealEventResponse( + final Event event = Sealed.unsealEventResponse( Base64.getDecoder().decode(SEALED_RESULT), // You can provide more than one key to support key rotation. The SDK will try to decrypt the result with each key. new Sealed.DecryptionKey[]{ @@ -247,7 +247,6 @@ public class SealedResults { // Do something with unsealed response, e.g: send it back to the frontend. } } - ``` To learn more, see the [Sealed results example](/examples/src/main/java/com/fingerprint/example/SealedResults.java). @@ -256,6 +255,8 @@ This SDK provides utility method for verifying the HMAC signature of the incomin Here is an example implementation using Spring Boot: ```java +package com.fingerprint.example; + import com.fingerprint.v4.sdk.WebhookValidation; @RestController @@ -297,34 +298,6 @@ Class | Method | HTTP request | Description {{#models}}{{#model}} - [{{classname}}]({{modelDocPath}}{{classname}}.md) {{/model}}{{/models}} -## Documentation for Authorization - -{{^authMethods}}All endpoints do not require authorization. -{{/authMethods}}Authentication schemes defined for the API: -{{#authMethods}}### {{name}} - -{{#isApiKey}} - -- **Type**: API key -- **API key parameter name**: {{keyParamName}} -- **Location**: {{#isKeyInQuery}}URL query string{{/isKeyInQuery}}{{#isKeyInHeader}}HTTP header{{/isKeyInHeader}} -{{/isApiKey}} -{{#isBasic}} - -- **Type**: HTTP basic authentication -{{/isBasic}} -{{#isOAuth}} - -- **Type**: OAuth -- **Flow**: {{flow}} -- **Authorization URL**: {{authorizationUrl}} -- **Scopes**: {{^scopes}}N/A{{/scopes}} -{{#scopes}} - {{scope}}: {{description}} -{{/scopes}} -{{/isOAuth}} - -{{/authMethods}} - ## Documentation for sealed results - [Sealed](docs/Sealed.md) diff --git a/template/RFC3339JavaTimeModule.mustache b/template/RFC3339JavaTimeModule.mustache new file mode 100644 index 00000000..7371a24d --- /dev/null +++ b/template/RFC3339JavaTimeModule.mustache @@ -0,0 +1,29 @@ +{{>licenseInfo}} +package {{invokerPackage}}; + +import java.time.Instant; +import java.time.OffsetDateTime; +import java.time.ZonedDateTime; + +import com.fasterxml.jackson.databind.module.SimpleModule; +{{! SimpleContext import is not needed}} + +{{>generatedAnnotation}} + +public class RFC3339JavaTimeModule extends SimpleModule { + private static final long serialVersionUID = 1L; + + public RFC3339JavaTimeModule() { + super("RFC3339JavaTimeModule"); + } + + @Override + public void setupModule(SetupContext context) { + super.setupModule(context); + + addDeserializer(Instant.class, RFC3339InstantDeserializer.INSTANT); + addDeserializer(OffsetDateTime.class, RFC3339InstantDeserializer.OFFSET_DATE_TIME); + addDeserializer(ZonedDateTime.class, RFC3339InstantDeserializer.ZONED_DATE_TIME); + } + +} diff --git a/template/enum_outer_doc.mustache b/template/enum_outer_doc.mustache index 11dbee32..46fdca76 100644 --- a/template/enum_outer_doc.mustache +++ b/template/enum_outer_doc.mustache @@ -6,5 +6,5 @@ ## Enum {{#allowableValues}}{{#enumVars}} -* `{{name}}` (value: `{{{value}}}`) +{{^-last}}* `{{name}}` (value: `{{{value}}}`){{/-last}}{{#-last}}* `UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED` (value: `{{#isString}}"unsupported_value_sdk_upgrade_required"{{/isString}}{{#isInteger}}Integer.MAX_VALUE{{/isInteger}}`){{/-last}} {{/enumVars}}{{/allowableValues}} diff --git a/template/libraries/jersey3/ApiClient.mustache b/template/libraries/jersey3/ApiClient.mustache new file mode 100644 index 00000000..acece80f --- /dev/null +++ b/template/libraries/jersey3/ApiClient.mustache @@ -0,0 +1,1521 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import {{javaxPackage}}.ws.rs.client.Client; +import {{javaxPackage}}.ws.rs.client.ClientBuilder; +import {{javaxPackage}}.ws.rs.client.Entity; +import {{javaxPackage}}.ws.rs.client.Invocation; +import {{javaxPackage}}.ws.rs.client.WebTarget; +import {{javaxPackage}}.ws.rs.core.Form; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.core.MediaType; +import {{javaxPackage}}.ws.rs.core.Response; +import {{javaxPackage}}.ws.rs.core.Response.Status; + +{{#hasOAuthMethods}} +import com.github.scribejava.core.model.OAuth2AccessToken; +{{/hasOAuthMethods}} +import org.glassfish.jersey.client.ClientConfig; +import org.glassfish.jersey.client.ClientProperties; +import org.glassfish.jersey.client.HttpUrlConnectorProvider; +import org.glassfish.jersey.jackson.JacksonFeature; +import org.glassfish.jersey.media.multipart.FormDataBodyPart; +import org.glassfish.jersey.media.multipart.FormDataContentDisposition; +import org.glassfish.jersey.media.multipart.MultiPart; +import org.glassfish.jersey.media.multipart.MultiPartFeature; + +import java.io.IOException; +import java.io.InputStream; + +import java.net.URI; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManager; +import javax.net.ssl.X509TrustManager; +import java.security.cert.X509Certificate; +import java.security.KeyManagementException; +import java.security.NoSuchAlgorithmException; +import java.security.SecureRandom; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.nio.file.StandardCopyOption; +import org.glassfish.jersey.logging.LoggingFeature; +import java.util.AbstractMap.SimpleEntry; +import java.util.logging.Level; +import java.util.logging.Logger; +import java.util.Collection; +import java.util.Collections; +import java.util.Map; +import java.util.Map.Entry; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Arrays; +import java.util.ArrayList; +import java.util.Date; +import java.util.Locale; +import java.util.stream.Collectors; +import java.util.stream.Stream; +{{#jsr310}} +import java.time.OffsetDateTime; +{{/jsr310}} + +import java.net.URLEncoder; + +import java.io.File; +import java.io.UnsupportedEncodingException; + +import java.text.DateFormat; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +import {{invokerPackage}}.auth.Authentication; +import {{invokerPackage}}.auth.HttpBasicAuth; +import {{invokerPackage}}.auth.HttpBearerAuth; +{{#hasHttpSignatureMethods}} +import {{invokerPackage}}.auth.HttpSignatureAuth; +{{/hasHttpSignatureMethods}} +import {{invokerPackage}}.auth.ApiKeyAuth; +{{#hasOAuthMethods}} +import {{invokerPackage}}.auth.OAuth; +{{/hasOAuthMethods}} + +/** + *

ApiClient class.

+ */ +{{>generatedAnnotation}} + +public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} { + protected static final Pattern JSON_MIME_PATTERN = Pattern.compile("(?i)^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$"); + + protected Map defaultHeaderMap = new HashMap<>(); + protected Map defaultCookieMap = new HashMap<>(); + protected String basePath = "{{{basePath}}}"; + protected String userAgent; + protected static final Logger log = Logger.getLogger(ApiClient.class.getName()); + + protected List servers = new ArrayList<>({{#servers}}{{#-first}}Arrays.asList( +{{/-first}} new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + {{^variables}} + new LinkedHashMap<>() + {{/variables}} + {{#variables}} + {{#-first}} + Stream.>of( + {{/-first}} + new SimpleEntry<>("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new LinkedHashSet<>({{#enumValues}}{{#-first}}Arrays.asList({{/-first}} + "{{{.}}}"{{^-last}},{{/-last}}{{#-last}} + ){{/-last}}{{/enumValues}}) + )){{^-last}},{{/-last}} + {{#-last}} + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + {{/-last}} + {{/variables}} + ){{^-last}},{{/-last}} + {{#-last}} + ){{/-last}}{{/servers}}); + protected Integer serverIndex = 0; + protected Map serverVariables = null; + {{^hasOperationServers}} + protected Map> operationServers = new HashMap<>(); + {{/hasOperationServers}} + {{#hasOperationServers}} + protected Map> operationServers; + + { + Map> operationServers = new HashMap<>(); + {{#apiInfo}} + {{#apis}} + {{#operations}} + {{#operation}} + {{#servers}} + {{#-first}} + operationServers.put("{{{classname}}}.{{{operationId}}}", new ArrayList<>(Arrays.asList( + {{/-first}} + new ServerConfiguration( + "{{{url}}}", + "{{{description}}}{{^description}}No description provided{{/description}}", + {{^variables}} + new LinkedHashMap<>() + {{/variables}} + {{#variables}} + {{#-first}} + Stream.>of( + {{/-first}} + new SimpleEntry<>("{{{name}}}", new ServerVariable( + "{{{description}}}{{^description}}No description provided{{/description}}", + "{{{defaultValue}}}", + new LinkedHashSet<>({{#enumValues}}{{#-first}}Arrays.asList({{/-first}} + "{{{.}}}"{{^-last}},{{/-last}}{{#-last}} + ){{/-last}}{{/enumValues}}) + )){{^-last}},{{/-last}} + {{#-last}} + ).collect(Collectors.toMap(Entry::getKey, Entry::getValue, (a, b) -> a, LinkedHashMap::new)) + {{/-last}} + {{/variables}} + ){{^-last}},{{/-last}} + {{#-last}} + ))); + {{/-last}} + {{/servers}} + {{/operation}} + {{/operations}} + {{/apis}} + {{/apiInfo}} + this.operationServers = operationServers; + } + + {{/hasOperationServers}} + protected Map operationServerIndex = new HashMap<>(); + protected Map> operationServerVariables = new HashMap<>(); + protected boolean debugging = false; + protected ClientConfig clientConfig; + protected int connectionTimeout = 0; + protected int readTimeout = 0; + + protected Client httpClient; + protected JSON json; + protected String tempFolderPath = null; + + protected Map authentications; + protected Map authenticationLookup; + + protected DateFormat dateFormat; + + /** + * Constructs a new ApiClient with default parameters. + */ + public ApiClient() { + this(null); + } + + /** + * Constructs a new ApiClient with the specified authentication parameters. + * + * @param authMap A hash map containing authentication parameters. + */ + // Suppress a known issue warning with the HTTP client extension mechanism + @SuppressWarnings("this-escape") + public ApiClient(Map authMap) { + json = new JSON(); + httpClient = buildHttpClient(); + + this.dateFormat = new RFC3339DateFormat(); + + // Set default User-Agent. + setUserAgent("{{{httpUserAgent}}}{{^httpUserAgent}}OpenAPI-Generator/{{{artifactVersion}}}/java{{/httpUserAgent}}"); + + // Setup authentications (key: authentication name, value: authentication). + authentications = new HashMap<>(); + Authentication auth = null; + {{#authMethods}} + if (authMap != null) { + auth = authMap.get("{{name}}"); + } + {{#isBasic}} + {{#isBasicBasic}} + if (auth instanceof HttpBasicAuth) { + authentications.put("{{name}}", auth); + } else { + authentications.put("{{name}}", new HttpBasicAuth()); + } + {{/isBasicBasic}} + {{#isBasicBearer}} + if (auth instanceof HttpBearerAuth) { + authentications.put("{{name}}", auth); + } else { + authentications.put("{{name}}", new HttpBearerAuth("{{scheme}}")); + } + {{/isBasicBearer}} + {{#isHttpSignature}} + if (auth instanceof HttpSignatureAuth) { + authentications.put("{{name}}", auth); + } + {{/isHttpSignature}} + {{/isBasic}} + {{#isApiKey}} + if (auth instanceof ApiKeyAuth) { + authentications.put("{{name}}", auth); + } else { + authentications.put("{{name}}", new ApiKeyAuth({{#isKeyInHeader}}"header"{{/isKeyInHeader}}{{^isKeyInHeader}}"query"{{/isKeyInHeader}}, "{{keyParamName}}")); + } + {{/isApiKey}} + {{#isOAuth}} + if (auth instanceof OAuth) { + authentications.put("{{name}}", auth); + } else { + authentications.put("{{name}}", new OAuth(basePath, "{{{tokenUrl}}}")); + } + {{/isOAuth}} + {{/authMethods}} + // Prevent the authentications from being modified. + authentications = Collections.unmodifiableMap(authentications); + + // Setup authentication lookup (key: authentication alias, value: authentication name) + authenticationLookup = new HashMap<>();{{#authMethods}}{{#vendorExtensions.x-auth-id-alias}} + authenticationLookup.put("{{name}}", "{{.}}");{{/vendorExtensions.x-auth-id-alias}}{{/authMethods}} + } + + /** + * Gets the JSON instance to do JSON serialization and deserialization. + * + * @return JSON + */ + public JSON getJSON() { + return json; + } + + /** + *

Getter for the field httpClient.

+ * + * @return a {@link {{javaxPackage}}.ws.rs.client.Client} object. + */ + public Client getHttpClient() { + return httpClient; + } + + /** + *

Setter for the field httpClient.

+ * + * @param httpClient a {@link {{javaxPackage}}.ws.rs.client.Client} object. + * @return a {@link ApiClient} object. + */ + public ApiClient setHttpClient(Client httpClient) { + this.httpClient = httpClient; + return this; + } + + /** + * Returns the base URL to the location where the OpenAPI document is being served. + * + * @return The base URL to the target host. + */ + public String getBasePath() { + return basePath; + } + + /** + * Sets the base URL to the location where the OpenAPI document is being served. + * + * @param basePath The base URL to the target host. + * @return a {@link ApiClient} object. + */ + public ApiClient setBasePath(String basePath) { + this.basePath = basePath; + {{#hasOAuthMethods}} + setOauthBasePath(basePath); + {{/hasOAuthMethods}} + return this; + } + + /** + *

Getter for the field servers.

+ * + * @return a {@link java.util.List} of servers. + */ + public List getServers() { + return servers; + } + + /** + *

Setter for the field servers.

+ * + * @param servers a {@link java.util.List} of servers. + * @return a {@link ApiClient} object. + */ + public ApiClient setServers(List servers) { + this.servers = servers; + updateBasePath(); + return this; + } + + /** + *

Getter for the field serverIndex.

+ * + * @return a {@link java.lang.Integer} object. + */ + public Integer getServerIndex() { + return serverIndex; + } + + /** + *

Setter for the field serverIndex.

+ * + * @param serverIndex the server index + * @return a {@link ApiClient} object. + */ + public ApiClient setServerIndex(Integer serverIndex) { + this.serverIndex = serverIndex; + updateBasePath(); + return this; + } + + /** + *

Getter for the field serverVariables.

+ * + * @return a {@link java.util.Map} of server variables. + */ + public Map getServerVariables() { + return serverVariables; + } + + /** + *

Setter for the field serverVariables.

+ * + * @param serverVariables a {@link java.util.Map} of server variables. + * @return a {@link ApiClient} object. + */ + public ApiClient setServerVariables(Map serverVariables) { + this.serverVariables = serverVariables; + updateBasePath(); + return this; + } + + protected void updateBasePath() { + if (serverIndex != null) { + setBasePath(servers.get(serverIndex).URL(serverVariables)); + } + } + + {{#hasOAuthMethods}} + protected void setOauthBasePath(String basePath) { + for(Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setBasePath(basePath); + } + } + } + + {{/hasOAuthMethods}} + /** + * Get authentications (key: authentication name, value: authentication). + * + * @return Map of authentication object + */ + public Map getAuthentications() { + return authentications; + } + + /** + * Get authentication for the given name. + * + * @param authName The authentication name + * @return The authentication, null if not found + */ + public Authentication getAuthentication(String authName) { + return authentications.get(authName); + } + + /** + * Helper method to set username for the first HTTP basic authentication. + * + * @param username Username + * @return a {@link ApiClient} object. + */ + public ApiClient setUsername(String username) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setUsername(username); + return this; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set password for the first HTTP basic authentication. + * + * @param password Password + * @return a {@link ApiClient} object. + */ + public ApiClient setPassword(String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBasicAuth) { + ((HttpBasicAuth) auth).setPassword(password); + return this; + } + } + throw new RuntimeException("No HTTP basic authentication configured!"); + } + + /** + * Helper method to set API key value for the first API key authentication. + * + * @param apiKey API key + * @return a {@link ApiClient} object. + */ + public ApiClient setApiKey(String apiKey) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKey(apiKey); + return this; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to configure authentications which respects aliases of API keys. + * + * @param secrets Hash map from authentication name to its secret. + * @return a {@link ApiClient} object. + */ + public ApiClient configureApiKeys(Map secrets) { + for (Map.Entry authEntry : authentications.entrySet()) { + Authentication auth = authEntry.getValue(); + if (auth instanceof ApiKeyAuth) { + String name = authEntry.getKey(); + // respect x-auth-id-alias property + name = authenticationLookup.getOrDefault(name, name); + String secret = secrets.get(name); + if (secret != null) { + ((ApiKeyAuth) auth).setApiKey(secret); + } + } + } + return this; + } + + /** + * Helper method to set API key prefix for the first API key authentication. + * + * @param apiKeyPrefix API key prefix + * @return a {@link ApiClient} object. + */ + public ApiClient setApiKeyPrefix(String apiKeyPrefix) { + for (Authentication auth : authentications.values()) { + if (auth instanceof ApiKeyAuth) { + ((ApiKeyAuth) auth).setApiKeyPrefix(apiKeyPrefix); + return this; + } + } + throw new RuntimeException("No API key authentication configured!"); + } + + /** + * Helper method to set bearer token for the first Bearer authentication. + * + * @param bearerToken Bearer token + * @return a {@link ApiClient} object. + */ + public ApiClient setBearerToken(String bearerToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof HttpBearerAuth) { + ((HttpBearerAuth) auth).setBearerToken(bearerToken); + return this; + } + } + throw new RuntimeException("No Bearer authentication configured!"); + } + + {{#hasOAuthMethods}} + /** + * Helper method to set access token for the first OAuth2 authentication. + * + * @param accessToken Access token + * @return a {@link ApiClient} object. + */ + public ApiClient setAccessToken(String accessToken) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setAccessToken(accessToken); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set the credentials for the first OAuth2 authentication. + * + * @param clientId the client ID + * @param clientSecret the client secret + * @return a {@link ApiClient} object. + */ + public ApiClient setOauthCredentials(String clientId, String clientSecret) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setCredentials(clientId, clientSecret, isDebugging()); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set the credentials of a public client for the first OAuth2 authentication. + * + * @param clientId the client ID + * @return a {@link ApiClient} object. + */ + public ApiClient setOauthCredentialsForPublicClient(String clientId) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setCredentialsForPublicClient(clientId, isDebugging()); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set the password flow for the first OAuth2 authentication. + * + * @param username the user name + * @param password the user password + * @return a {@link ApiClient} object. + */ + public ApiClient setOauthPasswordFlow(String username, String password) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).usePasswordFlow(username, password); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set the authorization code flow for the first OAuth2 authentication. + * + * @param code the authorization code + * @return a {@link ApiClient} object. + */ + public ApiClient setOauthAuthorizationCodeFlow(String code) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).useAuthorizationCodeFlow(code); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + /** + * Helper method to set the scopes for the first OAuth2 authentication. + * + * @param scope the oauth scope + * @return a {@link ApiClient} object. + */ + public ApiClient setOauthScope(String scope) { + for (Authentication auth : authentications.values()) { + if (auth instanceof OAuth) { + ((OAuth) auth).setScope(scope); + return this; + } + } + throw new RuntimeException("No OAuth2 authentication configured!"); + } + + {{/hasOAuthMethods}} + /** + * Set the User-Agent header's value (by adding to the default header map). + * + * @param userAgent Http user agent + * @return a {@link ApiClient} object. + */ + public ApiClient setUserAgent(String userAgent) { + this.userAgent = userAgent; + addDefaultHeader("User-Agent", userAgent); + return this; + } + + /** + * Get the User-Agent header's value. + * + * @return User-Agent string + */ + public String getUserAgent(){ + return userAgent; + } + + /** + * Add a default header. + * + * @param key The header's key + * @param value The header's value + * @return a {@link ApiClient} object. + */ + public ApiClient addDefaultHeader(String key, String value) { + defaultHeaderMap.put(key, value); + return this; + } + + /** + * Add a default cookie. + * + * @param key The cookie's key + * @param value The cookie's value + * @return a {@link ApiClient} object. + */ + public ApiClient addDefaultCookie(String key, String value) { + defaultCookieMap.put(key, value); + return this; + } + + /** + * Gets the client config. + * + * @return Client config + */ + public ClientConfig getClientConfig() { + return clientConfig; + } + + /** + * Set the client config. + * + * @param clientConfig Set the client config + * @return a {@link ApiClient} object. + */ + public ApiClient setClientConfig(ClientConfig clientConfig) { + this.clientConfig = clientConfig; + // Rebuild HTTP Client according to the new "clientConfig" value. + this.httpClient = buildHttpClient(); + return this; + } + + /** + * Check that whether debugging is enabled for this API client. + * + * @return True if debugging is switched on + */ + public boolean isDebugging() { + return debugging; + } + + /** + * Enable/disable debugging for this API client. + * + * @param debugging To enable (true) or disable (false) debugging + * @return a {@link ApiClient} object. + */ + public ApiClient setDebugging(boolean debugging) { + this.debugging = debugging; + applyDebugSetting(this.clientConfig); + // Rebuild HTTP Client according to the new "debugging" value. + this.httpClient = buildHttpClient(); + return this; + } + + /** + * The path of temporary folder used to store downloaded files from endpoints + * with file response. The default value is null, i.e. using + * the system's default temporary folder. + * + * @return Temp folder path + */ + public String getTempFolderPath() { + return tempFolderPath; + } + + /** + * Set temp folder path + * + * @param tempFolderPath Temp folder path + * @return a {@link ApiClient} object. + */ + public ApiClient setTempFolderPath(String tempFolderPath) { + this.tempFolderPath = tempFolderPath; + return this; + } + + /** + * Connect timeout (in milliseconds). + * + * @return Connection timeout + */ + public int getConnectTimeout() { + return connectionTimeout; + } + + /** + * Set the connect timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * + * @param connectionTimeout Connection timeout in milliseconds + * @return a {@link ApiClient} object. + */ + public ApiClient setConnectTimeout(int connectionTimeout) { + this.connectionTimeout = connectionTimeout; + httpClient.property(ClientProperties.CONNECT_TIMEOUT, connectionTimeout); + return this; + } + + /** + * read timeout (in milliseconds). + * + * @return Read timeout + */ + public int getReadTimeout() { + return readTimeout; + } + + /** + * Set the read timeout (in milliseconds). + * A value of 0 means no timeout, otherwise values must be between 1 and + * {@link Integer#MAX_VALUE}. + * + * @param readTimeout Read timeout in milliseconds + * @return a {@link ApiClient} object. + */ + public ApiClient setReadTimeout(int readTimeout) { + this.readTimeout = readTimeout; + httpClient.property(ClientProperties.READ_TIMEOUT, readTimeout); + return this; + } + + /** + * Get the date format used to parse/format date parameters. + * + * @return Date format + */ + public DateFormat getDateFormat() { + return dateFormat; + } + + /** + * Set the date format used to parse/format date parameters. + * + * @param dateFormat Date format + * @return a {@link ApiClient} object. + */ + public ApiClient setDateFormat(DateFormat dateFormat) { + this.dateFormat = dateFormat; + // also set the date format for model (de)serialization with Date properties + this.json.setDateFormat((DateFormat) dateFormat.clone()); + return this; + } + + /** + * Parse the given string into Date object. + * + * @param str String + * @return Date + */ + public Date parseDate(String str) { + try { + return dateFormat.parse(str); + } catch (java.text.ParseException e) { + throw new RuntimeException(e); + } + } + + /** + * Format the given Date object into string. + * + * @param date Date + * @return Date in string format + */ + public String formatDate(Date date) { + return dateFormat.format(date); + } + + /** + * Format the given parameter object into string. + * + * @param param Object + * @return Object in string format + */ + public String parameterToString(Object param) { + if (param == null) { + return ""; + } else if (param instanceof Date) { + return formatDate((Date) param); + } {{#jsr310}}else if (param instanceof OffsetDateTime) { + return formatOffsetDateTime((OffsetDateTime) param); + } {{/jsr310}}else if (param instanceof Collection) { + StringBuilder b = new StringBuilder(); + for(Object o : (Collection)param) { + if(b.length() > 0) { + b.append(','); + } + b.append(String.valueOf(o)); + } + return b.toString(); + } else { + return String.valueOf(param); + } + } + + /* + * Format to {@code Pair} objects. + * + * @param collectionFormat Collection format + * @param name Name + * @param value Value + * @return List of pairs + */ + public List parameterToPairs(String collectionFormat, String name, Object value){ + List params = new ArrayList<>(); + + // preconditions + if (name == null || name.isEmpty() || value == null) return params; + + Collection valueCollection; + if (value instanceof Collection) { + valueCollection = (Collection) value; + } else { + params.add(new Pair(name, parameterToString(value))); + return params; + } + + if (valueCollection.isEmpty()){ + return params; + } + + // get the collection format (default: csv) + String format = (collectionFormat == null || collectionFormat.isEmpty() ? "csv" : collectionFormat); + + // create the params based on the collection format + if ("multi".equals(format)) { + for (Object item : valueCollection) { + params.add(new Pair(name, parameterToString(item))); + } + + return params; + } + + String delimiter = ","; + + if ("csv".equals(format)) { + delimiter = ","; + } else if ("ssv".equals(format)) { + delimiter = " "; + } else if ("tsv".equals(format)) { + delimiter = "\t"; + } else if ("pipes".equals(format)) { + delimiter = "|"; + } + + StringBuilder sb = new StringBuilder() ; + for (Object item : valueCollection) { + sb.append(delimiter); + sb.append(parameterToString(item)); + } + + params.add(new Pair(name, sb.substring(1))); + + return params; + } + + /** + * Check if the given MIME is a JSON MIME. + * JSON MIME examples: + * application/json + * application/json; charset=UTF8 + * APPLICATION/JSON + * application/vnd.company+json + * "*{@literal /}*" is also considered JSON by this method. + * + * @param mime MIME + * @return True if the MIME type is JSON + */ + public boolean isJsonMime(String mime) { + return mime != null && (mime.equals("*/*") || JSON_MIME_PATTERN.matcher(mime).matches()); + } + + /** + * Select the Accept header's value from the given accepts array: + * if JSON exists in the given array, use it; + * otherwise use all of them (joining into a string) + * + * @param accepts The accepts array to select from + * @return The Accept header to use. If the given array is empty, + * null will be returned (not to set the Accept header explicitly). + */ + public String selectHeaderAccept(String... accepts) { + if (accepts == null || accepts.length == 0) { + return null; + } + for (String accept : accepts) { + if (isJsonMime(accept)) { + return accept; + } + } + return StringUtil.join(accepts, ","); + } + + /** + * Select the Content-Type header's value from the given array: + * if JSON exists in the given array, use it; + * otherwise use the first one of the array. + * + * @param contentTypes The Content-Type array to select from + * @return The Content-Type header to use. If the given array is empty, + * JSON will be used. + */ + public String selectHeaderContentType(String... contentTypes) { + if (contentTypes == null || contentTypes.length == 0) { + return "application/json"; + } + for (String contentType : contentTypes) { + if (isJsonMime(contentType)) { + return contentType; + } + } + return contentTypes[0]; + } + + /** + * Escape the given string to be used as URL query value. + * + * @param str String + * @return Escaped string + */ + public String escapeString(String str) { + try { + return URLEncoder.encode(str, "utf8").replaceAll("\\+", "%20"); + } catch (UnsupportedEncodingException e) { + return str; + } + } + + /** + * Serialize the given Java object into string entity according the given + * Content-Type (only JSON is supported for now). + * + * @param obj Object + * @param formParams Form parameters + * @param contentType Context type + * @return Entity + * @throws ApiException API exception + */ + public Entity serialize(Object obj, Map formParams, String contentType, boolean isBodyNullable) throws ApiException { + Entity entity; + if (contentType.startsWith("multipart/form-data")) { + MultiPart multiPart = new MultiPart(); + for (Entry param: formParams.entrySet()) { + if (param.getValue() instanceof Iterable) { + ((Iterable)param.getValue()).forEach(v -> addParamToMultipart(v, param.getKey(), multiPart)); + } else { + addParamToMultipart(param.getValue(), param.getKey(), multiPart); + } + } + entity = Entity.entity(multiPart, MediaType.MULTIPART_FORM_DATA_TYPE); + } else if (contentType.startsWith("application/x-www-form-urlencoded")) { + Form form = new Form(); + for (Entry param: formParams.entrySet()) { + form.param(param.getKey(), parameterToString(param.getValue())); + } + entity = Entity.entity(form, MediaType.APPLICATION_FORM_URLENCODED_TYPE); + } else { + // We let jersey handle the serialization + if (isBodyNullable) { // payload is nullable + if (obj instanceof String) { + entity = Entity.entity(obj == null ? "null" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); + } else { + entity = Entity.entity(obj == null ? "null" : obj, contentType); + } + } else { + if (obj instanceof String) { + entity = Entity.entity(obj == null ? "" : "\"" + ((String)obj).replaceAll("\"", Matcher.quoteReplacement("\\\"")) + "\"", contentType); + } else { + entity = Entity.entity(obj == null ? "" : obj, contentType); + } + } + } + return entity; + } + + /** + * Adds the object with the provided key to the MultiPart. + * Based on the object type sets Content-Disposition and Content-Type. + * + * @param obj Object + * @param key Key of the object + * @param multiPart MultiPart to add the form param to + */ + protected void addParamToMultipart(Object value, String key, MultiPart multiPart) { + if (value instanceof File) { + File file = (File) value; + FormDataContentDisposition contentDisp = FormDataContentDisposition.name(key) + .fileName(file.getName()).size(file.length()).build(); + + // Attempt to probe the content type for the file so that the form part is more correctly + // and precisely identified, but fall back to application/octet-stream if that fails. + MediaType type; + try { + type = MediaType.valueOf(Files.probeContentType(file.toPath())); + } catch (IOException | IllegalArgumentException e) { + type = MediaType.APPLICATION_OCTET_STREAM_TYPE; + } + + multiPart.bodyPart(new FormDataBodyPart(contentDisp, file, type)); + } else { + FormDataContentDisposition contentDisp = FormDataContentDisposition.name(key).build(); + multiPart.bodyPart(new FormDataBodyPart(contentDisp, parameterToString(value))); + } + } + + /** + * Serialize the given Java object into string according the given + * Content-Type (only JSON, HTTP form is supported for now). + * + * @param obj Object + * @param formParams Form parameters + * @param contentType Context type + * @param isBodyNullable True if the body is nullable + * @return String + * @throws ApiException API exception + */ + public String serializeToString(Object obj, Map formParams, String contentType, boolean isBodyNullable) throws ApiException { + try { + if (contentType.startsWith("multipart/form-data")) { + throw new ApiException("multipart/form-data not yet supported for serializeToString (http signature authentication)"); + } else if (contentType.startsWith("application/x-www-form-urlencoded")) { + String formString = ""; + for (Entry param : formParams.entrySet()) { + formString = param.getKey() + "=" + URLEncoder.encode(parameterToString(param.getValue()), "UTF-8") + "&"; + } + + if (formString.length() == 0) { // empty string + return formString; + } else { + return formString.substring(0, formString.length() - 1); + } + } else { + if (isBodyNullable) { + return obj == null ? "null" : json.getMapper().writeValueAsString(obj); + } else { + return obj == null ? "" : json.getMapper().writeValueAsString(obj); + } + } + } catch (Exception ex) { + throw new ApiException("Failed to perform serializeToString: " + ex.toString()); + } + } + + /** + * Deserialize response body to Java object according to the Content-Type. + * + * @param Type + * @param response Response + * @param returnType Return type + * @return Deserialize object + * @throws ApiException API exception + */ + @SuppressWarnings("unchecked") + public T deserialize(Response response, GenericType returnType) throws ApiException { + if (response == null || returnType == null) { + return null; + } + + if ("byte[]".equals(returnType.toString())) { + // Handle binary response (byte array). + return (T) response.readEntity(byte[].class); + } else if (returnType.getRawType() == File.class) { + // Handle file downloading. + T file = (T) downloadFileFromResponse(response); + return file; + } + + // read the entity stream multiple times + response.bufferEntity(); + + return response.readEntity(returnType); + } + + /** + * Download file from the given response. + * + * @param response Response + * @return File + * @throws ApiException If fail to read file content from response and write to disk + */ + public File downloadFileFromResponse(Response response) throws ApiException { + try { + File file = prepareDownloadFile(response); + Files.copy(response.readEntity(InputStream.class), file.toPath(), StandardCopyOption.REPLACE_EXISTING); + return file; + } catch (IOException e) { + throw new ApiException(e); + } + } + + /** + *

Prepare the file for download from the response.

+ * + * @param response a {@link {{javaxPackage}}.ws.rs.core.Response} object. + * @return a {@link java.io.File} object. + * @throws java.io.IOException if any. + */ + public File prepareDownloadFile(Response response) throws IOException { + String filename = null; + String contentDisposition = (String) response.getHeaders().getFirst("Content-Disposition"); + if (contentDisposition != null && !"".equals(contentDisposition)) { + // Get filename from the Content-Disposition header. + Pattern pattern = Pattern.compile("filename=['\"]?([^'\"\\s]+)['\"]?"); + Matcher matcher = pattern.matcher(contentDisposition); + if (matcher.find()) + filename = matcher.group(1); + } + + String prefix; + String suffix = null; + if (filename == null) { + prefix = "download-"; + suffix = ""; + } else { + int pos = filename.lastIndexOf('.'); + if (pos == -1) { + prefix = filename + "-"; + } else { + prefix = filename.substring(0, pos) + "-"; + suffix = filename.substring(pos); + } + // Files.createTempFile requires the prefix to be at least three characters long + if (prefix.length() < 3) + prefix = "download-"; + } + + if (tempFolderPath == null) + return Files.createTempFile(prefix, suffix).toFile(); + else + return Files.createTempFile(Paths.get(tempFolderPath), prefix, suffix).toFile(); + } + + /** + * Invoke API by sending HTTP request with the given options. + * + * @param Type + * @param operation The qualified name of the operation + * @param path The sub-path of the HTTP URL + * @param method The request method, one of "GET", "POST", "PUT", "HEAD" and "DELETE" + * @param queryParams The query parameters + * @param body The request body object + * @param headerParams The header parameters + * @param cookieParams The cookie parameters + * @param formParams The form parameters + * @param accept The request's Accept header + * @param contentType The request's Content-Type header + * @param authNames The authentications to apply + * @param returnType The return type into which to deserialize the response + * @param isBodyNullable True if the body is nullable + * @return The response body in type of string + * @throws ApiException API exception + */ + public ApiResponse invokeAPI( + String operation, + String path, + String method, + List queryParams, + Object body, + Map headerParams, + Map cookieParams, + Map formParams, + String accept, + String contentType, + String[] authNames, + GenericType returnType, + boolean isBodyNullable) + throws ApiException { + + String targetURL; + List serverConfigurations; + if (serverIndex != null && (serverConfigurations = operationServers.get(operation)) != null) { + int index = operationServerIndex.getOrDefault(operation, serverIndex).intValue(); + Map variables = operationServerVariables.getOrDefault(operation, serverVariables); + if (index < 0 || index >= serverConfigurations.size()) { + throw new ArrayIndexOutOfBoundsException( + String.format( + Locale.ROOT, + "Invalid index %d when selecting the host settings. Must be less than %d", + index, serverConfigurations.size())); + } + targetURL = serverConfigurations.get(index).URL(variables) + path; + } else { + targetURL = this.basePath + path; + } + // Not using `.target(targetURL).path(path)` below, + // to support (constant) query string in `path`, e.g. "/posts?draft=1" + WebTarget target = httpClient.target(targetURL); + + // put all headers in one place + Map allHeaderParams = new HashMap<>(defaultHeaderMap); + allHeaderParams.putAll(headerParams); + + if (authNames != null) { + // update different parameters (e.g. headers) for authentication + updateParamsForAuth( + authNames, + queryParams, + allHeaderParams, + cookieParams, + {{#hasHttpSignatureMethods}} + serializeToString(body, formParams, contentType, isBodyNullable), + {{/hasHttpSignatureMethods}} + {{^hasHttpSignatureMethods}} + null, + {{/hasHttpSignatureMethods}} + method, + target.getUri()); + } + + if (queryParams != null) { + for (Pair queryParam : queryParams) { + if (queryParam.getValue() != null) { + target = target.queryParam(queryParam.getName(), escapeString(queryParam.getValue())); + } + } + } + + Invocation.Builder invocationBuilder = target.request(); + + if (accept != null) { + invocationBuilder = invocationBuilder.accept(accept); + } + + for (Entry entry : cookieParams.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } + + for (Entry entry : defaultCookieMap.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.cookie(entry.getKey(), value); + } + } + + Entity entity = serialize(body, formParams, contentType, isBodyNullable); + + for (Entry entry : allHeaderParams.entrySet()) { + String value = entry.getValue(); + if (value != null) { + invocationBuilder = invocationBuilder.header(entry.getKey(), value); + } + } + + Response response = null; + + try { + response = sendRequest(method, invocationBuilder, entity); + + final int statusCode = response.getStatusInfo().getStatusCode(); + + {{#hasOAuthMethods}} + // If OAuth is used and a status 401 is received, renew the access token and retry the request + if (authNames != null && statusCode == Status.UNAUTHORIZED.getStatusCode()) { + for (String authName : authNames) { + Authentication authentication = authentications.get(authName); + if (authentication instanceof OAuth) { + OAuth2AccessToken accessToken = ((OAuth) authentication).renewAccessToken(); + if (accessToken != null) { + invocationBuilder.header("Authorization", null); + invocationBuilder.header("Authorization", "Bearer " + accessToken.getAccessToken()); + response = sendRequest(method, invocationBuilder, entity); + } + break; + } + } + } + + {{/hasOAuthMethods}} + Map> responseHeaders = buildResponseHeaders(response); + + if (statusCode == Status.NO_CONTENT.getStatusCode()) { + return new ApiResponse(statusCode, responseHeaders); + } else if (response.getStatusInfo().getFamily() == Status.Family.SUCCESSFUL) { + if (returnType == null) { + return new ApiResponse(statusCode, responseHeaders); + } else { + return new ApiResponse(statusCode, responseHeaders, deserialize(response, returnType)); + } + } else { + String message = "error"; + String respBody = null; + if (response.hasEntity()) { + try { + respBody = String.valueOf(response.readEntity(String.class)); + message = respBody; + } catch (RuntimeException e) { + // e.printStackTrace(); + } + } + throw new ApiException( + response.getStatus(), message, buildResponseHeaders(response), respBody); + } + } finally { + try { + response.close(); + } catch (Exception e) { + // it's not critical, since the response object is local in method invokeAPI; that's fine, + // just continue + } + } + } + + protected Response sendRequest(String method, Invocation.Builder invocationBuilder, Entity entity) { + Response response; + if ("POST".equals(method)) { + response = invocationBuilder.post(entity); + } else if ("PUT".equals(method)) { + response = invocationBuilder.put(entity); + } else if ("DELETE".equals(method)) { + if ("".equals(entity.getEntity())) { + response = invocationBuilder.method("DELETE"); + } else { + response = invocationBuilder.method("DELETE", entity); + } + } else if ("PATCH".equals(method)) { + response = invocationBuilder.method("PATCH", entity); + } else { + response = invocationBuilder.method(method); + } + return response; + } + + /** + * @deprecated Add qualified name of the operation as a first parameter. + */ + @Deprecated + public ApiResponse invokeAPI(String path, String method, List queryParams, Object body, Map headerParams, Map cookieParams, Map formParams, String accept, String contentType, String[] authNames, GenericType returnType, boolean isBodyNullable) throws ApiException { + return invokeAPI(null, path, method, queryParams, body, headerParams, cookieParams, formParams, accept, contentType, authNames, returnType, isBodyNullable); + } + + /** + * Build the Client used to make HTTP requests. + * + * @return Client + */ + protected Client buildHttpClient() { + // Create ClientConfig if it has not been initialized yet + if (clientConfig == null) { + clientConfig = getDefaultClientConfig(); + } + + ClientBuilder clientBuilder = ClientBuilder.newBuilder(); + clientBuilder = clientBuilder.withConfig(clientConfig); + customizeClientBuilder(clientBuilder); + return clientBuilder.build(); + } + + /** + * Get the default client config. + * + * @return Client config + */ + public ClientConfig getDefaultClientConfig() { + ClientConfig clientConfig = new ClientConfig(); + clientConfig.register(MultiPartFeature.class); + clientConfig.register(json); + clientConfig.register(JacksonFeature.class); + clientConfig.property(HttpUrlConnectorProvider.SET_METHOD_WORKAROUND, true); + // turn off compliance validation to be able to send payloads with DELETE calls + clientConfig.property(ClientProperties.SUPPRESS_HTTP_COMPLIANCE_VALIDATION, true); + applyDebugSetting(clientConfig); + return clientConfig; + } + + protected void applyDebugSetting(ClientConfig clientConfig) { + if (debugging) { + clientConfig.register(new LoggingFeature(java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), java.util.logging.Level.INFO, LoggingFeature.Verbosity.PAYLOAD_ANY, 1024*50 /* Log payloads up to 50K */)); + clientConfig.property(LoggingFeature.LOGGING_FEATURE_VERBOSITY, LoggingFeature.Verbosity.PAYLOAD_ANY); + // Set logger to ALL + java.util.logging.Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME).setLevel(java.util.logging.Level.ALL); + } else { + // suppress warnings for payloads with DELETE calls: + java.util.logging.Logger.getLogger("org.glassfish.jersey.client").setLevel(java.util.logging.Level.SEVERE); + } + } + + /** + * Customize the client builder. + * + * This method can be overridden to customize the API client. For example, this can be used to: + * 1. Set the hostname verifier to be used by the client to verify the endpoint's hostname + * against its identification information. + * 2. Set the client-side key store. + * 3. Set the SSL context that will be used when creating secured transport connections to + * server endpoints from web targets created by the client instance that is using this SSL context. + * 4. Set the client-side trust store. + * + * To completely disable certificate validation (at your own risk), you can + * override this method and invoke disableCertificateValidation(clientBuilder). + * + * @param clientBuilder a {@link {{javaxPackage}}.ws.rs.client.ClientBuilder} object. + */ + protected void customizeClientBuilder(ClientBuilder clientBuilder) { + // No-op extension point + } + + /** + * Disable X.509 certificate validation in TLS connections. + * + * Please note that trusting all certificates is extremely risky. + * This may be useful in a development environment with self-signed certificates. + * + * @param clientBuilder a {@link {{javaxPackage}}.ws.rs.client.ClientBuilder} object. + * @throws java.security.KeyManagementException if any. + * @throws java.security.NoSuchAlgorithmException if any. + */ + protected void disableCertificateValidation(ClientBuilder clientBuilder) throws KeyManagementException, NoSuchAlgorithmException { + TrustManager[] trustAllCerts = new X509TrustManager[] { + new X509TrustManager() { + @Override + public X509Certificate[] getAcceptedIssuers() { + return null; + } + @Override + public void checkClientTrusted(X509Certificate[] certs, String authType) { + } + @Override + public void checkServerTrusted(X509Certificate[] certs, String authType) { + } + } + }; + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(null, trustAllCerts, new SecureRandom()); + clientBuilder.sslContext(sslContext); + } + + /** + *

Build the response headers.

+ * + * @param response a {@link {{javaxPackage}}.ws.rs.core.Response} object. + * @return a {@link java.util.Map} of response headers. + */ + protected Map> buildResponseHeaders(Response response) { + Map> responseHeaders = new HashMap<>(); + for (Entry> entry: response.getHeaders().entrySet()) { + List values = entry.getValue(); + List headers = new ArrayList<>(); + for (Object o : values) { + headers.add(String.valueOf(o)); + } + responseHeaders.put(entry.getKey(), headers); + } + return responseHeaders; + } + + /** + * Update query and header parameters based on authentication settings. + * + * @param authNames The authentications to apply + * @param queryParams List of query parameters + * @param headerParams Map of header parameters + * @param cookieParams Map of cookie parameters + * @param method HTTP method (e.g. POST) + * @param uri HTTP URI + */ + protected void updateParamsForAuth(String[] authNames, List queryParams, Map headerParams, + Map cookieParams, String payload, String method, URI uri) throws ApiException { + for (String authName : authNames) { + Authentication auth = authentications.get(authName); + if (auth == null) { + continue; + } + auth.applyToParams(queryParams, headerParams, cookieParams, payload, method, uri); + } + } +} \ No newline at end of file diff --git a/template/libraries/jersey3/JSON.mustache b/template/libraries/jersey3/JSON.mustache new file mode 100644 index 00000000..f73d7eaf --- /dev/null +++ b/template/libraries/jersey3/JSON.mustache @@ -0,0 +1,257 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import com.fasterxml.jackson.annotation.*; +import com.fasterxml.jackson.databind.*; +import com.fasterxml.jackson.databind.json.JsonMapper; +{{#openApiNullable}} +import org.openapitools.jackson.nullable.JsonNullableModule; +{{/openApiNullable}} +import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; +{{#joda}} +import com.fasterxml.jackson.datatype.joda.JodaModule; +{{/joda}} + +import java.text.DateFormat; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; +import {{javaxPackage}}.ws.rs.core.GenericType; +import {{javaxPackage}}.ws.rs.ext.ContextResolver; + +{{>generatedAnnotation}} + +public class JSON implements ContextResolver { + private ObjectMapper mapper; + + public JSON() { + mapper = JsonMapper.builder() + .serializationInclusion(JsonInclude.Include.NON_NULL) + .configure(MapperFeature.ALLOW_COERCION_OF_SCALARS, false) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, {{failOnUnknownProperties}}) + .configure(DeserializationFeature.FAIL_ON_INVALID_SUBTYPE, true) + .disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS) + .enable(SerializationFeature.WRITE_ENUMS_USING_TO_STRING) + .enable(DeserializationFeature.READ_ENUMS_USING_TO_STRING) + .defaultDateFormat(new RFC3339DateFormat()) + .addModule(new JavaTimeModule()) + {{#joda}} + .addModule(new JodaModule()) + {{/joda}} + {{#openApiNullable}} + .addModule(new JsonNullableModule()) + {{/openApiNullable}} + .addModule(new RFC3339JavaTimeModule()) + .build(); + } + + /** + * Set the date format for JSON (de)serialization with Date properties. + * @param dateFormat Date format + */ + public void setDateFormat(DateFormat dateFormat) { + mapper.setDateFormat(dateFormat); + } + + @Override + public ObjectMapper getContext(Class type) { + return mapper; + } + + /** + * Get the object mapper + * + * @return object mapper + */ + public ObjectMapper getMapper() { return mapper; } + + /** + * Returns the target model class that should be used to deserialize the input data. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param modelClass The class that contains the discriminator mappings. + */ + public static Class getClassForElement(JsonNode node, Class modelClass) { + ClassDiscriminatorMapping cdm = modelDiscriminators.get(modelClass); + if (cdm != null) { + return cdm.getClassForElement(node, new HashSet<>()); + } + return null; + } + + /** + * Helper class to register the discriminator mappings. + */ + private static class ClassDiscriminatorMapping { + // The model class name. + Class modelClass; + // The name of the discriminator property. + String discriminatorName; + // The discriminator mappings for a model class. + Map> discriminatorMappings; + + // Constructs a new class discriminator. + ClassDiscriminatorMapping(Class cls, String propertyName, Map> mappings) { + modelClass = cls; + discriminatorName = propertyName; + discriminatorMappings = new HashMap<>(); + if (mappings != null) { + discriminatorMappings.putAll(mappings); + } + } + + // Return the discriminator value or null if the discriminator is not + // present in the payload. + String getDiscriminatorValue(JsonNode node) { + // Determine the value of the discriminator property in the input data. + if (discriminatorName != null) { + // Get the value of the discriminator property, if present in the input payload. + node = node.get(discriminatorName); + if (node != null && node.isValueNode()) { + String discrValue = node.asText(); + if (discrValue != null) { + return discrValue; + } + } + } + return null; + } + + /** + * Returns the target model class that should be used to deserialize the input data. + * This function can be invoked for anyOf/oneOf composed models with discriminator mappings. + * The discriminator mappings are used to determine the target model class. + * + * @param node The input data. + * @param visitedClasses The set of classes that have already been visited. + */ + Class getClassForElement(JsonNode node, Set> visitedClasses) { + if (visitedClasses.contains(modelClass)) { + // Class has already been visited. + return null; + } + // Determine the value of the discriminator property in the input data. + String discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + return null; + } + Class cls = discriminatorMappings.get(discrValue); + // It may not be sufficient to return this cls directly because that target class + // may itself be a composed schema, possibly with its own discriminator. + visitedClasses.add(modelClass); + for (Class childClass : discriminatorMappings.values()) { + ClassDiscriminatorMapping childCdm = modelDiscriminators.get(childClass); + if (childCdm == null) { + continue; + } + if (!discriminatorName.equals(childCdm.discriminatorName)) { + discrValue = getDiscriminatorValue(node); + if (discrValue == null) { + continue; + } + } + if (childCdm != null) { + // Recursively traverse the discriminator mappings. + Class childDiscr = childCdm.getClassForElement(node, visitedClasses); + if (childDiscr != null) { + return childDiscr; + } + } + } + return cls; + } + } + + /** + * Returns true if inst is an instance of modelClass in the OpenAPI model hierarchy. + * + * The Java class hierarchy is not implemented the same way as the OpenAPI model hierarchy, + * so it's not possible to use the instanceof keyword. + * + * @param modelClass A OpenAPI model class. + * @param inst The instance object. + */ + public static boolean isInstanceOf(Class modelClass, Object inst, Set> visitedClasses) { + if (modelClass.isInstance(inst)) { + // This handles the 'allOf' use case with single parent inheritance. + return true; + } + if (visitedClasses.contains(modelClass)) { + // This is to prevent infinite recursion when the composed schemas have + // a circular dependency. + return false; + } + visitedClasses.add(modelClass); + + // Traverse the oneOf/anyOf composed schemas. + Map> descendants = modelDescendants.get(modelClass); + if (descendants != null) { + for (GenericType childType : descendants.values()) { + if (isInstanceOf(childType.getRawType(), inst, visitedClasses)) { + return true; + } + } + } + return false; + } + + /** + * A map of discriminators for all model classes. + */ + private static Map, ClassDiscriminatorMapping> modelDiscriminators = new HashMap<>(); + + /** + * A map of oneOf/anyOf descendants for each model class. + */ + private static Map, Map>> modelDescendants = new HashMap<>(); + + /** + * Register a model class discriminator. + * + * @param modelClass the model class + * @param discriminatorPropertyName the name of the discriminator property + * @param mappings a map with the discriminator mappings. + */ + public static void registerDiscriminator(Class modelClass, String discriminatorPropertyName, Map> mappings) { + ClassDiscriminatorMapping m = new ClassDiscriminatorMapping(modelClass, discriminatorPropertyName, mappings); + modelDiscriminators.put(modelClass, m); + } + + /** + * Register the oneOf/anyOf descendants of the modelClass. + * + * @param modelClass the model class + * @param descendants a map of oneOf/anyOf descendants. + */ + public static void registerDescendants(Class modelClass, Map> descendants) { + modelDescendants.put(modelClass, descendants); + } + + private static JSON json; + + static + { + json = new JSON(); + } + + /** + * Get the default JSON instance. + * + * @return the default JSON instance + */ + public static JSON getDefault() { + return json; + } + + /** + * Set the default JSON instance. + * + * @param json JSON instance to be used + */ + public static void setDefault(JSON json) { + JSON.json = json; + } +} diff --git a/template/libraries/jersey3/apiException.mustache b/template/libraries/jersey3/apiException.mustache new file mode 100644 index 00000000..8d813bfb --- /dev/null +++ b/template/libraries/jersey3/apiException.mustache @@ -0,0 +1,102 @@ +{{>licenseInfo}} + +package {{invokerPackage}}; + +import java.util.Map; +import java.util.List; +{{#caseInsensitiveResponseHeaders}} +import java.util.Map.Entry; +import java.util.TreeMap; +{{/caseInsensitiveResponseHeaders}} + +/** + * API Exception + */ +{{>generatedAnnotation}} + +public class ApiException extends{{#useRuntimeException}} RuntimeException {{/useRuntimeException}}{{^useRuntimeException}} Exception {{/useRuntimeException}}{ + private static final long serialVersionUID = 5994704121876855946L; + + private int code = 0; + private transient Map> responseHeaders = null; + private String responseBody = null; + + public ApiException() {} + + public ApiException(Throwable throwable) { + super(throwable); + } + + public ApiException(String message) { + super(message); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders, String responseBody) { + super(message, throwable); + this.code = code; + {{#caseInsensitiveResponseHeaders}} + Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER); + for(Entry> entry : responseHeaders.entrySet()){ + headers.put(entry.getKey().toLowerCase(), entry.getValue()); + } + {{/caseInsensitiveResponseHeaders}} + this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}; + this.responseBody = responseBody; + } + + public ApiException(String message, int code, Map> responseHeaders, String responseBody) { + this(message, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(String message, Throwable throwable, int code, Map> responseHeaders) { + this(message, throwable, code, responseHeaders, null); + } + + public ApiException(int code, Map> responseHeaders, String responseBody) { + this((String) null, (Throwable) null, code, responseHeaders, responseBody); + } + + public ApiException(int code, String message) { + super(message); + this.code = code; + } + + public ApiException(int code, String message, Map> responseHeaders, String responseBody) { + this(code, message); + {{#caseInsensitiveResponseHeaders}} + Map> headers = new TreeMap>(String.CASE_INSENSITIVE_ORDER); + for(Entry> entry : responseHeaders.entrySet()){ + headers.put(entry.getKey().toLowerCase(), entry.getValue()); + } + {{/caseInsensitiveResponseHeaders}} + this.responseHeaders = {{#caseInsensitiveResponseHeaders}}headers{{/caseInsensitiveResponseHeaders}}{{^caseInsensitiveResponseHeaders}}responseHeaders{{/caseInsensitiveResponseHeaders}}; + this.responseBody = responseBody; + } + + /** + * Get the HTTP status code. + * + * @return HTTP status code + */ + public int getCode() { + return code; + } + + /** + * Get the HTTP response headers. + * + * @return A map of list of string + */ + public Map> getResponseHeaders() { + return responseHeaders; + } + + /** + * Get the HTTP response body. + * + * @return Response body in the form of string + */ + public String getResponseBody() { + return responseBody; + } +} diff --git a/template/libraries/jersey3/api_doc.mustache b/template/libraries/jersey3/api_doc.mustache index d62e10ff..6a770e34 100644 --- a/template/libraries/jersey3/api_doc.mustache +++ b/template/libraries/jersey3/api_doc.mustache @@ -25,8 +25,10 @@ All URIs are relative to *{{basePath}}* ```java package main; +import java.util.*; + import com.fingerprint.v4.api.FingerprintApi; -import com.fingerprint.v4.sdk.model.*; +import com.fingerprint.v4.model.*; import com.fingerprint.v4.sdk.ApiClient; import com.fingerprint.v4.sdk.ApiException; import com.fingerprint.v4.sdk.Region; diff --git a/template/libraries/jersey3/oneof_model.mustache b/template/libraries/jersey3/oneof_model.mustache index 888cfd6c..72bf3bb5 100644 --- a/template/libraries/jersey3/oneof_model.mustache +++ b/template/libraries/jersey3/oneof_model.mustache @@ -4,8 +4,8 @@ use = JsonTypeInfo.Id.NAME, include = JsonTypeInfo.As.PROPERTY, property = "{{propertyName}}", - defaultImpl = {{classname}}.Unknown{{classname}}.class -) + defaultImpl = {{classname}}.Unknown{{classname}}.class, + visible = true) @JsonSubTypes({ {{#mappedModels}} @JsonSubTypes.Type(value = {{modelName}}.class, name = "{{mappingName}}"){{^-last}},{{/-last}} diff --git a/template/modelEnum.mustache b/template/modelEnum.mustache index 8c1adb89..7c47f2cb 100644 --- a/template/modelEnum.mustache +++ b/template/modelEnum.mustache @@ -34,8 +34,8 @@ import java.util.Locale; {{#withXml}} @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) {{/withXml}} - {{{name}}}({{{value}}}){{^-last}}, - {{/-last}}{{#-last}};{{/-last}}{{/enumVars}}{{/allowableValues}} + {{^-last}}{{{name}}}({{{value}}}),{{/-last}} + {{#-last}}UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED({{#isString}}"unsupported_value_sdk_upgrade_required"{{/isString}}{{#isInteger}}Integer.MAX_VALUE{{/isInteger}});{{/-last}}{{/enumVars}}{{/allowableValues}} private {{{dataType}}} value; @@ -64,7 +64,7 @@ import java.util.Locale; return b; } } - {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}return UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED;{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} } {{#gson}} diff --git a/template/modelInnerEnum.mustache b/template/modelInnerEnum.mustache index 17825230..7e7cc97a 100644 --- a/template/modelInnerEnum.mustache +++ b/template/modelInnerEnum.mustache @@ -23,8 +23,8 @@ {{#withXml}} @XmlEnumValue({{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}{{{value}}}{{#isInteger}}"{{/isInteger}}{{#isDouble}}"{{/isDouble}}{{#isLong}}"{{/isLong}}{{#isFloat}}"{{/isFloat}}) {{/withXml}} - {{{name}}}({{^isUri}}{{dataType}}.valueOf({{/isUri}}{{{value}}}{{^isUri}}){{/isUri}}){{^-last}}, - {{/-last}}{{#-last}};{{/-last}} + {{^-last}}{{{name}}}({{^isUri}}{{dataType}}.valueOf({{/isUri}}{{{value}}}{{^isUri}}){{/isUri}}),{{/-last}} + {{#-last}}UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED({{#isString}}"unsupported_value_sdk_upgrade_required"{{/isString}}{{#isInteger}}Integer.MAX_VALUE{{/isInteger}});{{/-last}} {{/enumVars}} {{/allowableValues}} @@ -55,7 +55,7 @@ return b; } } - {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}{{#allowableValues}}{{#enumVars}}{{#-last}}return {{{name}}};{{/-last}}{{/enumVars}}{{/allowableValues}}{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} + {{#isNullable}}return null;{{/isNullable}}{{^isNullable}}{{#enumUnknownDefaultCase}}return UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED;{{/enumUnknownDefaultCase}}{{^enumUnknownDefaultCase}}throw new IllegalArgumentException("Unexpected value '" + value + "'");{{/enumUnknownDefaultCase}}{{/isNullable}} } {{#gson}} diff --git a/template/pojo_doc.mustache b/template/pojo_doc.mustache index ffb3528f..1598e6fb 100644 --- a/template/pojo_doc.mustache +++ b/template/pojo_doc.mustache @@ -17,7 +17,7 @@ | Name | Value | |---- | -----|{{#allowableValues}}{{#enumVars}} -| {{name}} | {{{value}}} |{{/enumVars}}{{/allowableValues}} +{{^-last}}| {{name}} | {{{value}}} |{{/-last}}{{#-last}}| UNSUPPORTED_VALUE_SDK_UPGRADE_REQUIRED | {{#isString}}"unsupported_value_sdk_upgrade_required"{{/isString}}{{#isInteger}}Integer.MAX_VALUE{{/isInteger}} |{{/-last}}{{/enumVars}}{{/allowableValues}} {{/isEnum}}{{/vars}} {{#vendorExtensions.x-implements.0}}