-
Notifications
You must be signed in to change notification settings - Fork 206
Support static_ip_score #164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,6 +30,8 @@ public final class Traits extends AbstractRecord { | |
| private final String isp; | ||
| private final String organization; | ||
| private final String userType; | ||
| private final Integer userCount; | ||
| private final Double staticIpScore; | ||
|
|
||
| public Traits() { | ||
| this(null, null, null, null, false, false, null, null, null); | ||
|
|
@@ -74,7 +76,33 @@ public Traits( | |
| ) { | ||
| this(autonomousSystemNumber, autonomousSystemOrganization, connectionType, domain, | ||
| ipAddress, false, isAnonymousProxy, false, false, isLegitimateProxy, | ||
| false, isSatelliteProvider, false, isp, organization, userType); | ||
| false, isSatelliteProvider, false, isp, organization, userType, null, null); | ||
| } | ||
|
|
||
| // This is for back-compat. If we ever do a major release, it should be | ||
| // removed. | ||
| public Traits( | ||
| Integer autonomousSystemNumber, | ||
| String autonomousSystemOrganization, | ||
| ConnectionType connectionType, | ||
| String domain, | ||
| String ipAddress, | ||
| boolean isAnonymous, | ||
| boolean isAnonymousProxy, | ||
| boolean isAnonymousVpn, | ||
| boolean isHostingProvider, | ||
| boolean isLegitimateProxy, | ||
| boolean isPublicProxy, | ||
| boolean isSatelliteProvider, | ||
| boolean isTorExitNode, | ||
| String isp, | ||
| String organization, | ||
| String userType | ||
| ) { | ||
| this(autonomousSystemNumber, autonomousSystemOrganization, connectionType, domain, | ||
| ipAddress, isAnonymous, isAnonymousProxy, isAnonymousVpn, isHostingProvider, | ||
| isLegitimateProxy, isPublicProxy, isSatelliteProvider, isTorExitNode, isp, | ||
| organization, userType, null, null); | ||
| } | ||
|
|
||
| public Traits( | ||
|
|
@@ -93,7 +121,9 @@ public Traits( | |
| @JsonProperty("is_tor_exit_node") boolean isTorExitNode, | ||
| @JsonProperty("isp") String isp, | ||
| @JsonProperty("organization") String organization, | ||
| @JsonProperty("user_type") String userType | ||
| @JsonProperty("user_type") String userType, | ||
| @JsonProperty("user_count") Integer userCount, | ||
| @JsonProperty("static_ip_score") Double staticIpScore | ||
| ) { | ||
| this.autonomousSystemNumber = autonomousSystemNumber; | ||
| this.autonomousSystemOrganization = autonomousSystemOrganization; | ||
|
|
@@ -111,6 +141,8 @@ public Traits( | |
| this.isp = isp; | ||
| this.organization = organization; | ||
| this.userType = userType; | ||
| this.userCount = userCount; | ||
| this.staticIpScore = staticIpScore; | ||
| } | ||
|
|
||
| /** | ||
|
|
@@ -146,6 +178,27 @@ public ConnectionType getConnectionType() { | |
| return this.connectionType; | ||
| } | ||
|
|
||
| /** | ||
| * @return The static IP score of the IP address. This is an indicator of | ||
| * how static or dynamic an IP address is. This attribute is only | ||
| * available from GeoIP2 Precision Insights. | ||
| */ | ||
| @JsonProperty("static_ip_score") | ||
| public Double getStaticIpScore() { | ||
| return this.staticIpScore; | ||
| } | ||
|
|
||
| /** | ||
| * @return The estimated number of users sharing the IP address/network | ||
| * during the past 24 hours. For IPv4, the count is for the individual | ||
| * IP address. For IPv6, the count is for the /64 network. This attribute | ||
| * is only available from GeoIP2 Precision Insights. | ||
| */ | ||
| @JsonProperty("user_count") | ||
| public Integer getUserCount() { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we have a comment documenting this? |
||
| return this.userCount; | ||
| } | ||
|
|
||
| /** | ||
| * @return The second level domain associated with the IP address. This will | ||
| * be something like "example.com" or "example.co.uk", not | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we say anything about what they are? I think in the other libraries we've been doing that.