use std::collections::HashMap; use serde::{Deserialize, Serialize}; use serde_aux::prelude::*; use crate::{ price::AppPrice, types::{Platforms, ReleaseDate}, }; #[derive(Deserialize)] pub(crate) struct AppData { pub data: Option, pub success: bool, } /// Contains information about steam application #[derive(Deserialize, Serialize, Hash, Debug)] pub struct AppDetails { /// Observed values: "game", "dlc", "demo", "advertising", "mod", "video". pub r#type: String, pub name: String, #[serde(rename(deserialize = "steam_appid"))] pub app_id: u64, #[serde(deserialize_with = "deserialize_option_number_from_string")] pub required_age: Option, pub is_free: Option, pub controller_support: Option, /// Array of app ids. pub dlc: Option>, pub detailed_description: Option, pub about_the_game: Option, pub short_description: Option, pub supported_languages: Option, pub header_image: Option, pub capsule_image: Option, pub capsule_imagev5: Option, pub website: Option, #[serde(deserialize_with = "deserialize_default_from_empty_object")] pub pc_requirements: Option, #[serde(deserialize_with = "deserialize_default_from_empty_object")] pub mac_requirements: Option, #[serde(deserialize_with = "deserialize_default_from_empty_object")] pub linux_requirements: Option, pub legal_notice: Option, pub developers: Option>, pub publishers: Option>, pub price_overview: Option, pub packages: Option>, pub platforms: Option, pub metacritic: Option, pub categories: Option>, pub genres: Option>, pub screenshots: Option>, pub movies: Option>, pub recommendations: Option, pub achievements: Option, pub release_date: Option, pub support_info: Option, pub background: Option, pub background_raw: Option, pub content_descriptors: Option, } #[derive(Deserialize, Serialize, Hash, Debug)] pub struct ContentDescriptors { pub ids: Vec, pub notes: Option, } #[derive(Deserialize, Serialize, Hash, Debug)] pub struct SupportInfo { pub url: String, pub email: String, } #[derive(Deserialize, Serialize, Hash, Debug)] pub struct Achievement { pub name: String, pub path: String, } #[derive(Deserialize, Serialize, Hash, Debug)] pub struct Achievements { pub total: u32, pub highlighted: Option>, } #[derive(Deserialize, Serialize, Hash, Debug)] pub struct MovieFormat { #[serde(rename(deserialize = "480"))] pub x480: String, pub max: String, } #[derive(Deserialize, Serialize, Hash, Debug)] pub struct Movie { pub id: u64, pub name: String, pub thumbnail: String, pub highlight: bool, pub webm: MovieFormat, pub mp4: MovieFormat, } #[derive(Deserialize, Serialize, Hash, Debug)] pub struct Screenshot { pub id: u64, pub path_thumbnail: String, pub path_full: String, } #[derive(Deserialize, Serialize, Hash, Debug)] pub struct Metacritic { pub score: u8, pub url: String, } #[derive(Deserialize, Serialize, Hash, Debug)] pub struct Requirements { pub minimum: Option, pub recommended: Option, } #[derive(Deserialize, Serialize, Hash, Debug)] pub struct Recommendations { pub total: u64, } #[derive(Deserialize, Serialize, Hash, Debug)] pub struct Categorie { /// Steam categorie id pub id: u8, pub description: String, } #[derive(Deserialize, Serialize, Hash, Debug)] pub struct Genre { /// Steam genre id pub id: String, pub name: Option, pub description: Option, } #[derive(Deserialize, Debug)] pub(crate) struct GenreData { pub status: i8, pub genres: Vec, } #[derive(Deserialize, Serialize, Hash, Debug)] pub struct App { #[serde(rename(deserialize = "appid"))] /// Steam application id pub app_id: u64, /// Application name pub name: String, } #[derive(Deserialize, Serialize, Debug)] pub struct AppsIn { pub(crate) status: i8, /// ID of genre or category pub id: String, /// Name of genre or category pub name: String, /// List of tabs with items, e.g. Top Sellers, Specials pub tabs: Option>, } #[derive(Deserialize, Serialize, Hash, Debug)] pub struct Tab { pub name: String, pub total_item_count: u64, pub items: Vec, } #[derive(Deserialize, Serialize, Hash, Debug)] pub struct TabItem { /// Game, dlc, movie etc pub r#type: u8, /// Application id #[serde(rename(deserialize = "id"))] pub app_id: u64, }