internetdata 2.5.0

The official Rust client library for the InternetData API: download and verify the published IP intelligence databases.
Documentation
/*
 * InternetData API
 *
 * The InternetData API: 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.10.08
 * 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 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<models::DatabaseFormat>,
    /// The formats an evaluation sample is published in, if any.
    #[serde(rename = "sample_formats", skip_serializing_if = "Option::is_none")]
    pub sample_formats: Option<Vec<models::DatabaseFormat>>,
}

impl DatabaseVersion {
    pub fn new(
        id: String,
        version: i32,
        summary: String,
        formats: Vec<models::DatabaseFormat>,
    ) -> DatabaseVersion {
        DatabaseVersion { id, version, summary, formats, sample_formats: None }
    }
}