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};

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct AsnPrefix {
    /// The announced prefix.
    #[serde(rename = "prefix")]
    pub prefix: String,
    /// How many peers saw it.
    #[serde(rename = "peer_count")]
    pub peer_count: i32,
    /// Its RPKI status.
    #[serde(rename = "rpki_status")]
    pub rpki_status: String,
    /// The first day BGP Route saw it.
    #[serde(rename = "first_seen")]
    pub first_seen: String,
    /// Where its first address is.
    #[serde(rename = "country")]
    pub country: String,
    /// IPv4 addresses it covers; 0 for IPv6.
    #[serde(rename = "size")]
    pub size: i32,
    /// Every other AS announcing it.
    #[serde(rename = "other_origins")]
    pub other_origins: Vec<i32>,
}

impl AsnPrefix {
    pub fn new(
        prefix: String,
        peer_count: i32,
        rpki_status: String,
        first_seen: String,
        country: String,
        size: i32,
        other_origins: Vec<i32>,
    ) -> AsnPrefix {
        AsnPrefix { prefix, peer_count, rpki_status, first_seen, country, size, other_origins }
    }
}