mcapi 0.2.0

Unified async Rust client for the Minecraft ecosystem (Mojang, Modrinth, CurseForge, Yggdrasil, Blessing Skin, Loaders, Java Runtimes, and SLP)
Documentation
use std::collections::HashMap;

use chrono::{DateTime, Utc};
use serde::{Deserialize, Serialize};

/// Category tag metadata returned by `GET /v2/tag/category`.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct CategoryTag {
    pub icon: String,
    pub name: String,
    pub project_type: String,
    pub header: String,
}

/// Loader tag metadata returned by `GET /v2/tag/loader`.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct LoaderTag {
    pub icon: String,
    pub name: String,
    #[serde(default)]
    pub supported_project_types: Vec<String>,
}

/// Game version tag returned by `GET /v2/tag/game_version`.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct GameVersionTag {
    pub version: String,
    pub version_type: String,
    pub date: DateTime<Utc>,
    pub major: bool,
}

/// Short license tag returned by `GET /v2/tag/license`.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct LicenseTag {
    pub short: String,
    pub name: String,
}

/// Detailed SPDX license text returned by `GET /v2/tag/license/{id}`.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct FullLicense {
    pub title: String,
    pub body: String,
}

/// Donation platform tag returned by `GET /v2/tag/donation_platform`.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct DonationPlatformTag {
    pub short: String,
    pub name: String,
}

/// Global Modrinth instance statistics returned by `GET /v2/statistics`.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct Statistics {
    pub projects: u64,
    pub versions: u64,
    pub files: u64,
    pub authors: u64,
}

/// Forge update checker JSON returned by `GET /updates/{id|slug}/forge_updates.json`.
#[derive(Clone, Debug, Deserialize, Serialize)]
pub struct ForgeUpdates {
    #[serde(default)]
    pub homepage: Option<String>,
    #[serde(default)]
    pub promos: ForgePromos,
}

/// Map of `"<mcVersion>-latest"` / `"<mcVersion>-recommended"` to mod version strings.
pub type ForgePromos = HashMap<String, String>;