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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
/*
* InternetData API
*
* The InternetData API: look up what every database InternetData publishes says about an IP address, an AS or a domain, download the databases your organization is licensed for, and manage the account behind them. See https://docs.internetdata.io for guides and https://github.com/internetdata for the official client libraries.
*
* The version of the OpenAPI document: 2026.11.17
* Contact: support@internetdata.io
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// LookupResponse : What every database says about one address.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LookupResponse {
/// The address looked up, as parsed: `::ffff:a.b.c.d` answers as `a.b.c.d`.
#[serde(rename = "ip")]
pub ip: String,
/// Reserved space, answered from the address alone.
#[serde(rename = "is_bogon")]
pub is_bogon: bool,
/// In VPN IP: a VPN service's server. Paid plans and the trial.
#[serde(rename = "is_vpn", skip_serializing_if = "Option::is_none")]
pub is_vpn: Option<bool>,
/// In Tor IP: a Tor exit.
#[serde(rename = "is_tor")]
pub is_tor: bool,
/// In Relay IP: an anonymizing relay such as iCloud Private Relay.
#[serde(rename = "is_relay")]
pub is_relay: bool,
/// In Residential Proxy IP's 90-day window: a residential proxy exit. Paid plans and the trial.
#[serde(rename = "is_resproxy", skip_serializing_if = "Option::is_none")]
pub is_resproxy: Option<bool>,
/// In Datacenter Proxy IP's 90-day window. Paid plans and the trial.
#[serde(rename = "is_dcproxy", skip_serializing_if = "Option::is_none")]
pub is_dcproxy: Option<bool>,
/// In Mobile Proxy IP's 90-day window. Paid plans and the trial.
#[serde(rename = "is_mobproxy", skip_serializing_if = "Option::is_none")]
pub is_mobproxy: Option<bool>,
/// In Public Proxy IP: a public proxy listens here, or its traffic left from here. Paid plans and the trial.
#[serde(rename = "is_pubproxy", skip_serializing_if = "Option::is_none")]
pub is_pubproxy: Option<bool>,
/// In Hosting IP: a hosting or cloud network. Paid plans and the trial.
#[serde(rename = "is_hosting", skip_serializing_if = "Option::is_none")]
pub is_hosting: Option<bool>,
/// In CDN IP: a content delivery network. Paid plans and the trial.
#[serde(rename = "is_cdn", skip_serializing_if = "Option::is_none")]
pub is_cdn: Option<bool>,
/// In Anycast IP: announced from many places at once.
#[serde(rename = "is_anycast")]
pub is_anycast: bool,
/// In Carrier IP: a mobile carrier's address space.
#[serde(rename = "is_carrier")]
pub is_carrier: bool,
/// In Satellite IP: a satellite operator's address space.
#[serde(rename = "is_satellite")]
pub is_satellite: bool,
/// In SSH IP: an SSH server answered here.
#[serde(rename = "is_ssh")]
pub is_ssh: bool,
/// In SMTP IP: a mail server answered here.
#[serde(rename = "is_smtp")]
pub is_smtp: bool,
/// In Web IP: a web server answered here on port 80 or 443.
#[serde(rename = "is_web")]
pub is_web: bool,
/// In DNS Resolver IP: an open DNS resolver answered here.
#[serde(rename = "is_dns_resolver")]
pub is_dns_resolver: bool,
/// In BitTorrent IP: a BitTorrent client was seen here in the last 90 days.
#[serde(rename = "is_bittorrent")]
pub is_bittorrent: bool,
/// VPN IP's row, `{}` when `is_vpn` is false. Paid plans and the trial.
#[serde(rename = "vpn", skip_serializing_if = "Option::is_none")]
pub vpn: Option<Box<models::ClassDetail>>,
/// Tor IP's row, `{}` when `is_tor` is false.
#[serde(rename = "tor")]
pub tor: Box<models::ClassDetail>,
/// Relay IP's row, `{}` when `is_relay` is false.
#[serde(rename = "relay")]
pub relay: Box<models::ClassDetail>,
/// `{}` when `is_resproxy` is false. Paid plans and the trial.
#[serde(rename = "resproxy", skip_serializing_if = "Option::is_none")]
pub resproxy: Option<Box<models::ProxyDetail>>,
/// `{}` when `is_dcproxy` is false. Paid plans and the trial.
#[serde(rename = "dcproxy", skip_serializing_if = "Option::is_none")]
pub dcproxy: Option<Box<models::ProxyDetail>>,
/// `{}` when `is_mobproxy` is false. Paid plans and the trial.
#[serde(rename = "mobproxy", skip_serializing_if = "Option::is_none")]
pub mobproxy: Option<Box<models::ProxyDetail>>,
/// `{}` when `is_pubproxy` is false. Paid plans and the trial.
#[serde(rename = "pubproxy", skip_serializing_if = "Option::is_none")]
pub pubproxy: Option<Box<models::PubproxyDetail>>,
/// `{}` when `is_hosting` is false. Paid plans and the trial.
#[serde(rename = "hosting", skip_serializing_if = "Option::is_none")]
pub hosting: Option<Box<models::ClassDetail>>,
/// `{}` when `is_cdn` is false. Paid plans and the trial.
#[serde(rename = "cdn", skip_serializing_if = "Option::is_none")]
pub cdn: Option<Box<models::ClassDetail>>,
/// `{}` when `is_carrier` is false. Paid plans and the trial.
#[serde(rename = "carrier", skip_serializing_if = "Option::is_none")]
pub carrier: Option<Box<models::CarrierDetail>>,
/// `{}` when `is_satellite` is false. Paid plans and the trial.
#[serde(rename = "satellite", skip_serializing_if = "Option::is_none")]
pub satellite: Option<Box<models::SatelliteDetail>>,
/// `{}` when `is_ssh` is false. Paid plans and the trial.
#[serde(rename = "ssh", skip_serializing_if = "Option::is_none")]
pub ssh: Option<Box<models::SshDetail>>,
/// `{}` when `is_smtp` is false. Paid plans and the trial.
#[serde(rename = "smtp", skip_serializing_if = "Option::is_none")]
pub smtp: Option<Box<models::SmtpDetail>>,
/// A row per port that answered, lowest first; `[]` when `is_web` is false. Paid plans and the trial.
#[serde(rename = "web", skip_serializing_if = "Option::is_none")]
pub web: Option<Vec<models::WebDetail>>,
/// `{}` when `is_dns_resolver` is false. Paid plans and the trial.
#[serde(rename = "dns_resolver", skip_serializing_if = "Option::is_none")]
pub dns_resolver: Option<Box<models::DnsResolverDetail>>,
/// `{}` when `is_bittorrent` is false. Paid plans and the trial.
#[serde(rename = "bittorrent", skip_serializing_if = "Option::is_none")]
pub bittorrent: Option<Box<models::BitTorrentDetail>>,
#[serde(rename = "location")]
pub location: Box<models::Location>,
#[serde(rename = "asn")]
pub asn: Box<models::Asn>,
#[serde(rename = "company")]
pub company: Box<models::Company>,
/// The name the address's reverse DNS (PTR) record points to in IP RDNS, empty when it has none.
#[serde(rename = "hostname")]
pub hostname: String,
#[serde(rename = "abuse")]
pub abuse: Box<models::AbuseContact>,
#[serde(rename = "whois", skip_serializing_if = "Option::is_none")]
pub whois: Option<Box<models::Whois>>,
#[serde(rename = "rwhois", skip_serializing_if = "Option::is_none")]
pub rwhois: Option<Box<models::Rwhois>>,
#[serde(rename = "hosted_domains", skip_serializing_if = "Option::is_none")]
pub hosted_domains: Option<Box<models::HostedDomains>>,
/// On every answer to a key on the free plan, and on no other: `false` while the day's trial of every field lasts, `true` once the answer has Unlimited's fields.
#[serde(rename = "trial_expired", skip_serializing_if = "Option::is_none")]
pub trial_expired: Option<bool>,
/// On every answer to a key on a paid plan, and on no other: `false` while the answer has every field, `true` once its organization's overage cap is reached and the answer has Unlimited's. Lookups answered past the cap are not billed; raising or removing the cap in Billing turns it `false` again.
#[serde(rename = "cap_reached", skip_serializing_if = "Option::is_none")]
pub cap_reached: Option<bool>,
}
impl LookupResponse {
/// What every database says about one address.
pub fn new(
ip: String,
is_bogon: bool,
is_tor: bool,
is_relay: bool,
is_anycast: bool,
is_carrier: bool,
is_satellite: bool,
is_ssh: bool,
is_smtp: bool,
is_web: bool,
is_dns_resolver: bool,
is_bittorrent: bool,
tor: models::ClassDetail,
relay: models::ClassDetail,
location: models::Location,
asn: models::Asn,
company: models::Company,
hostname: String,
abuse: models::AbuseContact,
) -> LookupResponse {
LookupResponse {
ip,
is_bogon,
is_vpn: None,
is_tor,
is_relay,
is_resproxy: None,
is_dcproxy: None,
is_mobproxy: None,
is_pubproxy: None,
is_hosting: None,
is_cdn: None,
is_anycast,
is_carrier,
is_satellite,
is_ssh,
is_smtp,
is_web,
is_dns_resolver,
is_bittorrent,
vpn: None,
tor: Box::new(tor),
relay: Box::new(relay),
resproxy: None,
dcproxy: None,
mobproxy: None,
pubproxy: None,
hosting: None,
cdn: None,
carrier: None,
satellite: None,
ssh: None,
smtp: None,
web: None,
dns_resolver: None,
bittorrent: None,
location: Box::new(location),
asn: Box::new(asn),
company: Box::new(company),
hostname,
abuse: Box::new(abuse),
whois: None,
rwhois: None,
hosted_domains: None,
trial_expired: None,
cap_reached: None,
}
}
}