vpndetection 6.2.0

The official Rust client library for the VPNDetection API: anonymity detection covering VPNs, residential proxies, Tor nodes, hosting servers, CDNs and relays.
Documentation
/*
 * VPNDetection API
 *
 * The VPNDetection API: classify any IP address, and download the databases behind the answers.  Lookups need no API key: Unlimited, the free plan, answers any address with no daily or monthly cap, with a key or without one. Every paid plan answers every field, and a free account tries them. Unlimited's answers may be used commercially, but not redistributed or used in a competing service (https://vpndetection.io/terms#no-key).  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.11.20
 * Contact: support@vpndetection.io
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// BitTorrentDetail : BitTorrent clients seen on the address over the last 90 days, from our BitTorrent IP database. Every key is present when the object is populated; the object is `{}` when `is_bittorrent` is false.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct BitTorrentDetail {
    /// A client here answered, or two or more reported it at once.
    #[serde(rename = "verified", skip_serializing_if = "Option::is_none")]
    pub verified: Option<bool>,
    /// A client here derived its node ID from the address (BEP 42).
    #[serde(rename = "id_matches_ip", skip_serializing_if = "Option::is_none")]
    pub id_matches_ip: Option<bool>,
    /// The first day a client was seen here.
    #[serde(rename = "first_seen", skip_serializing_if = "Option::is_none")]
    pub first_seen: Option<String>,
    /// The last day.
    #[serde(rename = "last_seen", skip_serializing_if = "Option::is_none")]
    pub last_seen: Option<String>,
    /// The last day one answered, empty when none did.
    #[serde(rename = "last_reachable", skip_serializing_if = "Option::is_none")]
    pub last_reachable: Option<String>,
    /// On how many days.
    #[serde(rename = "days_seen", skip_serializing_if = "Option::is_none")]
    pub days_seen: Option<i32>,
    /// Distinct ports over the window.
    #[serde(rename = "num_ports", skip_serializing_if = "Option::is_none")]
    pub num_ports: Option<i32>,
    /// The most on one day.
    #[serde(rename = "peak_num_ports", skip_serializing_if = "Option::is_none")]
    pub peak_num_ports: Option<i32>,
    /// A DHT indexer rather than people.
    #[serde(rename = "indexer", skip_serializing_if = "Option::is_none")]
    pub indexer: Option<bool>,
    /// The two-letter codes its clients name themselves by.
    #[serde(rename = "clients", skip_serializing_if = "Option::is_none")]
    pub clients: Option<Vec<String>>,
}

impl BitTorrentDetail {
    /// BitTorrent clients seen on the address over the last 90 days, from our BitTorrent IP database. Every key is present when the object is populated; the object is `{}` when `is_bittorrent` is false.
    pub fn new() -> BitTorrentDetail {
        BitTorrentDetail {
            verified: None,
            id_matches_ip: None,
            first_seen: None,
            last_seen: None,
            last_reachable: None,
            days_seen: None,
            num_ports: None,
            peak_num_ports: None,
            indexer: None,
            clients: None,
        }
    }
}