steam-user 0.2.9

Steam User web client for Rust - HTTP-based Steam Community interactions
Documentation
use std::collections::HashMap;

use super::super::{GasError, GasSteamUser};
use crate::types::{AppDetail, AppListItem, CsgoAccountStats, DynamicStoreUserData, OwnedApp, OwnedAppDetail, SimpleSteamAppList, SteamAppVersionInfo};

impl GasSteamUser {
    pub async fn get_owned_apps(&self) -> Result<Vec<OwnedApp>, GasError> {
        self.call("get_owned_apps", &[]).await
    }
    pub async fn get_owned_apps_id(&self) -> Result<Vec<u32>, GasError> {
        self.call("get_owned_apps_ids", &[]).await
    }
    pub async fn get_owned_apps_detail(&self) -> Result<Vec<OwnedAppDetail>, GasError> {
        self.call("get_owned_apps_detail", &[]).await
    }
    pub async fn get_app_detail(&self, app_ids: &[u32]) -> Result<HashMap<u32, AppDetail>, GasError> {
        let json = serde_json::to_string(app_ids).map_err(GasError::Json)?;
        self.call("get_app_detail", &[("appIds", &json)]).await
    }
    pub async fn fetch_csgo_account_stats(&self) -> Result<CsgoAccountStats, GasError> {
        self.call("fetch_csgo_account_stats", &[]).await
    }
    pub async fn fetch_matchmaking_stats(&self) -> Result<crate::types::MatchmakingStats, GasError> {
        // Without this inherent method the passthrough `impl SteamUserApi for
        // GasSteamUser` resolves `self.fetch_matchmaking_stats()` to the trait
        // method itself — infinite recursion. (Shipped in 4d59970, which added
        // the method to the passthrough list without a Gas inherent impl.)
        self.call("fetch_matchmaking_stats", &[]).await
    }
    pub async fn get_app_list(&self) -> Result<SimpleSteamAppList, GasError> {
        self.call("get_app_list", &[]).await
    }
    pub async fn suggest_app_list(&self, term: &str) -> Result<Vec<AppListItem>, GasError> {
        self.call("suggest_app_list", &[("term", term)]).await
    }
    pub async fn query_app_list(&self, term: &str) -> Result<Vec<AppListItem>, GasError> {
        self.call("query_app_list", &[("term", term)]).await
    }
    pub async fn get_steam_app_version_info(&self, app_id: u32) -> Result<SteamAppVersionInfo, GasError> {
        let app = app_id.to_string();
        self.call("get_steam_app_version_info", &[("appId", &app)]).await
    }
    pub async fn get_dynamic_store_user_data(&self) -> Result<DynamicStoreUserData, GasError> {
        self.call("get_dynamic_store_user_data", &[]).await
    }
    pub async fn fetch_batched_loyalty_reward_items(&self, app_ids: &[u32]) -> Result<Vec<steam_protos::messages::CLoyaltyRewardsBatchedQueryRewardItemsResponseResponse>, GasError> {
        let json = serde_json::to_string(app_ids).map_err(GasError::Json)?;
        self.call("fetch_batched_loyalty_reward_items", &[("appIds", &json)]).await
    }
}