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
/*
* 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.10.20
* Contact: support@vpndetection.io
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
/// Asn : The autonomous system that announces the address. Free and paid plans. Each field is present whenever the object is: `asn` is 0 and the rest empty where no announcement covers the address.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Asn {
/// The AS number, 0 when no announcement covers the address.
#[serde(rename = "asn")]
pub asn: i32,
/// Name of the organization that operates the AS.
#[serde(rename = "name")]
pub name: String,
/// The AS operator's own registrable domain.
#[serde(rename = "domain")]
pub domain: String,
/// The kind of network the AS runs: isp, hosting, education, government or business.
#[serde(rename = "type")]
pub r#type: String,
/// The announced BGP prefix that covers the address, the most specific when several do.
#[serde(rename = "prefix")]
pub prefix: String,
}
impl Asn {
/// The autonomous system that announces the address. Free and paid plans. Each field is present whenever the object is: `asn` is 0 and the rest empty where no announcement covers the address.
pub fn new(asn: i32, name: String, domain: String, r#type: String, prefix: String) -> Asn {
Asn { asn, name, domain, r#type, prefix }
}
}