Skip to content

Commit

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

(prerelease) Introduce `datacenter` field for the `IpInfo` signal in addition to the wrong `dataCenter`
  • Loading branch information
ilfa authored Dec 22, 2023
2 parents c8fed71 + 7ba499f commit d82ecbe
Show file tree
Hide file tree
Showing 7 changed files with 81 additions and 7 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@

# 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 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.**


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


Expand Down
1 change: 1 addition & 0 deletions docs/IpInfoResultV6.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +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] |


Expand Down
10 changes: 8 additions & 2 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 @@ -4857,6 +4857,9 @@ components:
$ref: '#/components/schemas/IPLocation'
asn:
$ref: '#/components/schemas/ASN'
datacenter:
$ref: '#/components/schemas/DataCenter'
# `dataCenter` is deprecated in favor of `datacenter`
dataCenter:
$ref: '#/components/schemas/DataCenter'
v6:
Expand All @@ -4871,6 +4874,9 @@ components:
$ref: '#/components/schemas/IPLocation'
asn:
$ref: '#/components/schemas/ASN'
datacenter:
$ref: '#/components/schemas/DataCenter'
# `dataCenter` is deprecated in favor of `datacenter`
dataCenter:
$ref: '#/components/schemas/DataCenter'
IpBlockListResult:
Expand Down
34 changes: 33 additions & 1 deletion src/main/java/com/fingerprint/model/IpInfoResultV4.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
IpInfoResultV4.JSON_PROPERTY_ADDRESS,
IpInfoResultV4.JSON_PROPERTY_GEOLOCATION,
IpInfoResultV4.JSON_PROPERTY_ASN,
IpInfoResultV4.JSON_PROPERTY_DATACENTER,
IpInfoResultV4.JSON_PROPERTY_DATA_CENTER
})
@JsonTypeName("IpInfoResult_v4")
Expand All @@ -52,6 +53,9 @@ public class IpInfoResultV4 {
public static final String JSON_PROPERTY_ASN = "asn";
private ASN asn;

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

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

Expand Down Expand Up @@ -136,6 +140,32 @@ public void setAsn(ASN asn) {
}


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

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

public DataCenter getDatacenter() {
return datacenter;
}


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


public IpInfoResultV4 dataCenter(DataCenter dataCenter) {
this.dataCenter = dataCenter;
return this;
Expand Down Expand Up @@ -177,12 +207,13 @@ 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, dataCenter);
}

@Override
Expand All @@ -192,6 +223,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: 33 additions & 1 deletion src/main/java/com/fingerprint/model/IpInfoResultV6.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
IpInfoResultV6.JSON_PROPERTY_ADDRESS,
IpInfoResultV6.JSON_PROPERTY_GEOLOCATION,
IpInfoResultV6.JSON_PROPERTY_ASN,
IpInfoResultV6.JSON_PROPERTY_DATACENTER,
IpInfoResultV6.JSON_PROPERTY_DATA_CENTER
})
@JsonTypeName("IpInfoResult_v6")
Expand All @@ -52,6 +53,9 @@ public class IpInfoResultV6 {
public static final String JSON_PROPERTY_ASN = "asn";
private ASN asn;

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

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

Expand Down Expand Up @@ -136,6 +140,32 @@ public void setAsn(ASN asn) {
}


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

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

public DataCenter getDatacenter() {
return datacenter;
}


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


public IpInfoResultV6 dataCenter(DataCenter dataCenter) {
this.dataCenter = dataCenter;
return this;
Expand Down Expand Up @@ -177,12 +207,13 @@ 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, dataCenter);
}

@Override
Expand All @@ -192,6 +223,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
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 @@
}
}
}
}
}

0 comments on commit d82ecbe

Please sign in to comment.