From 211421deca65fa0f66be400e7c0d5589cbe951d0 Mon Sep 17 00:00:00 2001 From: TheUnderScorer Date: Mon, 16 Dec 2024 13:33:54 +0000 Subject: [PATCH 1/5] feat: update OpenAPI schema --- .changeset/forty-seas-prove.md | 5 + .changeset/orange-poets-drive.md | 5 + README.md | 3 + docs/FingerprintApi.md | 87 +++++++++++++++ docs/RelatedVisitor.md | 13 +++ docs/RelatedVisitorsResponse.md | 13 +++ res/fingerprint-server-api.yaml | 91 +++++++++++++++ .../com/fingerprint/api/FingerprintApi.java | 79 +++++++++++++ .../com/fingerprint/model/RelatedVisitor.java | 97 ++++++++++++++++ .../model/RelatedVisitorsResponse.java | 105 ++++++++++++++++++ 10 files changed, 498 insertions(+) create mode 100644 .changeset/forty-seas-prove.md create mode 100644 .changeset/orange-poets-drive.md create mode 100644 docs/RelatedVisitor.md create mode 100644 docs/RelatedVisitorsResponse.md create mode 100644 sdk/src/main/java/com/fingerprint/model/RelatedVisitor.java create mode 100644 sdk/src/main/java/com/fingerprint/model/RelatedVisitorsResponse.java diff --git a/.changeset/forty-seas-prove.md b/.changeset/forty-seas-prove.md new file mode 100644 index 0000000..4f10093 --- /dev/null +++ b/.changeset/forty-seas-prove.md @@ -0,0 +1,5 @@ +--- +'fingerprint-pro-server-api-java-sdk': minor +--- + +Add `relay` detection method to the VPN Detection Smart Signal diff --git a/.changeset/orange-poets-drive.md b/.changeset/orange-poets-drive.md new file mode 100644 index 0000000..c297c6f --- /dev/null +++ b/.changeset/orange-poets-drive.md @@ -0,0 +1,5 @@ +--- +'fingerprint-pro-server-api-java-sdk': minor +--- + +**events**: Add a `suspect` field to the `identification` product schema \ No newline at end of file diff --git a/README.md b/README.md index 3b42016..55aee97 100644 --- a/README.md +++ b/README.md @@ -275,6 +275,7 @@ Class | Method | HTTP request | Description ------------ | ------------- | ------------- | ------------- *FingerprintApi* | [**deleteVisitorData**](docs/FingerprintApi.md#deleteVisitorData) | **DELETE** /visitors/{visitor_id} | Delete data by visitor ID *FingerprintApi* | [**getEvent**](docs/FingerprintApi.md#getEvent) | **GET** /events/{request_id} | Get event by request ID +*FingerprintApi* | [**getRelatedVisitors**](docs/FingerprintApi.md#getRelatedVisitors) | **GET** /related-visitors | Get Related Visitors *FingerprintApi* | [**getVisits**](docs/FingerprintApi.md#getVisits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID *FingerprintApi* | [**updateEvent**](docs/FingerprintApi.md#updateEvent) | **PUT** /events/{request_id} | Update an event with a given request ID *FingerprintApi* | [**webhookTrace**](docs/FingerprintApi.md#webhookTrace) | **TRACE** /webhook | @@ -346,6 +347,8 @@ Class | Method | HTTP request | Description - [Proxy](docs/Proxy.md) - [RawDeviceAttribute](docs/RawDeviceAttribute.md) - [RawDeviceAttributeError](docs/RawDeviceAttributeError.md) + - [RelatedVisitor](docs/RelatedVisitor.md) + - [RelatedVisitorsResponse](docs/RelatedVisitorsResponse.md) - [RemoteControl](docs/RemoteControl.md) - [RootApps](docs/RootApps.md) - [SuspectScore](docs/SuspectScore.md) diff --git a/docs/FingerprintApi.md b/docs/FingerprintApi.md index 87f0444..2445459 100644 --- a/docs/FingerprintApi.md +++ b/docs/FingerprintApi.md @@ -6,6 +6,7 @@ All URIs are relative to *https://api.fpjs.io* |------------- | ------------- | -------------| | [**deleteVisitorData**](FingerprintApi.md#deleteVisitorData) | **DELETE** /visitors/{visitor_id} | Delete data by visitor ID | | [**getEvent**](FingerprintApi.md#getEvent) | **GET** /events/{request_id} | Get event by request ID | +| [**getRelatedVisitors**](FingerprintApi.md#getRelatedVisitors) | **GET** /related-visitors | Get Related Visitors | | [**getVisits**](FingerprintApi.md#getVisits) | **GET** /visitors/{visitor_id} | Get visits by visitor ID | | [**updateEvent**](FingerprintApi.md#updateEvent) | **PUT** /events/{request_id} | Update an event with a given request ID | | [**webhookTrace**](FingerprintApi.md#webhookTrace) | **TRACE** /webhook | | @@ -195,6 +196,92 @@ public class FingerprintApiExample { | **404** | Not found. The request ID cannot be found in this application's data. | - | +## getRelatedVisitors + +> RelatedVisitorsResponse getRelatedVisitors(visitorId) + +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). + + +### Example + +```java +package main; + +import com.fingerprint.api.FingerprintApi; +import com.fingerprint.model.EventsGetResponse; +import com.fingerprint.model.EventsUpdateRequest; +import com.fingerprint.model.VisitorsGetResponse; +import com.fingerprint.sdk.ApiClient; +import com.fingerprint.sdk.ApiException; +import com.fingerprint.sdk.Configuration; +import com.fingerprint.sdk.Region; + +public class FingerprintApiExample { + // Fingerprint Pro Secret API Key + private static final String FPJS_API_SECRET = "Fingerprint Pro Secret API Key"; + public static void main(String... args) { + // Create a new api client instance from Configuration with your Fingerprint Pro Server API Key and your Fingerprint Pro Server API Region. + /* + You can specify a region on getDefaultApiClient function's second parameter + If you leave the second parameter empty, then Region.GLOBAL will be used as a default region + Options for regions are: + Region.GLOBAL + Region.EUROPE + Region.ASIA + */ + ApiClient client = Configuration.getDefaultApiClient(FPJS_API_SECRET, Region.EUROPE); + 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); + System.out.println(result); + } catch (ApiException e) { + System.err.println("Exception when calling FingerprintApi.getRelatedVisitors:" + e.getMessage()); + } + } +} +``` + + +### Parameters + + +| Name | Type | Description | Notes | +|------------- | ------------- | ------------- | -------------| +| **visitorId** | **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. | | + +### Return type + +[**RelatedVisitorsResponse**](RelatedVisitorsResponse.md) + +### Authorization + +[ApiKeyHeader](../README.md#ApiKeyHeader), [ApiKeyQuery](../README.md#ApiKeyQuery) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: application/json + +### HTTP response details +| Status code | Description | Response headers | +|-------------|-------------|------------------| +| **200** | OK. | - | +| **400** | Bad request. The visitor ID parameter is missing or in the wrong format. | - | +| **403** | Forbidden. Access to this API is denied. | - | +| **404** | Not found. The visitor ID cannot be found in this application's data. | - | +| **429** | Too Many Requests. The request is throttled. | - | + + ## getVisits > VisitorsGetResponse getVisits(visitorId, requestId, linkedId, limit, paginationKey, before) diff --git a/docs/RelatedVisitor.md b/docs/RelatedVisitor.md new file mode 100644 index 0000000..c24f4fc --- /dev/null +++ b/docs/RelatedVisitor.md @@ -0,0 +1,13 @@ + + +# RelatedVisitor + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**visitorId** | **String** | Visitor ID of a browser that originates from the same mobile device as the input visitor ID. | | + + + diff --git a/docs/RelatedVisitorsResponse.md b/docs/RelatedVisitorsResponse.md new file mode 100644 index 0000000..e06e35b --- /dev/null +++ b/docs/RelatedVisitorsResponse.md @@ -0,0 +1,13 @@ + + +# RelatedVisitorsResponse + + +## Properties + +| Name | Type | Description | Notes | +|------------ | ------------- | ------------- | -------------| +|**relatedVisitors** | [**List<RelatedVisitor>**](RelatedVisitor.md) | | | + + + diff --git a/res/fingerprint-server-api.yaml b/res/fingerprint-server-api.yaml index b5eaa9d..af3cc9b 100644 --- a/res/fingerprint-server-api.yaml +++ b/res/fingerprint-server-api.yaml @@ -394,6 +394,76 @@ paths: application/json: schema: $ref: '#/components/schemas/ErrorResponse' + /related-visitors: + get: + tags: + - Fingerprint + operationId: getRelatedVisitors + summary: Get Related Visitors + description: > + 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). + parameters: + - name: visitor_id + in: query + required: true + schema: + type: string + description: >- + 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. + responses: + '200': + description: OK. + content: + application/json: + schema: + $ref: '#/components/schemas/RelatedVisitorsResponse' + '400': + description: >- + Bad request. The visitor ID parameter is missing or in the wrong + format. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '403': + description: Forbidden. Access to this API is denied. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '404': + description: >- + Not found. The visitor ID cannot be found in this application's + data. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' + '429': + description: Too Many Requests. The request is throttled. + content: + application/json: + schema: + $ref: '#/components/schemas/ErrorResponse' /webhook: trace: tags: @@ -1902,6 +1972,27 @@ components: properties: error: type: string + RelatedVisitor: + type: object + additionalProperties: false + required: + - visitorId + properties: + visitorId: + type: string + description: >- + Visitor ID of a browser that originates from the same mobile device + as the input visitor ID. + RelatedVisitorsResponse: + type: object + additionalProperties: false + required: + - relatedVisitors + properties: + relatedVisitors: + type: array + items: + $ref: '#/components/schemas/RelatedVisitor' WebhookRootApps: 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 4c67db4..ea0f18c 100644 --- a/sdk/src/main/java/com/fingerprint/api/FingerprintApi.java +++ b/sdk/src/main/java/com/fingerprint/api/FingerprintApi.java @@ -13,6 +13,7 @@ import com.fingerprint.model.ErrorResponse; import com.fingerprint.model.EventsGetResponse; import com.fingerprint.model.EventsUpdateRequest; +import com.fingerprint.model.RelatedVisitorsResponse; import com.fingerprint.model.VisitorsGetResponse; import com.fingerprint.model.Webhook; @@ -209,6 +210,84 @@ public ApiResponse getEventWithHttpInfo(String requestId) thr localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType, false); } + /** + * 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 RelatedVisitorsResponse + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK. -
400 Bad request. The visitor ID parameter is missing or in the wrong format. -
403 Forbidden. Access to this API is denied. -
404 Not found. The visitor ID cannot be found in this application's data. -
429 Too Many Requests. The request is throttled. -
+ */ + public RelatedVisitorsResponse getRelatedVisitors(String visitorId) throws ApiException { + return getRelatedVisitorsWithHttpInfo(visitorId).getData(); + } + + /** + * 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> + * @throws ApiException if fails to make API call + * @http.response.details + + + + + + + +
Status Code Description Response Headers
200 OK. -
400 Bad request. The visitor ID parameter is missing or in the wrong format. -
403 Forbidden. Access to this API is denied. -
404 Not found. The visitor ID cannot be found in this application's data. -
429 Too Many Requests. The request is throttled. -
+ */ + public ApiResponse getRelatedVisitorsWithHttpInfo(String visitorId) throws ApiException { + Object localVarPostBody = null; + + // verify the required parameter 'visitorId' is set + if (visitorId == null) { + throw new ApiException(400, "Missing the required parameter 'visitorId' when calling getRelatedVisitors"); + } + + // create path and map variables + String localVarPath = "/related-visitors"; + + // query params + List localVarQueryParams = new ArrayList(); + Map localVarHeaderParams = new HashMap(); + Map localVarCookieParams = new HashMap(); + Map localVarFormParams = new HashMap(); + + localVarQueryParams.add(new Pair("ii", INTEGRATION_INFO)); + + localVarQueryParams.addAll(apiClient.parameterToPairs("", "visitor_id", visitorId)); + + + + + final String[] localVarAccepts = { + "application/json" + }; + final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); + + final String[] localVarContentTypes = { + + }; + final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); + + String[] localVarAuthNames = new String[] { "ApiKeyHeader", "ApiKeyQuery" }; + + GenericType localVarReturnType = new GenericType() {}; + + return apiClient.invokeAPI("FingerprintApi.getRelatedVisitors", localVarPath, "GET", localVarQueryParams, localVarPostBody, + localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAccept, localVarContentType, + localVarAuthNames, localVarReturnType, false); + } /** * Get visits by visitor ID * Get a history of visits (identification events) for a specific `visitorId`. Use the `visitorId` as a URL path parameter. Only information from the _Identification_ product is returned. #### Headers * `Retry-After` — Present in case of `429 Too many requests`. Indicates how long you should wait before making a follow-up request. The value is non-negative decimal integer indicating the seconds to delay after the response is received. diff --git a/sdk/src/main/java/com/fingerprint/model/RelatedVisitor.java b/sdk/src/main/java/com/fingerprint/model/RelatedVisitor.java new file mode 100644 index 0000000..c809e0a --- /dev/null +++ b/sdk/src/main/java/com/fingerprint/model/RelatedVisitor.java @@ -0,0 +1,97 @@ +package com.fingerprint.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import java.util.Arrays; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fingerprint.sdk.JSON; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * RelatedVisitor + */ + + +@JsonPropertyOrder({ + RelatedVisitor.JSON_PROPERTY_VISITOR_ID +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class RelatedVisitor { + public static final String JSON_PROPERTY_VISITOR_ID = "visitorId"; + private String visitorId; + + public RelatedVisitor() { + } + + public RelatedVisitor visitorId(String visitorId) { + this.visitorId = visitorId; + return this; + } + + /** + * Visitor ID of a browser that originates from the same mobile device as the input visitor ID. + * @return visitorId + **/ + @jakarta.annotation.Nonnull + @Schema(required = true, description = "Visitor ID of a browser that originates from the same mobile device as the input visitor ID.") + @JsonProperty(JSON_PROPERTY_VISITOR_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public String getVisitorId() { + return visitorId; + } + + + @JsonProperty(JSON_PROPERTY_VISITOR_ID) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setVisitorId(String visitorId) { + this.visitorId = visitorId; + } + + + /** + * Return true if this RelatedVisitor object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelatedVisitor relatedVisitor = (RelatedVisitor) o; + return Objects.equals(this.visitorId, relatedVisitor.visitorId); + } + + @Override + public int hashCode() { + return Objects.hash(visitorId); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelatedVisitor {\n"); + sb.append(" visitorId: ").append(toIndentedString(visitorId)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + diff --git a/sdk/src/main/java/com/fingerprint/model/RelatedVisitorsResponse.java b/sdk/src/main/java/com/fingerprint/model/RelatedVisitorsResponse.java new file mode 100644 index 0000000..30657aa --- /dev/null +++ b/sdk/src/main/java/com/fingerprint/model/RelatedVisitorsResponse.java @@ -0,0 +1,105 @@ +package com.fingerprint.model; + +import java.util.Objects; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.annotation.JsonProperty; +import com.fasterxml.jackson.annotation.JsonCreator; +import com.fasterxml.jackson.annotation.JsonTypeName; +import com.fasterxml.jackson.annotation.JsonValue; +import com.fingerprint.model.RelatedVisitor; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import com.fasterxml.jackson.annotation.JsonPropertyOrder; +import com.fingerprint.sdk.JSON; +import io.swagger.v3.oas.annotations.media.Schema; + +/** + * RelatedVisitorsResponse + */ + + +@JsonPropertyOrder({ + RelatedVisitorsResponse.JSON_PROPERTY_RELATED_VISITORS +}) +@jakarta.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen", comments = "Generator version: 7.7.0") +public class RelatedVisitorsResponse { + public static final String JSON_PROPERTY_RELATED_VISITORS = "relatedVisitors"; + private List relatedVisitors = new ArrayList<>(); + + public RelatedVisitorsResponse() { + } + + public RelatedVisitorsResponse relatedVisitors(List relatedVisitors) { + this.relatedVisitors = relatedVisitors; + return this; + } + + public RelatedVisitorsResponse addrelatedVisitorsItem(RelatedVisitor relatedVisitorsItem) { + this.relatedVisitors.add(relatedVisitorsItem); + return this; + } + + /** + * Get relatedVisitors + * @return relatedVisitors + **/ + @jakarta.annotation.Nonnull + @Schema(required = true, description = "") + @JsonProperty(JSON_PROPERTY_RELATED_VISITORS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + + public List getRelatedVisitors() { + return relatedVisitors; + } + + + @JsonProperty(JSON_PROPERTY_RELATED_VISITORS) + @JsonInclude(value = JsonInclude.Include.ALWAYS) + public void setRelatedVisitors(List relatedVisitors) { + this.relatedVisitors = relatedVisitors; + } + + + /** + * Return true if this RelatedVisitorsResponse object is equal to o. + */ + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + RelatedVisitorsResponse relatedVisitorsResponse = (RelatedVisitorsResponse) o; + return Objects.equals(this.relatedVisitors, relatedVisitorsResponse.relatedVisitors); + } + + @Override + public int hashCode() { + return Objects.hash(relatedVisitors); + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(); + sb.append("class RelatedVisitorsResponse {\n"); + sb.append(" relatedVisitors: ").append(toIndentedString(relatedVisitors)).append("\n"); + sb.append("}"); + return sb.toString(); + } + + /** + * Convert the given object to string with each line indented by 4 spaces + * (except the first line). + */ + private String toIndentedString(Object o) { + if (o == null) { + return "null"; + } + return o.toString().replace("\n", "\n "); + } + +} + From 5d1431e256e418d7c1de3261260f8c875026ce10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Tue, 17 Dec 2024 10:51:58 +0100 Subject: [PATCH 2/5] fix: fix invalid case in models --- .changeset/proud-moles-remain.md | 5 +++++ .../java/com/fingerprint/model/DeprecatedGeolocation.java | 2 +- sdk/src/main/java/com/fingerprint/model/Geolocation.java | 2 +- .../java/com/fingerprint/model/RelatedVisitorsResponse.java | 2 +- .../main/java/com/fingerprint/model/VisitorsGetResponse.java | 2 +- template/pojo.mustache | 2 +- 6 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 .changeset/proud-moles-remain.md diff --git a/.changeset/proud-moles-remain.md b/.changeset/proud-moles-remain.md new file mode 100644 index 0000000..0deb5df --- /dev/null +++ b/.changeset/proud-moles-remain.md @@ -0,0 +1,5 @@ +--- +"fingerprint-pro-server-api-java-sdk": patch +--- + +Fix invalid phrasing for methods that append to lists in the models diff --git a/sdk/src/main/java/com/fingerprint/model/DeprecatedGeolocation.java b/sdk/src/main/java/com/fingerprint/model/DeprecatedGeolocation.java index a2b638f..9d5f59b 100644 --- a/sdk/src/main/java/com/fingerprint/model/DeprecatedGeolocation.java +++ b/sdk/src/main/java/com/fingerprint/model/DeprecatedGeolocation.java @@ -284,7 +284,7 @@ public DeprecatedGeolocation subdivisions(List subdivisi return this; } - public DeprecatedGeolocation addsubdivisionsItem(GeolocationSubdivision subdivisionsItem) { + public DeprecatedGeolocation addGeolocationSubdivisionItem(GeolocationSubdivision subdivisionsItem) { if (this.subdivisions == null) { this.subdivisions = new ArrayList<>(); } diff --git a/sdk/src/main/java/com/fingerprint/model/Geolocation.java b/sdk/src/main/java/com/fingerprint/model/Geolocation.java index 5bb0ac1..99f6cd3 100644 --- a/sdk/src/main/java/com/fingerprint/model/Geolocation.java +++ b/sdk/src/main/java/com/fingerprint/model/Geolocation.java @@ -283,7 +283,7 @@ public Geolocation subdivisions(List subdivisions) { return this; } - public Geolocation addsubdivisionsItem(GeolocationSubdivision subdivisionsItem) { + public Geolocation addGeolocationSubdivisionItem(GeolocationSubdivision subdivisionsItem) { if (this.subdivisions == null) { this.subdivisions = new ArrayList<>(); } diff --git a/sdk/src/main/java/com/fingerprint/model/RelatedVisitorsResponse.java b/sdk/src/main/java/com/fingerprint/model/RelatedVisitorsResponse.java index 30657aa..0fe1e03 100644 --- a/sdk/src/main/java/com/fingerprint/model/RelatedVisitorsResponse.java +++ b/sdk/src/main/java/com/fingerprint/model/RelatedVisitorsResponse.java @@ -35,7 +35,7 @@ public RelatedVisitorsResponse relatedVisitors(List relatedVisit return this; } - public RelatedVisitorsResponse addrelatedVisitorsItem(RelatedVisitor relatedVisitorsItem) { + public RelatedVisitorsResponse addRelatedVisitorItem(RelatedVisitor relatedVisitorsItem) { this.relatedVisitors.add(relatedVisitorsItem); return this; } diff --git a/sdk/src/main/java/com/fingerprint/model/VisitorsGetResponse.java b/sdk/src/main/java/com/fingerprint/model/VisitorsGetResponse.java index be8b2b2..ebec7af 100644 --- a/sdk/src/main/java/com/fingerprint/model/VisitorsGetResponse.java +++ b/sdk/src/main/java/com/fingerprint/model/VisitorsGetResponse.java @@ -73,7 +73,7 @@ public VisitorsGetResponse visits(List visits) { return this; } - public VisitorsGetResponse addvisitsItem(Visit visitsItem) { + public VisitorsGetResponse addVisitItem(Visit visitsItem) { this.visits.add(visitsItem); return this; } diff --git a/template/pojo.mustache b/template/pojo.mustache index ce89dda..a928e4b 100644 --- a/template/pojo.mustache +++ b/template/pojo.mustache @@ -128,7 +128,7 @@ public class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{{#vendorExtens } {{#isArray}} - public {{classname}} add{{nameInCamelCase}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { + public {{classname}} add{{items.datatypeWithEnum}}Item({{{items.datatypeWithEnum}}} {{name}}Item) { {{#vendorExtensions.x-is-jackson-optional-nullable}} if (this.{{name}} == null || !this.{{name}}.isPresent()) { this.{{name}} = JsonNullable.<{{{datatypeWithEnum}}}>of({{{defaultValue}}}); From cabb25eed82438445f07ebf0d924718cf7c7276e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Tue, 17 Dec 2024 10:52:33 +0100 Subject: [PATCH 3/5] chore: remove old changesets --- .changeset/forty-seas-prove.md | 5 ----- .changeset/orange-poets-drive.md | 5 ----- 2 files changed, 10 deletions(-) delete mode 100644 .changeset/forty-seas-prove.md delete mode 100644 .changeset/orange-poets-drive.md diff --git a/.changeset/forty-seas-prove.md b/.changeset/forty-seas-prove.md deleted file mode 100644 index 4f10093..0000000 --- a/.changeset/forty-seas-prove.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'fingerprint-pro-server-api-java-sdk': minor ---- - -Add `relay` detection method to the VPN Detection Smart Signal diff --git a/.changeset/orange-poets-drive.md b/.changeset/orange-poets-drive.md deleted file mode 100644 index c297c6f..0000000 --- a/.changeset/orange-poets-drive.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'fingerprint-pro-server-api-java-sdk': minor ---- - -**events**: Add a `suspect` field to the `identification` product schema \ No newline at end of file From e49248a8337df05f5eb573ddc5f74f88e8f17fed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Tue, 17 Dec 2024 10:52:59 +0100 Subject: [PATCH 4/5] chore: add changeset for related visitors --- .changeset/tame-spiders-drum.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/tame-spiders-drum.md diff --git a/.changeset/tame-spiders-drum.md b/.changeset/tame-spiders-drum.md new file mode 100644 index 0000000..e8d2591 --- /dev/null +++ b/.changeset/tame-spiders-drum.md @@ -0,0 +1,5 @@ +--- +"fingerprint-pro-server-api-java-sdk": minor +--- + +Add Related Visitors API From 9d5e6af4c7f13723e56b580f0e1b3920c139ddf6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20=C5=BBydek?= Date: Tue, 17 Dec 2024 11:04:13 +0100 Subject: [PATCH 5/5] test: add related visitors test --- .../fingerprint/api/FingerprintApiTest.java | 25 +++++++++++++++---- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/sdk/src/test/java/com/fingerprint/api/FingerprintApiTest.java b/sdk/src/test/java/com/fingerprint/api/FingerprintApiTest.java index 56086e0..9b97b11 100644 --- a/sdk/src/test/java/com/fingerprint/api/FingerprintApiTest.java +++ b/sdk/src/test/java/com/fingerprint/api/FingerprintApiTest.java @@ -5,18 +5,16 @@ import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; import com.fingerprint.model.*; -import com.fingerprint.model.Webhook; -import com.fingerprint.sdk.*; +import com.fingerprint.sdk.ApiException; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInstance; +import org.mockito.Mockito; import java.io.IOException; import java.io.InputStream; import java.util.Map; -import org.junit.jupiter.api.TestInstance; -import org.mockito.Mockito; - import static org.junit.jupiter.api.Assertions.*; import static org.mockito.Mockito.when; @@ -63,6 +61,7 @@ public void before() throws ApiException, IOException { when(api.getEvent(MOCK_REQUEST_IDENTIFICATION_MANY_REQUEST)).thenReturn(fetchMockWithEventResponse("mocks/get_event_200_too_many_requests_error.json")); when(api.getVisits(MOCK_VISITOR_ID, MOCK_VISITOR_REQUEST_ID, null, 50, "1683900801733.Ogvu1j", null)).thenReturn(fetchMockVisit()); + when(api.getRelatedVisitors(MOCK_VISITOR_ID)).thenReturn(fetchMockVisitWithRelatedVisitorsResponse("mocks/related-visitors/get_related_visitors_200.json")); } private static ObjectMapper getMapper() { @@ -76,6 +75,14 @@ private EventsGetResponse fetchMockWithEventResponse(String fileName) throws IOE return MAPPER.readValue(getFileAsIOStream(fileName), EventsGetResponse.class); } + private RelatedVisitorsResponse fetchMockVisitWithRelatedVisitorsResponse(String fileName) throws IOException { + return MAPPER.readValue(getFileAsIOStream(fileName), RelatedVisitorsResponse.class); + } + + private ErrorResponse fetchMockErrorResponse(String fileName) throws IOException { + return MAPPER.readValue(getFileAsIOStream(fileName), ErrorResponse.class); + } + private T fetchMock(String filename, Class type) throws IOException { return MAPPER.readValue(getFileAsIOStream(filename), type); } @@ -263,4 +270,12 @@ public void webhookTest() throws Exception { assertEquals(MOCK_WEBHOOK_REQUEST_ID, visit.getRequestId()); } + @Test + public void relatedVisitorsTest() throws Exception { + RelatedVisitorsResponse response = api.getRelatedVisitors(MOCK_VISITOR_ID); + RelatedVisitorsResponse mock = fetchMockVisitWithRelatedVisitorsResponse("mocks/related-visitors/get_related_visitors_200.json"); + + assertEquals(response, mock); + } + }