internetdata 3.1.1

The official Rust client library for the InternetData API: look up IP addresses, AS numbers and domains, and download the IP intelligence databases.
Documentation
/*
 * 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};

/// Asn : The network announcing the address, from IP ASN.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Asn {
    /// The AS announcing the address, 0 where none does.
    #[serde(rename = "asn")]
    pub asn: i32,
    /// Its operator.
    #[serde(rename = "name")]
    pub name: String,
    /// Its operator's domain.
    #[serde(rename = "domain")]
    pub domain: String,
    /// The kind of network it runs.
    #[serde(rename = "type")]
    pub r#type: String,
    /// The announced prefix covering the address.
    #[serde(rename = "prefix")]
    pub prefix: String,
    /// The country its registry assigned it to. Paid plans and the trial.
    #[serde(rename = "country", skip_serializing_if = "Option::is_none")]
    pub country: Option<String>,
    /// The announcement's RPKI status. Paid plans and the trial.
    #[serde(rename = "rpki_status", skip_serializing_if = "Option::is_none")]
    pub rpki_status: Option<String>,
}

impl Asn {
    /// The network announcing the address, from IP ASN.
    pub fn new(asn: i32, name: String, domain: String, r#type: String, prefix: String) -> Asn {
        Asn { asn, name, domain, r#type, prefix, country: None, rpki_status: None }
    }
}