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
/*
* 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.13
* Contact: support@internetdata.io
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// AsnLookupResponse : What every database says about one AS.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AsnLookupResponse {
/// The AS number.
#[serde(rename = "asn")]
pub asn: i32,
/// Its operator.
#[serde(rename = "name")]
pub name: String,
/// The country its registry assigned it to.
#[serde(rename = "country")]
pub country: String,
/// The registry that allocated it.
#[serde(rename = "registry")]
pub registry: String,
/// When.
#[serde(rename = "allocated")]
pub allocated: String,
/// Its operator's domain.
#[serde(rename = "domain")]
pub domain: String,
/// The kind of network it runs. Paid plans and the trial.
#[serde(rename = "type", skip_serializing_if = "Option::is_none")]
pub r#type: Option<String>,
/// IPv4 addresses it announces. Paid plans and the trial.
#[serde(rename = "num_ips", skip_serializing_if = "Option::is_none")]
pub num_ips: Option<i32>,
/// IPv4 prefixes it announces. Paid plans and the trial.
#[serde(rename = "num_prefixes4", skip_serializing_if = "Option::is_none")]
pub num_prefixes4: Option<i32>,
/// IPv6 prefixes it announces. Paid plans and the trial.
#[serde(rename = "num_prefixes6", skip_serializing_if = "Option::is_none")]
pub num_prefixes6: Option<i32>,
/// Its announcements RPKI calls valid. Paid plans and the trial.
#[serde(rename = "rpki_valid", skip_serializing_if = "Option::is_none")]
pub rpki_valid: Option<i32>,
/// Invalid. Paid plans and the trial.
#[serde(rename = "rpki_invalid", skip_serializing_if = "Option::is_none")]
pub rpki_invalid: Option<i32>,
/// With no RPKI record. Paid plans and the trial.
#[serde(rename = "rpki_not_found", skip_serializing_if = "Option::is_none")]
pub rpki_not_found: Option<i32>,
/// Its ASN Whois record, every column, empty where the registry states nothing. Paid plans and the trial.
#[serde(rename = "whois", skip_serializing_if = "Option::is_none")]
pub whois: Option<std::collections::HashMap<String, String>>,
/// What it announces, IPv4 then IPv6, up to 20000 a family. Paid plans and the trial.
#[serde(rename = "prefixes", skip_serializing_if = "Option::is_none")]
pub prefixes: Option<Vec<models::AsnPrefix>>,
/// 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>,
}
impl AsnLookupResponse {
/// What every database says about one AS.
pub fn new(
asn: i32,
name: String,
country: String,
registry: String,
allocated: String,
domain: String,
) -> AsnLookupResponse {
AsnLookupResponse {
asn,
name,
country,
registry,
allocated,
domain,
r#type: None,
num_ips: None,
num_prefixes4: None,
num_prefixes6: None,
rpki_valid: None,
rpki_invalid: None,
rpki_not_found: None,
whois: None,
prefixes: None,
trial_expired: None,
}
}
}