internetdata 1.1.1

The official Rust client library for the InternetData API: download and verify the published IP intelligence databases.
Documentation
/*
 * InternetData API
 *
 * The InternetData API. Please see https://docs.internetdata.io/api for more details.
 *
 * The version of the OpenAPI document: 2026.09.05
 * Contact: dev@internetdata.io
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct DatabaseVersion {
    /// The versioned id. Pass this to `download`, `checksum` and `metadata`.
    #[serde(rename = "id")]
    pub id: String,
    #[serde(rename = "version")]
    pub version: i32,
    #[serde(rename = "summary")]
    pub summary: String,
    /// The formats this version is BUILT in. Asking for another is a 400, not a gap - the `_provider` catalogs are keyed by provider id, so no MMDB exists for them.
    #[serde(rename = "formats")]
    pub formats: Vec<Formats>,
}

impl DatabaseVersion {
    pub fn new(
        id: String,
        version: i32,
        summary: String,
        formats: Vec<Formats>,
    ) -> DatabaseVersion {
        DatabaseVersion { id, version, summary, formats }
    }
}
/// The formats this version is BUILT in. Asking for another is a 400, not a gap - the `_provider` catalogs are keyed by provider id, so no MMDB exists for them.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum Formats {
    #[serde(rename = "csvgz")]
    Csvgz,
    #[serde(rename = "mmdb")]
    Mmdb,
}

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