diff --git a/.changeset/chubby-ducks-cheer.md b/.changeset/chubby-ducks-cheer.md new file mode 100644 index 0000000..a1d2000 --- /dev/null +++ b/.changeset/chubby-ducks-cheer.md @@ -0,0 +1,5 @@ +--- +'fingerprint-pro-server-api-java-sdk': minor +--- + +**events-search**: Add 'pagination_key' parameter \ No newline at end of file diff --git a/.schema-version b/.schema-version index 5554010..a6316f0 100644 --- a/.schema-version +++ b/.schema-version @@ -1 +1 @@ -v2.2.1 \ No newline at end of file +v2.3.0 \ No newline at end of file diff --git a/README.md b/README.md index ba4b0a2..1caae94 100644 --- a/README.md +++ b/README.md @@ -155,14 +155,16 @@ public class FingerprintApiExample { // Search events with custom filters try { // By visitorId - EventsGetResponse response = api.searchEvents(LIMIT, FPJS_VISITOR_ID, null, null, null, null, null, null, null); + SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setVisitorId(FPJS_VISITOR_ID)); + // Next page + // SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setPaginationKey(response.getPaginationKey()).setVisitorId(FPJS_VISITOR_ID)); // Bad bot - // EventsGetResponse response = api.searchEvents(LIMIT, null, "bad", null, null, null, null, null, null); + // SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setBot("bad")); // Filtered by IP - // EventsGetResponse response = api.searchEvents(LIMIT, null, null, "192.168.0.1/32", null, null, null, null, null); - System.out.println(response.getProducts().toString()); + // SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setIpAddress("192.168.0.1/32")); + System.out.println(response.getEvents().toString()); } catch (ApiException e) { - System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage()); + System.err.println("Exception when calling FingerprintApi.searchEvents:" + e.getMessage()); } // Update an event with a given requestId diff --git a/docs/FingerprintApi.md b/docs/FingerprintApi.md index 12459e4..9bc12d2 100644 --- a/docs/FingerprintApi.md +++ b/docs/FingerprintApi.md @@ -76,7 +76,7 @@ public class FingerprintApiExample { FingerprintApi api = new FingerprintApi(client); String visitorId = "visitorId_example"; // String | The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) you want to delete. try { - apiInstance.deleteVisitorData(visitorId); + api.deleteVisitorData(visitorId); } catch (ApiException e) { System.err.println("Exception when calling FingerprintApi.deleteVisitorData:" + e.getMessage()); } @@ -159,7 +159,7 @@ public class FingerprintApiExample { FingerprintApi api = new FingerprintApi(client); String requestId = "requestId_example"; // String | The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request. try { - EventsGetResponse result = apiInstance.getEvent(requestId); + EventsGetResponse result = api.getEvent(requestId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage()); @@ -243,7 +243,7 @@ public class FingerprintApiExample { FingerprintApi api = new FingerprintApi(client); String visitorId = "visitorId_example"; // String | The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) for which you want to find the other visitor IDs that originated from the same mobile device. try { - RelatedVisitorsResponse result = apiInstance.getRelatedVisitors(visitorId); + RelatedVisitorsResponse result = api.getRelatedVisitors(visitorId); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FingerprintApi.getRelatedVisitors:" + e.getMessage()); @@ -333,7 +333,7 @@ public class FingerprintApiExample { String paginationKey = "paginationKey_example"; // String | Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned. Long before = 56L; // Long | ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. try { - VisitorsGetResponse result = apiInstance.getVisits(visitorId, requestId, linkedId, limit, paginationKey, before); + VisitorsGetResponse result = api.getVisits(visitorId, requestId, linkedId, limit, paginationKey, before); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FingerprintApi.getVisits:" + e.getMessage()); @@ -379,7 +379,7 @@ public class FingerprintApiExample { ## searchEvents -> SearchEventsResponse searchEvents(limit, visitorId, bot, ipAddress, linkedId, start, end, reverse, suspect) +> SearchEventsResponse searchEvents(limit, searchEventsOptionalParams) Get events via search @@ -418,6 +418,7 @@ public class FingerprintApiExample { ApiClient client = Configuration.getDefaultApiClient(FPJS_API_SECRET, Region.EUROPE); FingerprintApi api = new FingerprintApi(client); 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 200 results for your search using `limit`, but there are more than 200 events total matching your request), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `timestamp` of the last returned event. 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/search?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/events/search?limit=200&pagination_key=1740815825085` String visitorId = "visitorId_example"; // String | Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. String bot = "all"; // String | 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. String ipAddress = "ipAddress_example"; // String | Filter events by IP address range. The range can be as specific as a single IP (/32 for IPv4 or /128 for IPv6) All ip_address filters must use CIDR notation, for example, 10.0.0.0/24, 192.168.0.1/32 @@ -427,7 +428,16 @@ public class FingerprintApiExample { 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. try { - SearchEventsResponse result = apiInstance.searchEvents(limit, visitorId, bot, ipAddress, linkedId, start, end, reverse, suspect); + SearchEventsResponse result = api.searchEvents(limit, new FingerprintApi.SearchEventsOptionalParams() + .setPaginationKey(paginationKey) + .setVisitorId(visitorId) + .setBot(bot) + .setIpAddress(ipAddress) + .setLinkedId(linkedId) + .setStart(start) + .setEnd(end) + .setReverse(reverse) + .setSuspect(suspect)); System.out.println(result); } catch (ApiException e) { System.err.println("Exception when calling FingerprintApi.searchEvents:" + e.getMessage()); @@ -443,6 +453,15 @@ public class FingerprintApiExample { | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------| | **limit** | **Integer**| Limit the number of events returned. | | +| **searchEventsOptionalParams** | [**FingerprintApi.SearchEventsOptionalParams**](#fingerprintapisearcheventsoptionalparams) | | [optional] | + +#### FingerprintApi.SearchEventsOptionalParams + +Object containing optional parameters for API method. Supports a fluent interface for convenient method chaining. + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **paginationKey** | **String**| Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 200 results for your search using `limit`, but there are more than 200 events total matching your request), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `timestamp` of the last returned event. 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/search?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/events/search?limit=200&pagination_key=1740815825085` | [optional] | | **visitorId** | **String**| Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. | [optional] | | **bot** | **String**| 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. | [optional] [enum: all, good, bad, none] | | **ipAddress** | **String**| Filter events by IP address range. The range can be as specific as a single IP (/32 for IPv4 or /128 for IPv6) All ip_address filters must use CIDR notation, for example, 10.0.0.0/24, 192.168.0.1/32 | [optional] | @@ -518,7 +537,7 @@ public class FingerprintApiExample { String requestId = "requestId_example"; // String | The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). EventsUpdateRequest eventsUpdateRequest = new EventsUpdateRequest(); // EventsUpdateRequest | try { - apiInstance.updateEvent(requestId, eventsUpdateRequest); + api.updateEvent(requestId, eventsUpdateRequest); } catch (ApiException e) { System.err.println("Exception when calling FingerprintApi.updateEvent:" + e.getMessage()); } @@ -597,7 +616,7 @@ public class FingerprintApiExample { FingerprintApi api = new FingerprintApi(client); Webhook webhook = new Webhook(); // Webhook | try { - apiInstance.webhookTrace(webhook); + api.webhookTrace(webhook); } catch (ApiException e) { System.err.println("Exception when calling FingerprintApi.webhookTrace:" + e.getMessage()); } diff --git a/docs/SearchEventsResponse.md b/docs/SearchEventsResponse.md index 3ec2a5f..cbb2ebd 100644 --- a/docs/SearchEventsResponse.md +++ b/docs/SearchEventsResponse.md @@ -9,7 +9,7 @@ Contains a list of all identification events matching the specified search crite | Name | Type | Description | Notes | |------------ | ------------- | ------------- | -------------| |**events** | [**List<SearchEventsResponseEventsInner>**](SearchEventsResponseEventsInner.md) | | [optional] | -|**paginationKey** | **String** | | [optional] | +|**paginationKey** | **String** | Use this value in the `pagination_key` parameter to request the next page of search results. | [optional] | diff --git a/examples/src/main/java/com/fingerprint/example/FunctionalTests.java b/examples/src/main/java/com/fingerprint/example/FunctionalTests.java index 9800159..da8fc72 100644 --- a/examples/src/main/java/com/fingerprint/example/FunctionalTests.java +++ b/examples/src/main/java/com/fingerprint/example/FunctionalTests.java @@ -1,7 +1,10 @@ package com.fingerprint.example; import com.fingerprint.api.FingerprintApi; +import com.fingerprint.model.EventsGetResponse; import com.fingerprint.model.EventsUpdateRequest; +import com.fingerprint.model.SearchEventsResponse; +import com.fingerprint.model.VisitorsGetResponse; import com.fingerprint.sdk.ApiClient; import com.fingerprint.sdk.ApiException; import com.fingerprint.sdk.Configuration; @@ -26,7 +29,7 @@ public static void main(String... args) { // Get identification event try { - final Object event = api.getEvent(FPJS_REQUEST_ID); + final EventsGetResponse event = api.getEvent(FPJS_REQUEST_ID); System.out.println(event); } catch (ApiException e) { System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage()); @@ -35,7 +38,7 @@ public static void main(String... args) { // Get visitor history try { - final Object visits = api.getVisits(FPJS_VISITOR_ID, null, null, null, null, null); + final VisitorsGetResponse visits = api.getVisits(FPJS_VISITOR_ID, null, null, null, null, null); System.out.println(visits); } catch (ApiException e) { System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage()); @@ -44,8 +47,8 @@ public static void main(String... args) { // Search events try { - final Object events = api.searchEvents(2, null, "bad", null, null, null, null, null, null); - System.out.println(events); + final SearchEventsResponse events = api.searchEvents(2, new FingerprintApi.SearchEventsOptionalParams().setBot("bad")); + System.out.println(events.getEvents()); } catch (ApiException e) { System.err.println("Exception when calling FingerprintApi.searchEvents:" + e.getMessage()); System.exit(1); diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index 6948fbc..bb27ba4 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -168,6 +168,29 @@ paths: example: 10 description: | Limit the number of events returned. + - name: pagination_key + in: query + schema: + type: string + description: > + Use `pagination_key` to get the next page of results. + + + When more results are available (e.g., you requested up to 200 + results for your search using `limit`, but there are more than 200 + events total matching your request), the `paginationKey` top-level + attribute is added to the response. The key corresponds to the + `timestamp` of the last returned event. 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/search?limit=200` + + 2. Use `response.paginationKey` to get the next page of results: + `GET + api-base-url/events/search?limit=200&pagination_key=1740815825085` - name: visitor_id in: query schema: @@ -291,6 +314,7 @@ paths: how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received. + x-flatten-optional-params: true parameters: - name: visitor_id in: path @@ -601,6 +625,7 @@ paths: Fake path to describe webhook format. More information about webhooks can be found in the [documentation](https://dev.fingerprint.com/docs/webhooks) + x-flatten-optional-params: true requestBody: content: application/json: @@ -2023,6 +2048,9 @@ components: $ref: '#/components/schemas/Products' paginationKey: type: string + description: >- + Use this value in the `pagination_key` parameter to request the next + page of search results. Visit: type: object additionalProperties: false diff --git a/sdk/src/main/java/com/fingerprint/api/FingerprintApi.java b/sdk/src/main/java/com/fingerprint/api/FingerprintApi.java index 361c4b4..4e69363 100644 --- a/sdk/src/main/java/com/fingerprint/api/FingerprintApi.java +++ b/sdk/src/main/java/com/fingerprint/api/FingerprintApi.java @@ -85,7 +85,7 @@ 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 Application](https://dev.fingerprint.com/docs/glossary#fingerprint-application). #### 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 [`/events` API](https://dev.fingerprint.com/reference/getevent) with a `request_id` that was made outside of the 10 days, you will still receive a valid response. - If you request [`/visitors` API](https://dev.fingerprint.com/reference/getvisits) for the deleted visitor ID, the response will include identification requests that were made outside of those 10 days. ### 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) - * @return ApiResponse<Void> + * @return ApiResponse * @throws ApiException if fails to make API call * @http.response.details @@ -159,7 +159,7 @@ public EventsGetResponse getEvent(String requestId) throws ApiException { * Get event by request ID * Get a detailed analysis of an individual identification event, including Smart Signals. Please note that the response includes mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. It is highly recommended that you **ignore** the mobile signals for such requests. Use `requestId` as the URL path parameter. This API method is scoped to a request, i.e. all returned information is by `requestId`. * @param requestId The unique [identifier](https://dev.fingerprint.com/reference/get-function#requestid) of each identification request. (required) - * @return ApiResponse<EventsGetResponse> + * @return ApiResponse * @throws ApiException if fails to make API call * @http.response.details
@@ -235,7 +235,7 @@ public RelatedVisitorsResponse getRelatedVisitors(String visitorId) throws ApiEx * Get Related Visitors * Related visitors API lets you link web visits and in-app browser visits that originated from the same mobile device. It searches the past 6 months of identification events to find the visitor IDs that belong to the same mobile device as the given visitor ID. ⚠️ Please note that this API is not enabled by default and is billable separately. ⚠️ If you would like to use Related visitors API, please contact our [support team](https://fingerprint.com/support). To learn more, see [Related visitors API reference](https://dev.fingerprint.com/reference/related-visitors-api). * @param visitorId The [visitor ID](https://dev.fingerprint.com/reference/get-function#visitorid) for which you want to find the other visitor IDs that originated from the same mobile device. (required) - * @return ApiResponse<RelatedVisitorsResponse> + * @return ApiResponse * @throws ApiException if fails to make API call * @http.response.details
@@ -322,7 +322,7 @@ public VisitorsGetResponse getVisits(String visitorId, String requestId, String * @param limit Limit scanned results. For performance reasons, the API first scans some number of events before filtering them. Use `limit` to specify how many events are scanned before they are filtered by `requestId` or `linkedId`. Results are always returned sorted by the timestamp (most recent first). By default, the most recent 100 visits are scanned, the maximum is 500. (optional) * @param paginationKey Use `paginationKey` to get the next page of results. When more results are available (e.g., you requested 200 results using `limit` parameter, but a total of 600 results are available), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `requestId` of the last returned event. In the following request, use that value in the `paginationKey` parameter to get the next page of results: 1. First request, returning most recent 200 events: `GET api-base-url/visitors/:visitorId?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/visitors/:visitorId?limit=200&paginationKey=1683900801733.Ogvu1j` Pagination happens during scanning and before filtering, so you can get less visits than the `limit` you specified with more available on the next page. When there are no more results available for scanning, the `paginationKey` attribute is not returned. (optional) * @param before ⚠️ Deprecated pagination method, please use `paginationKey` instead. Timestamp (in milliseconds since epoch) used to paginate results. (optional) - * @return ApiResponse<VisitorsGetResponse> + * @return ApiResponse * @throws ApiException if fails to make API call * @http.response.details
@@ -380,18 +380,159 @@ public ApiResponse getVisitsWithHttpInfo(String visitorId, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } + public static class SearchEventsOptionalParams { + + private String paginationKey; + private String visitorId; + private String bot; + private String ipAddress; + private String linkedId; + private Long start; + private Long end; + private Boolean reverse; + private Boolean suspect; + + /** + * getter for paginationKey - Use `pagination_key` to get the next page of results. When more results are available (e.g., you requested up to 200 results for your search using `limit`, but there are more than 200 events total matching your request), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `timestamp` of the last returned event. 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/search?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/events/search?limit=200&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 200 results for your search using `limit`, but there are more than 200 events total matching your request), the `paginationKey` top-level attribute is added to the response. The key corresponds to the `timestamp` of the last returned event. 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/search?limit=200` 2. Use `response.paginationKey` to get the next page of results: `GET api-base-url/events/search?limit=200&pagination_key=1740815825085` + */ + public SearchEventsOptionalParams setPaginationKey(String paginationKey) { + this.paginationKey = paginationKey; + return this; + } + + /** + * getter for visitorId - Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. 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 Pro. Filter for events matching this `visitor_id`. + */ + public SearchEventsOptionalParams setVisitorId(String visitorId) { + this.visitorId = visitorId; + return this; + } + + /** + * 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. + */ + public String 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. + */ + public SearchEventsOptionalParams setBot(String bot) { + this.bot = bot; + return this; + } + + /** + * getter for ipAddress - Filter events by IP address range. The range can be as specific as a single IP (/32 for IPv4 or /128 for IPv6) All ip_address filters must use CIDR notation, for example, 10.0.0.0/24, 192.168.0.1/32 + */ + public String getIpAddress() { + return ipAddress; + } + + /** + * setter for ipAddress - Filter events by IP address range. The range can be as specific as a single IP (/32 for IPv4 or /128 for IPv6) All ip_address filters must use CIDR notation, for example, 10.0.0.0/24, 192.168.0.1/32 + */ + public SearchEventsOptionalParams setIpAddress(String ipAddress) { + this.ipAddress = ipAddress; + return this; + } + + /** + * 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. + */ + 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. + */ + public SearchEventsOptionalParams setLinkedId(String linkedId) { + this.linkedId = linkedId; + return this; + } + + /** + * 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). + */ + public SearchEventsOptionalParams setStart(Long start) { + this.start = start; + return this; + } + + /** + * 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). + */ + public SearchEventsOptionalParams setEnd(Long end) { + this.end = end; + return this; + } + + /** + * getter for reverse - Sort events in reverse timestamp order. + */ + public Boolean getReverse() { + return reverse; + } + + /** + * setter for reverse - Sort events in reverse timestamp order. + */ + public SearchEventsOptionalParams setReverse(Boolean reverse) { + this.reverse = reverse; + return this; + } + + /** + * 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. + */ + 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. + */ + public SearchEventsOptionalParams setSuspect(Boolean suspect) { + this.suspect = suspect; + return this; + } + + } /** * Get events via search * Search for identification events, including Smart Signals, using multiple filtering criteria. If you don't provide `start` or `end` parameters, the default search range is the last 7 days. Please note that events include mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. We recommend you **ignore** mobile signals for such requests. * @param limit Limit the number of events returned. (required) - * @param visitorId Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. (optional) - * @param 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. (optional) - * @param ipAddress Filter events by IP address range. The range can be as specific as a single IP (/32 for IPv4 or /128 for IPv6) All ip_address filters must use CIDR notation, for example, 10.0.0.0/24, 192.168.0.1/32 (optional) - * @param 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. (optional) - * @param start Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) - * @param end Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) - * @param reverse Sort events in reverse timestamp order. (optional) - * @param 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. (optional) + * @param searchEventsOptionalParams Object containing optional parameters for API method. (optional) * @return SearchEventsResponse * @throws ApiException if fails to make API call * @http.response.details @@ -402,23 +543,16 @@ public ApiResponse getVisitsWithHttpInfo(String visitorId,
403 Forbidden. Access to this API is denied. -
*/ - public SearchEventsResponse searchEvents(Integer limit, String visitorId, String bot, String ipAddress, String linkedId, Long start, Long end, Boolean reverse, Boolean suspect) throws ApiException { - return searchEventsWithHttpInfo(limit, visitorId, bot, ipAddress, linkedId, start, end, reverse, suspect).getData(); + public SearchEventsResponse searchEvents(Integer limit, SearchEventsOptionalParams searchEventsOptionalParams) throws ApiException { + return searchEventsWithHttpInfo(limit, searchEventsOptionalParams).getData(); } /** * Get events via search * Search for identification events, including Smart Signals, using multiple filtering criteria. If you don't provide `start` or `end` parameters, the default search range is the last 7 days. Please note that events include mobile signals (e.g. `rootApps`) even if the request originated from a non-mobile platform. We recommend you **ignore** mobile signals for such requests. * @param limit Limit the number of events returned. (required) - * @param visitorId Unique [visitor identifier](https://dev.fingerprint.com/reference/get-function#visitorid) issued by Fingerprint Pro. Filter for events matching this `visitor_id`. (optional) - * @param 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. (optional) - * @param ipAddress Filter events by IP address range. The range can be as specific as a single IP (/32 for IPv4 or /128 for IPv6) All ip_address filters must use CIDR notation, for example, 10.0.0.0/24, 192.168.0.1/32 (optional) - * @param 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. (optional) - * @param start Filter events with a timestamp greater than the start time, in Unix time (milliseconds). (optional) - * @param end Filter events with a timestamp smaller than the end time, in Unix time (milliseconds). (optional) - * @param reverse Sort events in reverse timestamp order. (optional) - * @param 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. (optional) - * @return ApiResponse<SearchEventsResponse> + * @param searchEventsOptionalParams Object containing optional parameters for API method. (optional) + * @return ApiResponse * @throws ApiException if fails to make API call * @http.response.details @@ -428,7 +562,7 @@ public SearchEventsResponse searchEvents(Integer limit, String visitorId, String
403 Forbidden. Access to this API is denied. -
*/ - public ApiResponse searchEventsWithHttpInfo(Integer limit, String visitorId, String bot, String ipAddress, String linkedId, Long start, Long end, Boolean reverse, Boolean suspect) throws ApiException { + public ApiResponse searchEventsWithHttpInfo(Integer limit, SearchEventsOptionalParams searchEventsOptionalParams) throws ApiException { Object localVarPostBody = null; // verify the required parameter 'limit' is set @@ -448,14 +582,17 @@ public ApiResponse searchEventsWithHttpInfo(Integer limit, localVarQueryParams.add(new Pair("ii", INTEGRATION_INFO)); localVarQueryParams.addAll(apiClient.parameterToPairs("", "limit", limit)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "visitor_id", visitorId)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "bot", bot)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "ip_address", ipAddress)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "linked_id", linkedId)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "start", start)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "end", end)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "reverse", reverse)); - localVarQueryParams.addAll(apiClient.parameterToPairs("", "suspect", suspect)); + if (searchEventsOptionalParams != null) { + 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("", "linked_id", searchEventsOptionalParams.getLinkedId())); + 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())); + } @@ -503,7 +640,7 @@ public void updateEvent(String requestId, EventsUpdateRequest eventsUpdateReques * Change information in existing events specified by `requestId` or *flag suspicious events*. When an event is created, it is assigned `linkedId` and `tag` submitted through the JS agent parameters. This information might not be available on the client so the Server API allows for updating the attributes after the fact. **Warning** It's not possible to update events older than 10 days. * @param requestId The unique event [identifier](https://dev.fingerprint.com/reference/get-function#requestid). (required) * @param eventsUpdateRequest (required) - * @return ApiResponse<Void> + * @return ApiResponse * @throws ApiException if fails to make API call * @http.response.details @@ -579,7 +716,7 @@ public void webhookTrace(Webhook webhook) throws ApiException { * * Fake path to describe webhook format. More information about webhooks can be found in the [documentation](https://dev.fingerprint.com/docs/webhooks) * @param webhook (optional) - * @return ApiResponse<Void> + * @return ApiResponse * @throws ApiException if fails to make API call * @http.response.details
diff --git a/sdk/src/main/java/com/fingerprint/model/Botd.java b/sdk/src/main/java/com/fingerprint/model/Botd.java index a9c9066..849961d 100644 --- a/sdk/src/main/java/com/fingerprint/model/Botd.java +++ b/sdk/src/main/java/com/fingerprint/model/Botd.java @@ -255,7 +255,7 @@ public Botd requestId(String requestId) { } /** - * Unique identifier of the user's request. + * Unique identifier of the user's request. * @return requestId **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/ClonedApp.java b/sdk/src/main/java/com/fingerprint/model/ClonedApp.java index b7b3cb4..c4b31ac 100644 --- a/sdk/src/main/java/com/fingerprint/model/ClonedApp.java +++ b/sdk/src/main/java/com/fingerprint/model/ClonedApp.java @@ -33,7 +33,7 @@ public ClonedApp result(Boolean result) { } /** - * 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 result **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/DeveloperTools.java b/sdk/src/main/java/com/fingerprint/model/DeveloperTools.java index 353cb5e..925222b 100644 --- a/sdk/src/main/java/com/fingerprint/model/DeveloperTools.java +++ b/sdk/src/main/java/com/fingerprint/model/DeveloperTools.java @@ -33,7 +33,7 @@ public DeveloperTools result(Boolean result) { } /** - * `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 result **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/Emulator.java b/sdk/src/main/java/com/fingerprint/model/Emulator.java index df59c86..6c338c8 100644 --- a/sdk/src/main/java/com/fingerprint/model/Emulator.java +++ b/sdk/src/main/java/com/fingerprint/model/Emulator.java @@ -33,7 +33,7 @@ public Emulator result(Boolean result) { } /** - * 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 result **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/FactoryReset.java b/sdk/src/main/java/com/fingerprint/model/FactoryReset.java index 8fcf3b4..221bbc3 100644 --- a/sdk/src/main/java/com/fingerprint/model/FactoryReset.java +++ b/sdk/src/main/java/com/fingerprint/model/FactoryReset.java @@ -64,7 +64,7 @@ public FactoryReset timestamp(Long timestamp) { } /** - * This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. + * This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. * @return timestamp **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/Frida.java b/sdk/src/main/java/com/fingerprint/model/Frida.java index ac72c18..8046dcd 100644 --- a/sdk/src/main/java/com/fingerprint/model/Frida.java +++ b/sdk/src/main/java/com/fingerprint/model/Frida.java @@ -33,7 +33,7 @@ public Frida result(Boolean result) { } /** - * [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 result **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/IPBlocklist.java b/sdk/src/main/java/com/fingerprint/model/IPBlocklist.java index afa3176..6876d3b 100644 --- a/sdk/src/main/java/com/fingerprint/model/IPBlocklist.java +++ b/sdk/src/main/java/com/fingerprint/model/IPBlocklist.java @@ -38,7 +38,7 @@ public IPBlocklist result(Boolean result) { } /** - * `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. + * `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. * @return result **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/Identification.java b/sdk/src/main/java/com/fingerprint/model/Identification.java index a228a1c..cb007f7 100644 --- a/sdk/src/main/java/com/fingerprint/model/Identification.java +++ b/sdk/src/main/java/com/fingerprint/model/Identification.java @@ -105,7 +105,7 @@ public Identification visitorId(String visitorId) { } /** - * String of 20 characters that uniquely identifies the visitor's browser. + * String of 20 characters that uniquely identifies the visitor's browser. * @return visitorId **/ @jakarta.annotation.Nonnull @@ -131,7 +131,7 @@ public Identification requestId(String requestId) { } /** - * Unique identifier of the user's request. + * Unique identifier of the user's request. * @return requestId **/ @jakarta.annotation.Nonnull @@ -289,7 +289,7 @@ public Identification suspect(Boolean suspect) { } /** - * 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://dev.fingerprint.com/reference/updateevent). * @return suspect **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/Incognito.java b/sdk/src/main/java/com/fingerprint/model/Incognito.java index c0869d0..27a6237 100644 --- a/sdk/src/main/java/com/fingerprint/model/Incognito.java +++ b/sdk/src/main/java/com/fingerprint/model/Incognito.java @@ -33,7 +33,7 @@ public Incognito result(Boolean result) { } /** - * `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 result **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/Jailbroken.java b/sdk/src/main/java/com/fingerprint/model/Jailbroken.java index d4bdb0b..bdd67af 100644 --- a/sdk/src/main/java/com/fingerprint/model/Jailbroken.java +++ b/sdk/src/main/java/com/fingerprint/model/Jailbroken.java @@ -33,7 +33,7 @@ public Jailbroken result(Boolean result) { } /** - * 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 result **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/PrivacySettings.java b/sdk/src/main/java/com/fingerprint/model/PrivacySettings.java index a2a0367..6e7a2f0 100644 --- a/sdk/src/main/java/com/fingerprint/model/PrivacySettings.java +++ b/sdk/src/main/java/com/fingerprint/model/PrivacySettings.java @@ -33,7 +33,7 @@ public PrivacySettings result(Boolean result) { } /** - * `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 result **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/Proxy.java b/sdk/src/main/java/com/fingerprint/model/Proxy.java index 309e049..8a91102 100644 --- a/sdk/src/main/java/com/fingerprint/model/Proxy.java +++ b/sdk/src/main/java/com/fingerprint/model/Proxy.java @@ -33,7 +33,7 @@ public Proxy result(Boolean result) { } /** - * `true` if the request IP address is used by a public proxy provider, `false` otherwise. + * `true` if the request IP address is used by a public proxy provider, `false` otherwise. * @return result **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/RemoteControl.java b/sdk/src/main/java/com/fingerprint/model/RemoteControl.java index f5c148b..f8cf6cc 100644 --- a/sdk/src/main/java/com/fingerprint/model/RemoteControl.java +++ b/sdk/src/main/java/com/fingerprint/model/RemoteControl.java @@ -33,7 +33,7 @@ public RemoteControl result(Boolean result) { } /** - * `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. + * `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. * @return result **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/RootApps.java b/sdk/src/main/java/com/fingerprint/model/RootApps.java index bcbad35..c62a481 100644 --- a/sdk/src/main/java/com/fingerprint/model/RootApps.java +++ b/sdk/src/main/java/com/fingerprint/model/RootApps.java @@ -33,7 +33,7 @@ public RootApps result(Boolean result) { } /** - * 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 result **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/SearchEventsResponse.java b/sdk/src/main/java/com/fingerprint/model/SearchEventsResponse.java index 87f3b12..e1c1337 100644 --- a/sdk/src/main/java/com/fingerprint/model/SearchEventsResponse.java +++ b/sdk/src/main/java/com/fingerprint/model/SearchEventsResponse.java @@ -74,11 +74,11 @@ public SearchEventsResponse paginationKey(String paginationKey) { } /** - * Get paginationKey + * Use this value in the `pagination_key` parameter to request the next page of search results. * @return paginationKey **/ @jakarta.annotation.Nullable - @Schema(description = "") + @Schema(description = "Use this value in the `pagination_key` parameter to request the next page of search results.") @JsonProperty(JSON_PROPERTY_PAGINATION_KEY) @JsonInclude(value = JsonInclude.Include.USE_DEFAULTS) diff --git a/sdk/src/main/java/com/fingerprint/model/Tampering.java b/sdk/src/main/java/com/fingerprint/model/Tampering.java index 54084e0..3536ca5 100644 --- a/sdk/src/main/java/com/fingerprint/model/Tampering.java +++ b/sdk/src/main/java/com/fingerprint/model/Tampering.java @@ -41,7 +41,7 @@ public Tampering result(Boolean result) { } /** - * Flag indicating browser tampering was detected. This happens when either of these conditions is true: * There are inconsistencies in the browser configuration that cross our internal tampering thresholds (indicated by `anomalyScore`). * The browser signature resembles one of \"anti-detect\" browsers specifically designed to evade identification and fingerprinting, for example, Incognition (indicated by `antiDetectBrowser`). + * Flag indicating browser tampering was detected. This happens when either of these conditions is true: * There are inconsistencies in the browser configuration that cross our internal tampering thresholds (indicated by `anomalyScore`). * The browser signature resembles one of \"anti-detect\" browsers specifically designed to evade identification and fingerprinting, for example, Incognition (indicated by `antiDetectBrowser`). * @return result **/ @jakarta.annotation.Nonnull @@ -67,7 +67,7 @@ public Tampering anomalyScore(Double anomalyScore) { } /** - * Confidence score (`0.0 - 1.0`) for tampering detection: * Values above `0.5` indicate that there was a tampering attempt. * Values below `0.5` indicate genuine browsers. + * Confidence score (`0.0 - 1.0`) for tampering detection: * Values above `0.5` indicate that there was a tampering attempt. * Values below `0.5` indicate genuine browsers. * minimum: 0 * maximum: 1 * @return anomalyScore @@ -95,7 +95,7 @@ public Tampering antiDetectBrowser(Boolean antiDetectBrowser) { } /** - * Is `true` if the identified browser resembles one of \"anti-detect\" browsers, for example, Incognition. Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. + * Is `true` if the identified browser resembles one of \"anti-detect\" browsers, for example, Incognition. Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. * @return antiDetectBrowser **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/Tor.java b/sdk/src/main/java/com/fingerprint/model/Tor.java index ea041b2..2ad8861 100644 --- a/sdk/src/main/java/com/fingerprint/model/Tor.java +++ b/sdk/src/main/java/com/fingerprint/model/Tor.java @@ -33,7 +33,7 @@ public Tor result(Boolean result) { } /** - * `true` if the request IP address is a known tor exit node, `false` otherwise. + * `true` if the request IP address is a known tor exit node, `false` otherwise. * @return result **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/VPN.java b/sdk/src/main/java/com/fingerprint/model/VPN.java index 2c6bce0..4d86318 100644 --- a/sdk/src/main/java/com/fingerprint/model/VPN.java +++ b/sdk/src/main/java/com/fingerprint/model/VPN.java @@ -129,7 +129,7 @@ public VPN originCountry(String originCountry) { } /** - * 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 originCountry **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/VPNMethods.java b/sdk/src/main/java/com/fingerprint/model/VPNMethods.java index 8dd3d74..99db490 100644 --- a/sdk/src/main/java/com/fingerprint/model/VPNMethods.java +++ b/sdk/src/main/java/com/fingerprint/model/VPNMethods.java @@ -49,7 +49,7 @@ public VPNMethods timezoneMismatch(Boolean timezoneMismatch) { } /** - * The browser timezone doesn't match the timezone inferred from the request IP address. + * The browser timezone doesn't match the timezone inferred from the request IP address. * @return timezoneMismatch **/ @jakarta.annotation.Nonnull @@ -153,7 +153,7 @@ public VPNMethods relay(Boolean relay) { } /** - * 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.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/VelocityIntervals.java b/sdk/src/main/java/com/fingerprint/model/VelocityIntervals.java index 0edb2de..209287c 100644 --- a/sdk/src/main/java/com/fingerprint/model/VelocityIntervals.java +++ b/sdk/src/main/java/com/fingerprint/model/VelocityIntervals.java @@ -93,7 +93,7 @@ public VelocityIntervals _24h(Integer _24h) { } /** - * The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. + * The `24h` interval of `distinctIp`, `distinctLinkedId`, `distinctCountry`, `distinctIpByLinkedId` and `distinctVisitorIdByLinkedId` will be omitted if the number of `events`` for the visitor ID in the last 24 hours (`events.intervals.['24h']`) is higher than 20.000. * @return _24h **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/VirtualMachine.java b/sdk/src/main/java/com/fingerprint/model/VirtualMachine.java index 61b237e..9baee8e 100644 --- a/sdk/src/main/java/com/fingerprint/model/VirtualMachine.java +++ b/sdk/src/main/java/com/fingerprint/model/VirtualMachine.java @@ -33,7 +33,7 @@ public VirtualMachine result(Boolean result) { } /** - * `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 result **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/Visit.java b/sdk/src/main/java/com/fingerprint/model/Visit.java index d2f9a6e..8064c38 100644 --- a/sdk/src/main/java/com/fingerprint/model/Visit.java +++ b/sdk/src/main/java/com/fingerprint/model/Visit.java @@ -97,7 +97,7 @@ public Visit requestId(String requestId) { } /** - * Unique identifier of the user's request. + * Unique identifier of the user's request. * @return requestId **/ @jakarta.annotation.Nonnull diff --git a/sdk/src/main/java/com/fingerprint/model/VisitorsGetResponse.java b/sdk/src/main/java/com/fingerprint/model/VisitorsGetResponse.java index ebec7af..37b819c 100644 --- a/sdk/src/main/java/com/fingerprint/model/VisitorsGetResponse.java +++ b/sdk/src/main/java/com/fingerprint/model/VisitorsGetResponse.java @@ -105,7 +105,7 @@ public VisitorsGetResponse lastTimestamp(Long lastTimestamp) { } /** - * ⚠️ Deprecated paging attribute, please use `paginationKey` instead. Timestamp of the last visit in the current page of results. + * ⚠️ Deprecated paging attribute, please use `paginationKey` instead. Timestamp of the last visit in the current page of results. * @return lastTimestamp * @deprecated **/ @@ -133,7 +133,7 @@ public VisitorsGetResponse paginationKey(String paginationKey) { } /** - * Request ID of the last visit in the current page of results. Use this value in the following request as the `paginationKey` parameter to get the next page of results. + * Request ID of the last visit in the current page of results. Use this value in the following request as the `paginationKey` parameter to get the next page of results. * @return paginationKey **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/Webhook.java b/sdk/src/main/java/com/fingerprint/model/Webhook.java index f66d5b0..ffdfb20 100644 --- a/sdk/src/main/java/com/fingerprint/model/Webhook.java +++ b/sdk/src/main/java/com/fingerprint/model/Webhook.java @@ -218,7 +218,7 @@ public Webhook requestId(String requestId) { } /** - * Unique identifier of the user's request. + * Unique identifier of the user's request. * @return requestId **/ @jakarta.annotation.Nonnull @@ -436,7 +436,7 @@ public Webhook visitorId(String visitorId) { } /** - * String of 20 characters that uniquely identifies the visitor's browser. + * String of 20 characters that uniquely identifies the visitor's browser. * @return visitorId **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/WebhookClonedApp.java b/sdk/src/main/java/com/fingerprint/model/WebhookClonedApp.java index b6bac47..cd48973 100644 --- a/sdk/src/main/java/com/fingerprint/model/WebhookClonedApp.java +++ b/sdk/src/main/java/com/fingerprint/model/WebhookClonedApp.java @@ -33,7 +33,7 @@ public WebhookClonedApp result(Boolean result) { } /** - * 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 result **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/WebhookDeveloperTools.java b/sdk/src/main/java/com/fingerprint/model/WebhookDeveloperTools.java index ab70555..5fcda1a 100644 --- a/sdk/src/main/java/com/fingerprint/model/WebhookDeveloperTools.java +++ b/sdk/src/main/java/com/fingerprint/model/WebhookDeveloperTools.java @@ -33,7 +33,7 @@ public WebhookDeveloperTools result(Boolean result) { } /** - * `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 result **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/WebhookEmulator.java b/sdk/src/main/java/com/fingerprint/model/WebhookEmulator.java index 4ecc39c..ed994f1 100644 --- a/sdk/src/main/java/com/fingerprint/model/WebhookEmulator.java +++ b/sdk/src/main/java/com/fingerprint/model/WebhookEmulator.java @@ -33,7 +33,7 @@ public WebhookEmulator result(Boolean result) { } /** - * 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 result **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/WebhookFactoryReset.java b/sdk/src/main/java/com/fingerprint/model/WebhookFactoryReset.java index 6b83180..4fbc15f 100644 --- a/sdk/src/main/java/com/fingerprint/model/WebhookFactoryReset.java +++ b/sdk/src/main/java/com/fingerprint/model/WebhookFactoryReset.java @@ -64,7 +64,7 @@ public WebhookFactoryReset timestamp(Long timestamp) { } /** - * This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. + * This field is just another representation of the value in the `time` field. The time of the most recent factory reset that happened on the **mobile device** is expressed as Unix epoch time. * @return timestamp **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/WebhookFrida.java b/sdk/src/main/java/com/fingerprint/model/WebhookFrida.java index 958411b..e382ca9 100644 --- a/sdk/src/main/java/com/fingerprint/model/WebhookFrida.java +++ b/sdk/src/main/java/com/fingerprint/model/WebhookFrida.java @@ -33,7 +33,7 @@ public WebhookFrida result(Boolean result) { } /** - * [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 result **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/WebhookIPBlocklist.java b/sdk/src/main/java/com/fingerprint/model/WebhookIPBlocklist.java index 8d7dc0d..df2bddc 100644 --- a/sdk/src/main/java/com/fingerprint/model/WebhookIPBlocklist.java +++ b/sdk/src/main/java/com/fingerprint/model/WebhookIPBlocklist.java @@ -38,7 +38,7 @@ public WebhookIPBlocklist result(Boolean result) { } /** - * `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. + * `true` if request IP address is part of any database that we use to search for known malicious actors, `false` otherwise. * @return result **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/WebhookJailbroken.java b/sdk/src/main/java/com/fingerprint/model/WebhookJailbroken.java index 784d495..8a8ec33 100644 --- a/sdk/src/main/java/com/fingerprint/model/WebhookJailbroken.java +++ b/sdk/src/main/java/com/fingerprint/model/WebhookJailbroken.java @@ -33,7 +33,7 @@ public WebhookJailbroken result(Boolean result) { } /** - * 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 result **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/WebhookPrivacySettings.java b/sdk/src/main/java/com/fingerprint/model/WebhookPrivacySettings.java index 72ea8ac..976d6fe 100644 --- a/sdk/src/main/java/com/fingerprint/model/WebhookPrivacySettings.java +++ b/sdk/src/main/java/com/fingerprint/model/WebhookPrivacySettings.java @@ -33,7 +33,7 @@ public WebhookPrivacySettings result(Boolean result) { } /** - * `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 result **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/WebhookProxy.java b/sdk/src/main/java/com/fingerprint/model/WebhookProxy.java index 91a52e5..2435cfc 100644 --- a/sdk/src/main/java/com/fingerprint/model/WebhookProxy.java +++ b/sdk/src/main/java/com/fingerprint/model/WebhookProxy.java @@ -33,7 +33,7 @@ public WebhookProxy result(Boolean result) { } /** - * `true` if the request IP address is used by a public proxy provider, `false` otherwise. + * `true` if the request IP address is used by a public proxy provider, `false` otherwise. * @return result **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/WebhookRemoteControl.java b/sdk/src/main/java/com/fingerprint/model/WebhookRemoteControl.java index 8a64e42..c5327b7 100644 --- a/sdk/src/main/java/com/fingerprint/model/WebhookRemoteControl.java +++ b/sdk/src/main/java/com/fingerprint/model/WebhookRemoteControl.java @@ -33,7 +33,7 @@ public WebhookRemoteControl result(Boolean result) { } /** - * `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. + * `true` if the request came from a machine being remotely controlled (e.g. TeamViewer), `false` otherwise. * @return result **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/WebhookRootApps.java b/sdk/src/main/java/com/fingerprint/model/WebhookRootApps.java index 4f3f322..0afe2f2 100644 --- a/sdk/src/main/java/com/fingerprint/model/WebhookRootApps.java +++ b/sdk/src/main/java/com/fingerprint/model/WebhookRootApps.java @@ -33,7 +33,7 @@ public WebhookRootApps result(Boolean result) { } /** - * 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 result **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/WebhookTampering.java b/sdk/src/main/java/com/fingerprint/model/WebhookTampering.java index 27646c8..3b14f05 100644 --- a/sdk/src/main/java/com/fingerprint/model/WebhookTampering.java +++ b/sdk/src/main/java/com/fingerprint/model/WebhookTampering.java @@ -41,7 +41,7 @@ public WebhookTampering result(Boolean result) { } /** - * Flag indicating browser tampering was detected. This happens when either of these conditions is true: * There are inconsistencies in the browser configuration that cross our internal tampering thresholds (indicated by `anomalyScore`). * The browser signature resembles one of \"anti-detect\" browsers specifically designed to evade identification and fingerprinting, for example, Incognition (indicated by `antiDetectBrowser`). + * Flag indicating browser tampering was detected. This happens when either of these conditions is true: * There are inconsistencies in the browser configuration that cross our internal tampering thresholds (indicated by `anomalyScore`). * The browser signature resembles one of \"anti-detect\" browsers specifically designed to evade identification and fingerprinting, for example, Incognition (indicated by `antiDetectBrowser`). * @return result **/ @jakarta.annotation.Nullable @@ -67,7 +67,7 @@ public WebhookTampering anomalyScore(Double anomalyScore) { } /** - * Confidence score (`0.0 - 1.0`) for tampering detection: * Values above `0.5` indicate that there was a tampering attempt * Values below `0.5` indicate genuine browsers. + * Confidence score (`0.0 - 1.0`) for tampering detection: * Values above `0.5` indicate that there was a tampering attempt * Values below `0.5` indicate genuine browsers. * minimum: 0 * maximum: 1 * @return anomalyScore @@ -95,7 +95,7 @@ public WebhookTampering antiDetectBrowser(Boolean antiDetectBrowser) { } /** - * Is `true` if the identified browser resembles one of \"anti-detect\" browsers, for example, Incognition. Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. + * Is `true` if the identified browser resembles one of \"anti-detect\" browsers, for example, Incognition. Anti-detect browsers try to evade identification by masking or manipulating their fingerprint to imitate legitimate browser configurations. * @return antiDetectBrowser **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/WebhookTor.java b/sdk/src/main/java/com/fingerprint/model/WebhookTor.java index 9e6c64b..72dc8ee 100644 --- a/sdk/src/main/java/com/fingerprint/model/WebhookTor.java +++ b/sdk/src/main/java/com/fingerprint/model/WebhookTor.java @@ -33,7 +33,7 @@ public WebhookTor result(Boolean result) { } /** - * `true` if the request IP address is a known tor exit node, `false` otherwise. + * `true` if the request IP address is a known tor exit node, `false` otherwise. * @return result **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/WebhookVPN.java b/sdk/src/main/java/com/fingerprint/model/WebhookVPN.java index fb7b0c2..1bff896 100644 --- a/sdk/src/main/java/com/fingerprint/model/WebhookVPN.java +++ b/sdk/src/main/java/com/fingerprint/model/WebhookVPN.java @@ -129,7 +129,7 @@ public WebhookVPN originCountry(String originCountry) { } /** - * 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 originCountry **/ @jakarta.annotation.Nullable diff --git a/sdk/src/main/java/com/fingerprint/model/WebhookVirtualMachine.java b/sdk/src/main/java/com/fingerprint/model/WebhookVirtualMachine.java index 52333b4..224338b 100644 --- a/sdk/src/main/java/com/fingerprint/model/WebhookVirtualMachine.java +++ b/sdk/src/main/java/com/fingerprint/model/WebhookVirtualMachine.java @@ -33,7 +33,7 @@ public WebhookVirtualMachine result(Boolean result) { } /** - * `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 result **/ @jakarta.annotation.Nullable diff --git a/sdk/src/test/java/com/fingerprint/api/FingerprintApiTest.java b/sdk/src/test/java/com/fingerprint/api/FingerprintApiTest.java index f670f39..4dd183d 100644 --- a/sdk/src/test/java/com/fingerprint/api/FingerprintApiTest.java +++ b/sdk/src/test/java/com/fingerprint/api/FingerprintApiTest.java @@ -521,7 +521,7 @@ public void searchEventsMinimumParamsTest() throws ApiException { return mockFileToResponse(200, invocation, "mocks/get_event_search_200.json"); }); - SearchEventsResponse response = api.searchEvents(LIMIT, null, null, null, null, null, null, null, null); + SearchEventsResponse response = api.searchEvents(LIMIT, null); List events = response.getEvents(); assertEquals(events.size(), 1); @@ -558,6 +558,7 @@ public void searchEventsMinimumParamsTest() throws ApiException { @Test public void searchEventsMaximumParamsTest() throws ApiException { final int LIMIT = 1; + final String PAGINATION_KEY = "1741187431959"; final String BOT = "good"; final String IP_ADDRESS = "192.168.0.1/32"; final String LINKED_ID = "some_id"; @@ -568,8 +569,9 @@ public void searchEventsMaximumParamsTest() throws ApiException { addMock("searchEvents", null, invocation -> { List queryParams = invocation.getArgument(3); - assertEquals(10, queryParams.size()); + assertEquals(11, queryParams.size()); assertTrue(listContainsPair(queryParams, "limit", String.valueOf(LIMIT))); + assertTrue(listContainsPair(queryParams, "pagination_key", PAGINATION_KEY)); assertTrue(listContainsPair(queryParams, "visitor_id", MOCK_VISITOR_ID)); assertTrue(listContainsPair(queryParams, "bot", BOT)); assertTrue(listContainsPair(queryParams, "ip_address", IP_ADDRESS)); @@ -582,7 +584,13 @@ public void searchEventsMaximumParamsTest() throws ApiException { return mockFileToResponse(200, invocation, "mocks/get_event_search_200.json"); }); - SearchEventsResponse response = api.searchEvents(LIMIT, MOCK_VISITOR_ID, BOT, IP_ADDRESS, LINKED_ID, START, END, REVERSE, SUSPECT); + SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams() + .setPaginationKey(PAGINATION_KEY) + .setVisitorId(MOCK_VISITOR_ID) + .setBot(BOT).setIpAddress(IP_ADDRESS) + .setLinkedId(LINKED_ID).setStart(START) + .setEnd(END).setReverse(REVERSE) + .setSuspect(SUSPECT)); List events = response.getEvents(); assertEquals(events.size(), 1); } @@ -599,7 +607,7 @@ public void searchEvents400ErrorTest() throws ApiException, JsonProcessingExcept }); ApiException exception = assertThrows(ApiException.class, - () -> api.searchEvents(LIMIT, null, null, null, null, null, null, null, null)); + () -> api.searchEvents(LIMIT, null)); assertEquals(400, exception.getCode()); ErrorResponse response = MAPPER.readValue(exception.getResponseBody(), ErrorResponse.class); @@ -619,7 +627,7 @@ public void searchEvents403ErrorTest() throws ApiException, JsonProcessingExcept }); ApiException exception = assertThrows(ApiException.class, - () -> api.searchEvents(LIMIT, null, null, null, null, null, null, null, null)); + () -> api.searchEvents(LIMIT, null)); assertEquals(403, exception.getCode()); ErrorResponse response = MAPPER.readValue(exception.getResponseBody(), ErrorResponse.class); diff --git a/template/README.mustache b/template/README.mustache index a9060ea..1e6f5f7 100644 --- a/template/README.mustache +++ b/template/README.mustache @@ -182,14 +182,16 @@ public class FingerprintApiExample { // Search events with custom filters try { // By visitorId - EventsGetResponse response = api.searchEvents(LIMIT, FPJS_VISITOR_ID, null, null, null, null, null, null, null); + SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setVisitorId(FPJS_VISITOR_ID)); + // Next page + // SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setPaginationKey(response.getPaginationKey()).setVisitorId(FPJS_VISITOR_ID)); // Bad bot - // EventsGetResponse response = api.searchEvents(LIMIT, null, "bad", null, null, null, null, null, null); + // SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setBot("bad")); // Filtered by IP - // EventsGetResponse response = api.searchEvents(LIMIT, null, null, "192.168.0.1/32", null, null, null, null, null); - System.out.println(response.getProducts().toString()); + // SearchEventsResponse response = api.searchEvents(LIMIT, new FingerprintApi.SearchEventsOptionalParams().setIpAddress("192.168.0.1/32")); + System.out.println(response.getEvents().toString()); } catch (ApiException e) { - System.err.println("Exception when calling FingerprintApi.getEvent:" + e.getMessage()); + System.err.println("Exception when calling FingerprintApi.searchEvents:" + e.getMessage()); } // Update an event with a given requestId diff --git a/template/libraries/jersey3/api.mustache b/template/libraries/jersey3/api.mustache index bf7b1af..a57b05f 100644 --- a/template/libraries/jersey3/api.mustache +++ b/template/libraries/jersey3/api.mustache @@ -60,13 +60,55 @@ public class {{classname}} { } {{#operation}} - {{^vendorExtensions.x-group-parameters}} + {{^vendorExtensions.x-flatten-optional-params}} + {{#hasOptionalParams}} + public static class {{operationIdCamelCase}}OptionalParams { + {{#allParams}} + {{^required}}private {{{dataType}}} {{paramName}};{{/required}} + {{/allParams}} + + {{#allParams}} + {{^required}} + /** + * getter for {{paramName}} - {{{description}}} + */ + public {{{dataType}}} get{{#lambda.titlecase}}{{paramName}}{{/lambda.titlecase}}() { + return {{paramName}}; + } + + /** + * setter for {{paramName}} - {{{description}}} + */ + public {{operationIdCamelCase}}OptionalParams set{{#lambda.titlecase}}{{paramName}}{{/lambda.titlecase}}({{{dataType}}} {{paramName}}) { + this.{{paramName}} = {{paramName}}; + return this; + } + + {{/required}} + {{/allParams}} + } + {{/hasOptionalParams}} + {{/vendorExtensions.x-flatten-optional-params}} /** * {{summary}} * {{{notes}}} + {{^vendorExtensions.x-flatten-optional-params}} + {{#allParams}} + {{#required}} + * @param {{paramName}} {{{description}}} (required) + {{/required}} + {{/allParams}} + {{/vendorExtensions.x-flatten-optional-params}} + {{#vendorExtensions.x-flatten-optional-params}} {{#allParams}} * @param {{paramName}} {{{description}}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} + {{/vendorExtensions.x-flatten-optional-params}} + {{^vendorExtensions.x-flatten-optional-params}} + {{#hasOptionalParams}} + * @param {{operationId}}OptionalParams Object containing optional parameters for API method. (optional) + {{/hasOptionalParams}} + {{/vendorExtensions.x-flatten-optional-params}} {{#returnType}} * @return {{.}} {{/returnType}} @@ -91,19 +133,38 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} + {{^vendorExtensions.x-flatten-optional-params}} + public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{{operationIdCamelCase}}OptionalParams {{operationId}}OptionalParams{{/hasOptionalParams}}) throws ApiException { + {{#returnType}}return {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{#required}}{{paramName}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{{operationId}}OptionalParams{{/hasOptionalParams}}){{#returnType}}.getData(){{/returnType}}; + } + {{/vendorExtensions.x-flatten-optional-params}} + {{#vendorExtensions.x-flatten-optional-params}} public {{#returnType}}{{{.}}} {{/returnType}}{{^returnType}}void {{/returnType}}{{operationId}}({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { {{#returnType}}return {{/returnType}}{{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}){{#returnType}}.getData(){{/returnType}}; } - {{/vendorExtensions.x-group-parameters}} + {{/vendorExtensions.x-flatten-optional-params}} - {{^vendorExtensions.x-group-parameters}} /** * {{summary}} * {{{notes}}} + {{^vendorExtensions.x-flatten-optional-params}} + {{#allParams}} + {{#required}} + * @param {{paramName}} {{{description}}} (required) + {{/required}} + {{/allParams}} + {{/vendorExtensions.x-flatten-optional-params}} + {{#vendorExtensions.x-flatten-optional-params}} {{#allParams}} * @param {{paramName}} {{{description}}}{{#required}} (required){{/required}}{{^required}} (optional{{#defaultValue}}, default to {{.}}{{/defaultValue}}){{/required}} {{/allParams}} - * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> + {{/vendorExtensions.x-flatten-optional-params}} + {{^vendorExtensions.x-flatten-optional-params}} + {{#hasOptionalParams}} + * @param {{operationId}}OptionalParams Object containing optional parameters for API method. (optional) + {{/hasOptionalParams}} + {{/vendorExtensions.x-flatten-optional-params}} + * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> * @throws ApiException if fails to make API call {{#responses.0}} * @http.response.details @@ -125,7 +186,12 @@ public class {{classname}} { {{#isDeprecated}} @Deprecated {{/isDeprecated}} - public{{/vendorExtensions.x-group-parameters}}{{#vendorExtensions.x-group-parameters}}private{{/vendorExtensions.x-group-parameters}} ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + {{^vendorExtensions.x-flatten-optional-params}} + public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{#required}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{{operationIdCamelCase}}OptionalParams {{operationId}}OptionalParams{{/hasOptionalParams}}) throws ApiException { + {{/vendorExtensions.x-flatten-optional-params}} + {{#vendorExtensions.x-flatten-optional-params}} + public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> {{operationId}}WithHttpInfo({{#allParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) throws ApiException { + {{/vendorExtensions.x-flatten-optional-params}} Object localVarPostBody = {{#bodyParam}}{{paramName}}{{/bodyParam}}{{^bodyParam}}null{{/bodyParam}}; {{#allParams}}{{#required}} // verify the required parameter '{{paramName}}' is set @@ -145,9 +211,27 @@ public class {{classname}} { localVarQueryParams.add(new Pair("ii", INTEGRATION_INFO)); + {{^vendorExtensions.x-flatten-optional-params}} {{#queryParams}} + {{#required}} localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); + {{/required}} + {{/queryParams}} + {{#hasOptionalParams}} + if ({{operationId}}OptionalParams != null) { + {{#queryParams}} + {{^required}} + localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{operationId}}OptionalParams.get{{#lambda.titlecase}}{{paramName}}{{/lambda.titlecase}}())); + {{/required}} {{/queryParams}} + } + {{/hasOptionalParams}} + {{/vendorExtensions.x-flatten-optional-params}} + {{#vendorExtensions.x-flatten-optional-params}} + {{#queryParams}} + localVarQueryParams.addAll(apiClient.parameterToPairs("{{{collectionFormat}}}", "{{baseName}}", {{paramName}})); + {{/queryParams}} + {{/vendorExtensions.x-flatten-optional-params}} {{#headerParams}}if ({{paramName}} != null) localVarHeaderParams.put("{{baseName}}", apiClient.parameterToString({{paramName}})); @@ -181,94 +265,6 @@ public class {{classname}} { localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, {{#returnType}}localVarReturnType{{/returnType}}{{^returnType}}null{{/returnType}}, {{#bodyParam}}{{#isNullable}}true{{/isNullable}}{{^isNullable}}false{{/isNullable}}{{/bodyParam}}{{^bodyParam}}false{{/bodyParam}}); } - {{#vendorExtensions.x-group-parameters}} - - public class API{{operationId}}Request { - {{#allParams}} - private {{{dataType}}} {{paramName}}; - {{/allParams}} - - private API{{operationId}}Request({{#pathParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) { - {{#pathParams}} - this.{{paramName}} = {{paramName}}; - {{/pathParams}} - } - {{#allParams}} - {{^isPathParam}} - - /** - * Set {{paramName}} - * @param {{paramName}} {{{description}}} ({{^required}}optional{{^isContainer}}{{#defaultValue}}, default to {{.}}{{/defaultValue}}{{/isContainer}}{{/required}}{{#required}}required{{/required}}) - * @return API{{operationId}}Request - */ - public API{{operationId}}Request {{paramName}}({{{dataType}}} {{paramName}}) { - this.{{paramName}} = {{paramName}}; - return this; - } - {{/isPathParam}} - {{/allParams}} - - /** - * Execute {{operationId}} request - {{#returnType}}* @return {{.}}{{/returnType}} - * @throws ApiException if fails to make API call - {{#responses.0}} - * @http.response.details -
- - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{{description}}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}}* @deprecated{{/isDeprecated}} - */ - {{#isDeprecated}}@Deprecated{{/isDeprecated}} - public {{{returnType}}}{{^returnType}}void{{/returnType}} execute() throws ApiException { - {{#returnType}}return {{/returnType}}this.executeWithHttpInfo().getData(); - } - - /** - * Execute {{operationId}} request with HTTP info returned - * @return ApiResponse<{{returnType}}{{^returnType}}Void{{/returnType}}> - * @throws ApiException if fails to make API call - {{#responses.0}} - * @http.response.details - - - {{#responses}} - - {{/responses}} -
Status Code Description Response Headers
{{code}} {{message}} {{#headers}} * {{baseName}} - {{{description}}}
{{/headers}}{{^headers.0}} - {{/headers.0}}
- {{/responses.0}} - {{#isDeprecated}} - * @deprecated{{/isDeprecated}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public ApiResponse<{{{returnType}}}{{^returnType}}Void{{/returnType}}> executeWithHttpInfo() throws ApiException { - return {{operationId}}WithHttpInfo({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}); - } - } - - /** - * {{summary}} - * {{{notes}}}{{#pathParams}} - * @param {{paramName}} {{{description}}} (required){{/pathParams}} - * @return {{operationId}}Request - * @throws ApiException if fails to make API call - {{#isDeprecated}}* @deprecated{{/isDeprecated}} - {{#externalDocs}}* {{{description}}} - * @see {{summary}} Documentation{{/externalDocs}} - */ - {{#isDeprecated}} - @Deprecated - {{/isDeprecated}} - public API{{operationId}}Request {{operationId}}({{#pathParams}}{{{dataType}}} {{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}) throws ApiException { - return new API{{operationId}}Request({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}); - } - {{/vendorExtensions.x-group-parameters}} {{/operation}} } {{/operations}} diff --git a/template/libraries/jersey3/api_doc.mustache b/template/libraries/jersey3/api_doc.mustache index 08bdf35..8896d9d 100644 --- a/template/libraries/jersey3/api_doc.mustache +++ b/template/libraries/jersey3/api_doc.mustache @@ -14,12 +14,12 @@ All URIs are relative to *{{basePath}}* ## {{operationId}} -{{^vendorExtensions.x-group-parameters}} +{{#vendorExtensions.x-flatten-optional-params}} > {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{paramName}}{{^-last}}, {{/-last}}{{/allParams}}) -{{/vendorExtensions.x-group-parameters}} -{{#vendorExtensions.x-group-parameters}} -> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#pathParams}}{{paramName}}{{^-last}}, {{/-last}}{{/pathParams}}){{#allParams}}{{^isPathParam}}.{{paramName}}({{paramName}}){{/isPathParam}}{{/allParams}}.execute(); -{{/vendorExtensions.x-group-parameters}} +{{/vendorExtensions.x-flatten-optional-params}} +{{^vendorExtensions.x-flatten-optional-params}} +> {{#returnType}}{{.}} {{/returnType}}{{operationId}}({{#allParams}}{{#required}}{{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}{{operationId}}OptionalParams{{/hasOptionalParams}}) +{{/vendorExtensions.x-flatten-optional-params}} {{summary}}{{#notes}} @@ -53,15 +53,23 @@ public class FingerprintApiExample { Region.ASIA */ ApiClient client = Configuration.getDefaultApiClient(FPJS_API_SECRET, Region.EUROPE); - FingerprintApi api = new FingerprintApi(client); + {{classname}} api = new {{classname}}(client); {{#allParams}} {{{dataType}}} {{{paramName}}} = {{{example}}}; // {{{dataType}}} | {{{description}}} {{/allParams}} try { - {{#returnType}}{{{returnType}}} result = {{/returnType}}apiInstance.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}});{{#returnType}} - System.out.println(result);{{/returnType}} + {{^vendorExtensions.x-flatten-optional-params}} + {{#returnType}}{{{returnType}}} result = {{/returnType}}api.{{{operationId}}}({{#allParams}}{{#required}}{{{paramName}}}{{^-last}}, {{/-last}}{{/required}}{{/allParams}}{{#hasOptionalParams}}new FingerprintApi.{{operationIdCamelCase}}OptionalParams(){{#allParams}}{{^required}} + .set{{#lambda.titlecase}}{{paramName}}{{/lambda.titlecase}}({{{paramName}}}){{/required}}{{/allParams}}{{/hasOptionalParams}}); + {{/vendorExtensions.x-flatten-optional-params}} + {{#vendorExtensions.x-flatten-optional-params}} + {{#returnType}}{{{returnType}}} result = {{/returnType}}api.{{{operationId}}}({{#allParams}}{{{paramName}}}{{^-last}}, {{/-last}}{{/allParams}}); + {{/vendorExtensions.x-flatten-optional-params}} + {{#returnType}} + System.out.println(result); + {{/returnType}} } catch (ApiException e) { - System.err.println("Exception when calling FingerprintApi.{{{operationId}}}:" + e.getMessage()); + System.err.println("Exception when calling {{classname}}.{{{operationId}}}:" + e.getMessage()); } } } @@ -73,9 +81,22 @@ public class FingerprintApiExample { {{^allParams}}This endpoint does not need any parameter.{{/allParams}}{{#allParams}}{{#-last}} | Name | Type | Description | Notes | |------------- | ------------- | ------------- | -------------|{{/-last}}{{/allParams}} +{{#vendorExtensions.x-flatten-optional-params}} {{#allParams}}| **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{{description}}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | {{/allParams}} +{{/vendorExtensions.x-flatten-optional-params}} +{{^vendorExtensions.x-flatten-optional-params}} +{{#allParams}}{{#required}}| **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{{description}}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | +{{/required}}{{/allParams}}{{#hasOptionalParams}}| **{{operationId}}OptionalParams** | [**{{classname}}.{{operationIdCamelCase}}OptionalParams**](#{{#lambda.lowercase}}{{classname}}{{operationId}}OptionalParams{{/lambda.lowercase}}) | | [optional] | +#### {{classname}}.{{operationIdCamelCase}}OptionalParams + +Object containing optional parameters for API method. Supports a fluent interface for convenient method chaining. + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +{{#allParams}}{{^required}}| **{{paramName}}** | {{#isContainer}}{{#isArray}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**List<{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isArray}}{{#isMap}}{{#items}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**Map<String,{{dataType}}>**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/items}}{{/isMap}}{{/isContainer}}{{^isContainer}}{{#isModel}}{{^isFile}}[{{/isFile}}{{/isModel}}**{{dataType}}**{{#isModel}}{{^isFile}}]({{^baseType}}{{dataType}}{{/baseType}}{{baseType}}.md){{/isFile}}{{/isModel}}{{/isContainer}}| {{{description}}} |{{^required}} [optional]{{/required}}{{^isContainer}}{{#defaultValue}} [default to {{.}}]{{/defaultValue}}{{/isContainer}}{{#allowableValues}} [enum: {{#values}}{{{.}}}{{^-last}}, {{/-last}}{{/values}}]{{/allowableValues}} | +{{/required}}{{/allParams}}{{/hasOptionalParams}}{{/vendorExtensions.x-flatten-optional-params}} ### Return type {{#returnType}}{{#returnTypeIsPrimitive}}**{{returnType}}**{{/returnTypeIsPrimitive}}{{^returnTypeIsPrimitive}}[**{{returnType}}**]({{returnBaseType}}.md){{/returnTypeIsPrimitive}}{{/returnType}}{{^returnType}}null (empty response body){{/returnType}} diff --git a/template/pojo.mustache b/template/pojo.mustache index a928e4b..dfcb001 100644 --- a/template/pojo.mustache +++ b/template/pojo.mustache @@ -180,7 +180,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens {{/isReadOnly}} /** {{#description}} - * {{.}} + * {{{.}}} {{/description}} {{^description}} * Get {{name}}