Skip to content

Commit

Permalink
Merge pull request #24 from fingerprintjs/INTER-481-fixed-datacenter-…
Browse files Browse the repository at this point in the history
…name

Use `datacenter` field for the `IpInfo` signal instead of the wrong `dataCenter`, deprecate `IPLocation`
  • Loading branch information
ilfa authored Jan 12, 2024
2 parents c8fed71 + ede238f commit 7048436
Show file tree
Hide file tree
Showing 18 changed files with 460 additions and 48 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

# Fingerprint Pro Server API Java SDK

[Fingerprint](https://fingerprint.com/) is a device intelligence platform offering 99.5% accurate visitor identification. The Fingerprint Server Java SDK is an easy way to interact with the Fingerprint [Server API](https://dev.fingerprint.com/reference/pro-server-api) from your Java application. You can retrieve visitor history or individual identification events.
[Fingerprint](https://fingerprint.com/) is a device intelligence platform offering 99.5% accurate visitor identification. The Fingerprint Server Java SDK is an easy way to interact with the Fingerprint [Server API](https://dev.fingerprint.com/reference/pro-server-api) from your Java application. You can retrieve visitor history or individual identification events.


*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
Expand Down
1 change: 1 addition & 0 deletions docs/IPLocation.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

# IPLocation

This field is **deprecated** and will not return a result for **accounts created after December 18th, 2023**. Please use the [`ipInfo` Smart signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) for geolocation information.

## Properties

Expand Down
2 changes: 1 addition & 1 deletion docs/IpInfoResultV4.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
|**address** | **String** | | [optional] |
|**geolocation** | [**IPLocation**](IPLocation.md) | | [optional] |
|**asn** | [**ASN**](ASN.md) | | [optional] |
|**dataCenter** | [**DataCenter**](DataCenter.md) | | [optional] |
|**datacenter** | [**DataCenter**](DataCenter.md) | | [optional] |



2 changes: 1 addition & 1 deletion docs/IpInfoResultV6.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
|**address** | **String** | | [optional] |
|**geolocation** | [**IPLocation**](IPLocation.md) | | [optional] |
|**asn** | [**ASN**](ASN.md) | | [optional] |
|**dataCenter** | [**DataCenter**](DataCenter.md) | | [optional] |
|**datacenter** | [**DataCenter**](DataCenter.md) | | [optional] |



14 changes: 10 additions & 4 deletions res/fingerprint-server-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ paths:
asn: '7922'
name: COMCAST-7922
network: 73.136.0.0/13
dataCenter:
datacenter:
result: true
name: DediPath
incognito:
Expand Down Expand Up @@ -3701,7 +3701,7 @@ paths:
asn: '7922'
name: COMCAST-7922
network: 73.136.0.0/13
dataCenter:
datacenter:
result: true
name: DediPath
rootApps:
Expand Down Expand Up @@ -4335,6 +4335,12 @@ components:
IPLocation:
type: object
additionalProperties: false
deprecated: true
description: >-
This field is **deprecated** and will not return a result for **accounts
created after December 18th, 2023**. Please use the [`ipInfo` Smart
signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation)
for geolocation information.
properties:
accuracyRadius:
description: >-
Expand Down Expand Up @@ -4857,7 +4863,7 @@ components:
$ref: '#/components/schemas/IPLocation'
asn:
$ref: '#/components/schemas/ASN'
dataCenter:
datacenter:
$ref: '#/components/schemas/DataCenter'
v6:
type: object
Expand All @@ -4871,7 +4877,7 @@ components:
$ref: '#/components/schemas/IPLocation'
asn:
$ref: '#/components/schemas/ASN'
dataCenter:
datacenter:
$ref: '#/components/schemas/DataCenter'
IpBlockListResult:
type: object
Expand Down
2 changes: 1 addition & 1 deletion scripts/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ echo "VERSION: $VERSION"
sed -i "s/artifactVersion: .*/artifactVersion: $VERSION/g" config.yaml
sed -i "s/^VERSION=.*/VERSION='$VERSION'/g" ./scripts/generate.sh

rm -rf pom.xml README.md build.gradle settings.gradle gradle.properties
rm -f pom.xml README.md build.gradle settings.gradle gradle.properties ./docs/* ./src/main/java/com/fingerprint/model/*

java -jar ./bin/generator.jar generate -c config.yaml -g java --library jersey2 -i res/fingerprint-server-api.yaml --skip-validate-spec -o . -t template

Expand Down
5 changes: 4 additions & 1 deletion src/main/java/com/fingerprint/model/IPLocation.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,11 @@


/**
* IPLocation
* This field is **deprecated** and will not return a result for **accounts created after December 18th, 2023**. Please use the [`ipInfo` Smart signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) for geolocation information.
* @deprecated
*/
@Deprecated
@ApiModel(description = "This field is **deprecated** and will not return a result for **accounts created after December 18th, 2023**. Please use the [`ipInfo` Smart signal](https://dev.fingerprint.com/docs/smart-signals-overview#ip-geolocation) for geolocation information.")
@JsonPropertyOrder({
IPLocation.JSON_PROPERTY_ACCURACY_RADIUS,
IPLocation.JSON_PROPERTY_LATITUDE,
Expand Down
34 changes: 18 additions & 16 deletions src/main/java/com/fingerprint/model/IpInfoResultV4.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
IpInfoResultV4.JSON_PROPERTY_ADDRESS,
IpInfoResultV4.JSON_PROPERTY_GEOLOCATION,
IpInfoResultV4.JSON_PROPERTY_ASN,
IpInfoResultV4.JSON_PROPERTY_DATA_CENTER
IpInfoResultV4.JSON_PROPERTY_DATACENTER
})
@JsonTypeName("IpInfoResult_v4")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
Expand All @@ -52,8 +52,8 @@ public class IpInfoResultV4 {
public static final String JSON_PROPERTY_ASN = "asn";
private ASN asn;

public static final String JSON_PROPERTY_DATA_CENTER = "dataCenter";
private DataCenter dataCenter;
public static final String JSON_PROPERTY_DATACENTER = "datacenter";
private DataCenter datacenter;

public IpInfoResultV4() {
}
Expand Down Expand Up @@ -92,7 +92,9 @@ public IpInfoResultV4 geolocation(IPLocation geolocation) {
/**
* Get geolocation
* @return geolocation
* @deprecated
**/
@Deprecated
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_GEOLOCATION)
Expand Down Expand Up @@ -136,29 +138,29 @@ public void setAsn(ASN asn) {
}


public IpInfoResultV4 dataCenter(DataCenter dataCenter) {
this.dataCenter = dataCenter;
public IpInfoResultV4 datacenter(DataCenter datacenter) {
this.datacenter = datacenter;
return this;
}

/**
* Get dataCenter
* @return dataCenter
* Get datacenter
* @return datacenter
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_DATA_CENTER)
@JsonProperty(JSON_PROPERTY_DATACENTER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public DataCenter getDataCenter() {
return dataCenter;
public DataCenter getDatacenter() {
return datacenter;
}


@JsonProperty(JSON_PROPERTY_DATA_CENTER)
@JsonProperty(JSON_PROPERTY_DATACENTER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setDataCenter(DataCenter dataCenter) {
this.dataCenter = dataCenter;
public void setDatacenter(DataCenter datacenter) {
this.datacenter = datacenter;
}


Expand All @@ -177,12 +179,12 @@ public boolean equals(Object o) {
return Objects.equals(this.address, ipInfoResultV4.address) &&
Objects.equals(this.geolocation, ipInfoResultV4.geolocation) &&
Objects.equals(this.asn, ipInfoResultV4.asn) &&
Objects.equals(this.dataCenter, ipInfoResultV4.dataCenter);
Objects.equals(this.datacenter, ipInfoResultV4.datacenter);
}

@Override
public int hashCode() {
return Objects.hash(address, geolocation, asn, dataCenter);
return Objects.hash(address, geolocation, asn, datacenter);
}

@Override
Expand All @@ -192,7 +194,7 @@ public String toString() {
sb.append(" address: ").append(toIndentedString(address)).append("\n");
sb.append(" geolocation: ").append(toIndentedString(geolocation)).append("\n");
sb.append(" asn: ").append(toIndentedString(asn)).append("\n");
sb.append(" dataCenter: ").append(toIndentedString(dataCenter)).append("\n");
sb.append(" datacenter: ").append(toIndentedString(datacenter)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
34 changes: 18 additions & 16 deletions src/main/java/com/fingerprint/model/IpInfoResultV6.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
IpInfoResultV6.JSON_PROPERTY_ADDRESS,
IpInfoResultV6.JSON_PROPERTY_GEOLOCATION,
IpInfoResultV6.JSON_PROPERTY_ASN,
IpInfoResultV6.JSON_PROPERTY_DATA_CENTER
IpInfoResultV6.JSON_PROPERTY_DATACENTER
})
@JsonTypeName("IpInfoResult_v6")
@javax.annotation.Generated(value = "org.openapitools.codegen.languages.JavaClientCodegen")
Expand All @@ -52,8 +52,8 @@ public class IpInfoResultV6 {
public static final String JSON_PROPERTY_ASN = "asn";
private ASN asn;

public static final String JSON_PROPERTY_DATA_CENTER = "dataCenter";
private DataCenter dataCenter;
public static final String JSON_PROPERTY_DATACENTER = "datacenter";
private DataCenter datacenter;

public IpInfoResultV6() {
}
Expand Down Expand Up @@ -92,7 +92,9 @@ public IpInfoResultV6 geolocation(IPLocation geolocation) {
/**
* Get geolocation
* @return geolocation
* @deprecated
**/
@Deprecated
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_GEOLOCATION)
Expand Down Expand Up @@ -136,29 +138,29 @@ public void setAsn(ASN asn) {
}


public IpInfoResultV6 dataCenter(DataCenter dataCenter) {
this.dataCenter = dataCenter;
public IpInfoResultV6 datacenter(DataCenter datacenter) {
this.datacenter = datacenter;
return this;
}

/**
* Get dataCenter
* @return dataCenter
* Get datacenter
* @return datacenter
**/
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_DATA_CENTER)
@JsonProperty(JSON_PROPERTY_DATACENTER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)

public DataCenter getDataCenter() {
return dataCenter;
public DataCenter getDatacenter() {
return datacenter;
}


@JsonProperty(JSON_PROPERTY_DATA_CENTER)
@JsonProperty(JSON_PROPERTY_DATACENTER)
@JsonInclude(value = JsonInclude.Include.USE_DEFAULTS)
public void setDataCenter(DataCenter dataCenter) {
this.dataCenter = dataCenter;
public void setDatacenter(DataCenter datacenter) {
this.datacenter = datacenter;
}


Expand All @@ -177,12 +179,12 @@ public boolean equals(Object o) {
return Objects.equals(this.address, ipInfoResultV6.address) &&
Objects.equals(this.geolocation, ipInfoResultV6.geolocation) &&
Objects.equals(this.asn, ipInfoResultV6.asn) &&
Objects.equals(this.dataCenter, ipInfoResultV6.dataCenter);
Objects.equals(this.datacenter, ipInfoResultV6.datacenter);
}

@Override
public int hashCode() {
return Objects.hash(address, geolocation, asn, dataCenter);
return Objects.hash(address, geolocation, asn, datacenter);
}

@Override
Expand All @@ -192,7 +194,7 @@ public String toString() {
sb.append(" address: ").append(toIndentedString(address)).append("\n");
sb.append(" geolocation: ").append(toIndentedString(geolocation)).append("\n");
sb.append(" asn: ").append(toIndentedString(asn)).append("\n");
sb.append(" dataCenter: ").append(toIndentedString(dataCenter)).append("\n");
sb.append(" datacenter: ").append(toIndentedString(datacenter)).append("\n");
sb.append("}");
return sb.toString();
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/fingerprint/model/ProductsResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@


/**
* Contains all information about the request identified by `requestId`, depending on the pricing plan (Pro, Pro Plus, Enterprise)
* Contains all information about the request identified by `requestId`, depending on the pricing plan (Pro, Pro Plus, Enterprise)
*/
@ApiModel(description = "Contains all information about the request identified by `requestId`, depending on the pricing plan (Pro, Pro Plus, Enterprise)")
@JsonPropertyOrder({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ public ProductsResponseIdentificationData ipLocation(IPLocation ipLocation) {
/**
* Get ipLocation
* @return ipLocation
* @deprecated
**/
@Deprecated
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_IP_LOCATION)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/fingerprint/model/Response.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@


/**
* Fields `lastTimestamp` and `paginationKey` added when `limit` or `before` parameter provided and there is more data to show
* Fields `lastTimestamp` and `paginationKey` added when `limit` or `before` parameter provided and there is more data to show
*/
@ApiModel(description = "Fields `lastTimestamp` and `paginationKey` added when `limit` or `before` parameter provided and there is more data to show")
@JsonPropertyOrder({
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/fingerprint/model/ResponseVisits.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ public ResponseVisits ipLocation(IPLocation ipLocation) {
/**
* Get ipLocation
* @return ipLocation
* @deprecated
**/
@Deprecated
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_IP_LOCATION)
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/fingerprint/model/Visit.java
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,9 @@ public Visit ipLocation(IPLocation ipLocation) {
/**
* Get ipLocation
* @return ipLocation
* @deprecated
**/
@Deprecated
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_IP_LOCATION)
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/fingerprint/model/WebhookVisit.java
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,9 @@ public WebhookVisit ipLocation(IPLocation ipLocation) {
/**
* Get ipLocation
* @return ipLocation
* @deprecated
**/
@Deprecated
@javax.annotation.Nullable
@ApiModelProperty(value = "")
@JsonProperty(JSON_PROPERTY_IP_LOCATION)
Expand Down
4 changes: 2 additions & 2 deletions src/test/resources/mocks/get_event.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"name": "COMCAST-7922",
"network": "73.136.0.0/13"
},
"dataCenter": {
"datacenter": {
"result": true,
"name": "DediPath"
}
Expand Down Expand Up @@ -229,4 +229,4 @@
}
}
}
}
}
4 changes: 1 addition & 3 deletions template/README.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@

# Fingerprint Pro Server API Java SDK

**Fingerprint Pro Server API allows you to get information about visitors and about individual events in a server environment.
It can be used for data exports, decision-making, and data analysis scenarios.
Server API is intended for server-side usage, it's not intended to be used from the client side, whether it's a browser or a mobile device.**
[Fingerprint](https://fingerprint.com/) is a device intelligence platform offering 99.5% accurate visitor identification. The Fingerprint Server Java SDK is an easy way to interact with the Fingerprint [Server API](https://dev.fingerprint.com/reference/pro-server-api) from your Java application. You can retrieve visitor history or individual identification events.


*Automatically generated by the [OpenAPI Generator](https://openapi-generator.tech)*
Expand Down
Loading

0 comments on commit 7048436

Please sign in to comment.