|
31 | 31 | * @param providerName The name of the VPN provider (e.g., NordVPN, SurfShark, etc.) associated |
32 | 32 | * with the network. This is only available from the GeoIP Insights |
33 | 33 | * web service. |
| 34 | + * @param residential Residential proxy data for the network. This may be populated even when |
| 35 | + * none of the other fields on this record are set. This is only available |
| 36 | + * from the GeoIP Insights web service. |
34 | 37 | */ |
35 | 38 | public record Anonymizer( |
36 | 39 | @JsonProperty("confidence") |
@@ -58,14 +61,68 @@ public record Anonymizer( |
58 | 61 | LocalDate networkLastSeen, |
59 | 62 |
|
60 | 63 | @JsonProperty("provider_name") |
61 | | - String providerName |
| 64 | + String providerName, |
| 65 | + |
| 66 | + @JsonProperty("residential") |
| 67 | + AnonymizerFeed residential |
62 | 68 | ) implements JsonSerializable { |
63 | 69 |
|
| 70 | + /** |
| 71 | + * Compact canonical constructor that sets a default for a null {@code residential} value. |
| 72 | + */ |
| 73 | + public Anonymizer { |
| 74 | + residential = residential != null ? residential : new AnonymizerFeed(); |
| 75 | + } |
| 76 | + |
64 | 77 | /** |
65 | 78 | * Constructs an {@code Anonymizer} record with {@code null} values for all the nullable |
66 | 79 | * fields and {@code false} for all boolean fields. |
67 | 80 | */ |
68 | 81 | public Anonymizer() { |
69 | | - this(null, false, false, false, false, false, false, null, null); |
| 82 | + this(null, false, false, false, false, false, false, null, null, null); |
| 83 | + } |
| 84 | + |
| 85 | + /** |
| 86 | + * Constructs an {@code Anonymizer} record without the {@code residential} field. |
| 87 | + * |
| 88 | + * @param confidence the confidence that the network is an actively used VPN service |
| 89 | + * @param isAnonymous whether the IP address belongs to any sort of anonymous network |
| 90 | + * @param isAnonymousVpn whether the IP address is registered to an anonymous VPN provider |
| 91 | + * @param isHostingProvider whether the IP address belongs to a hosting or VPN provider |
| 92 | + * @param isPublicProxy whether the IP address belongs to a public proxy |
| 93 | + * @param isResidentialProxy whether the IP address is on a suspected anonymizing network |
| 94 | + * and belongs to a residential ISP |
| 95 | + * @param isTorExitNode whether the IP address is a Tor exit node |
| 96 | + * @param networkLastSeen the last day that the network was sighted in our analysis of |
| 97 | + * anonymized networks |
| 98 | + * @param providerName the name of the VPN provider associated with the network |
| 99 | + * @deprecated Use the canonical constructor that also accepts the {@code residential} |
| 100 | + * field. This constructor is provided for backward compatibility and will be |
| 101 | + * removed in version 6.0.0. |
| 102 | + */ |
| 103 | + @Deprecated(since = "5.2.0", forRemoval = true) |
| 104 | + public Anonymizer( |
| 105 | + Integer confidence, |
| 106 | + boolean isAnonymous, |
| 107 | + boolean isAnonymousVpn, |
| 108 | + boolean isHostingProvider, |
| 109 | + boolean isPublicProxy, |
| 110 | + boolean isResidentialProxy, |
| 111 | + boolean isTorExitNode, |
| 112 | + LocalDate networkLastSeen, |
| 113 | + String providerName |
| 114 | + ) { |
| 115 | + this( |
| 116 | + confidence, |
| 117 | + isAnonymous, |
| 118 | + isAnonymousVpn, |
| 119 | + isHostingProvider, |
| 120 | + isPublicProxy, |
| 121 | + isResidentialProxy, |
| 122 | + isTorExitNode, |
| 123 | + networkLastSeen, |
| 124 | + providerName, |
| 125 | + null |
| 126 | + ); |
70 | 127 | } |
71 | 128 | } |
0 commit comments