vpndetection 1.0.2

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 datasets 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.09.04
 * Contact: support@vpndetection.io
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct LicensedVersion {
    /// The versioned dataset id, e.g. `vpn_ip_v1`. Pass this to download.
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "version")]
    pub version: i32,
    #[serde(rename = "summary", skip_serializing_if = "Option::is_none")]
    pub summary: Option<String>,
    #[serde(rename = "formats")]
    pub formats: Vec<models::DatasetFormatSize>,
    /// The formats an evaluation sample is published in, if any.
    #[serde(rename = "sampleFormats", skip_serializing_if = "Option::is_none")]
    pub sample_formats: Option<Vec<SampleFormats>>,
}

impl LicensedVersion {
    pub fn new(
        id: String,
        version: i32,
        formats: Vec<models::DatasetFormatSize>,
    ) -> LicensedVersion {
        LicensedVersion { id, version, summary: None, formats, sample_formats: None }
    }
}
/// The formats an evaluation sample is published in, if any.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum SampleFormats {
    #[serde(rename = "csvgz")]
    Csvgz,
    #[serde(rename = "mmdb")]
    Mmdb,
}

impl Default for SampleFormats {
    fn default() -> SampleFormats {
        Self::Csvgz
    }
}