use serde::Deserialize; #[derive(Debug, Deserialize)] pub struct GameVersion { pub id: String, pub downloads: Downloads, #[serde(rename = "assetIndex")] pub asset_index: AssetIndex, pub libraries: Vec, #[serde(rename = "mainClass")] pub main_class: String, #[serde(rename = "minecraftArguments")] pub minecraft_arguments: Option, pub arguments: Option, #[serde(rename = "javaVersion")] pub java_version: Option, } #[derive(Debug, Deserialize)] pub struct Downloads { pub client: DownloadArtifact, pub server: Option, } #[derive(Debug, Deserialize, Clone)] pub struct DownloadArtifact { pub sha1: String, pub size: u64, pub url: String, pub path: Option, } #[derive(Debug, Deserialize)] pub struct AssetIndex { pub id: String, pub sha1: String, pub size: u64, pub url: String, #[serde(rename = "totalSize")] pub total_size: u64, } #[derive(Debug, Deserialize)] pub struct Library { pub downloads: Option, pub name: String, pub rules: Option>, pub natives: Option, } #[derive(Debug, Deserialize)] pub struct Rule { pub action: String, // "allow" or "disallow" pub os: Option, } #[derive(Debug, Deserialize)] pub struct OsRule { pub name: Option, // "linux", "osx", "windows" pub version: Option, // Regex pub arch: Option, // "x86" } #[derive(Debug, Deserialize)] pub struct LibraryDownloads { pub artifact: Option, pub classifiers: Option, // Complex, simplifying for now } #[derive(Debug, Deserialize)] pub struct Arguments { pub game: Option, pub jvm: Option, } #[derive(Debug, Deserialize)] pub struct JavaVersion { pub component: String, #[serde(rename = "majorVersion")] pub major_version: u64, }