1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*
* VPNDetection API
*
* The VPNDetection API: classify any IP address, and download the databases behind the answers. See https://docs.vpndetection.io for guides and https://github.com/vpndetection-io for the official client libraries.
*
* The version of the OpenAPI document: 2026.09.26
* Contact: support@vpndetection.io
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// LookupResponse : The union of every plan's answer. Only `ip` and `is_vpn` are guaranteed; each remaining field is present when your plan includes it, and absent otherwise. A client that must work across plans should treat an absent flag as unknown rather than as `false`.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LookupResponse {
/// The address that was looked up, normalized.
#[serde(rename = "ip")]
pub ip: String,
/// Whether the address is VPN infrastructure. Keys off presence in the VPN dataset, so an unattributed range with no provider is still `true`.
#[serde(rename = "is_vpn")]
pub is_vpn: bool,
/// Whether the address belongs to a hosting or cloud provider. Starter and above.
#[serde(rename = "is_hosting", skip_serializing_if = "Option::is_none")]
pub is_hosting: Option<bool>,
/// Whether the address is a privacy relay egress. Starter and above.
#[serde(rename = "is_relay", skip_serializing_if = "Option::is_none")]
pub is_relay: Option<bool>,
/// Whether the address is a Tor node. Starter and above.
#[serde(rename = "is_tor", skip_serializing_if = "Option::is_none")]
pub is_tor: Option<bool>,
/// Whether the address belongs to a CDN. Starter and above.
#[serde(rename = "is_cdn", skip_serializing_if = "Option::is_none")]
pub is_cdn: Option<bool>,
/// Whether the address was seen in a residential proxy pool. Scale and above.
#[serde(rename = "is_resproxy", skip_serializing_if = "Option::is_none")]
pub is_resproxy: Option<bool>,
/// Whether the address was seen in a datacenter proxy pool. Scale and above.
#[serde(rename = "is_dcproxy", skip_serializing_if = "Option::is_none")]
pub is_dcproxy: Option<bool>,
/// Whether the address was seen in a mobile proxy pool. Scale and above.
#[serde(rename = "is_mobproxy", skip_serializing_if = "Option::is_none")]
pub is_mobproxy: Option<bool>,
/// Detail for `is_vpn`. Empty when `is_vpn` is false. Starter and above.
#[serde(rename = "vpn", skip_serializing_if = "Option::is_none")]
pub vpn: Option<Box<models::VpnDetail>>,
/// Detail for `is_hosting`. Empty when false. Scale and above.
#[serde(rename = "hosting", skip_serializing_if = "Option::is_none")]
pub hosting: Option<Box<models::ClassDetail>>,
/// Detail for `is_relay`. Empty when false. Scale and above.
#[serde(rename = "relay", skip_serializing_if = "Option::is_none")]
pub relay: Option<Box<models::ClassDetail>>,
/// Detail for `is_tor`. Empty when false. Scale and above. The tor dataset carries no provider, so `provider` is always an empty string.
#[serde(rename = "tor", skip_serializing_if = "Option::is_none")]
pub tor: Option<Box<models::ClassDetail>>,
/// Detail for `is_cdn`. Empty when false. Scale and above.
#[serde(rename = "cdn", skip_serializing_if = "Option::is_none")]
pub cdn: Option<Box<models::ClassDetail>>,
/// Detail for `is_resproxy`. Empty when false. Max only.
#[serde(rename = "resproxy", skip_serializing_if = "Option::is_none")]
pub resproxy: Option<Box<models::ProxyDetail>>,
/// Detail for `is_dcproxy`. Empty when false. Max only.
#[serde(rename = "dcproxy", skip_serializing_if = "Option::is_none")]
pub dcproxy: Option<Box<models::ProxyDetail>>,
/// Detail for `is_mobproxy`. Empty when false. Max only.
#[serde(rename = "mobproxy", skip_serializing_if = "Option::is_none")]
pub mobproxy: Option<Box<models::ProxyDetail>>,
}
impl LookupResponse {
/// The union of every plan's answer. Only `ip` and `is_vpn` are guaranteed; each remaining field is present when your plan includes it, and absent otherwise. A client that must work across plans should treat an absent flag as unknown rather than as `false`.
pub fn new(ip: String, is_vpn: bool) -> LookupResponse {
LookupResponse {
ip,
is_vpn,
is_hosting: None,
is_relay: None,
is_tor: None,
is_cdn: None,
is_resproxy: None,
is_dcproxy: None,
is_mobproxy: None,
vpn: None,
hosting: None,
relay: None,
tor: None,
cdn: None,
resproxy: None,
dcproxy: None,
mobproxy: None,
}
}
}