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