steam-user 0.1.0

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

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

impl RemoteSteamUser {
    pub async fn get_owned_apps(&self) -> Result<Vec<OwnedApp>, RemoteSteamUserError> {
        self.call_typed("/api/apps/owned", serde_json::json!({})).await
    }
    pub async fn get_owned_apps_id(&self) -> Result<Vec<u32>, RemoteSteamUserError> {
        self.call_typed("/api/apps/owned_ids", serde_json::json!({})).await
    }
    pub async fn get_owned_apps_detail(&self) -> Result<Vec<OwnedAppDetail>, RemoteSteamUserError> {
        self.call_typed("/api/apps/owned_detail", serde_json::json!({})).await
    }
    pub async fn get_app_detail(&self, app_ids: &[u32]) -> Result<HashMap<u32, AppDetail>, RemoteSteamUserError> {
        self.call_typed("/api/apps/detail", serde_json::json!({ "app_ids": app_ids })).await
    }
    pub async fn fetch_csgo_account_stats(&self) -> Result<CsgoAccountStats, RemoteSteamUserError> {
        self.call_typed("/api/apps/csgo_stats", serde_json::json!({})).await
    }
    pub async fn get_app_list(&self) -> Result<SimpleSteamAppList, RemoteSteamUserError> {
        self.call_typed("/api/apps/app_list", serde_json::json!({})).await
    }
    pub async fn suggest_app_list(&self, term: &str) -> Result<Vec<AppListItem>, RemoteSteamUserError> {
        self.call_typed("/api/apps/suggest", serde_json::json!({ "term": term })).await
    }
    pub async fn query_app_list(&self, term: &str) -> Result<Vec<AppListItem>, RemoteSteamUserError> {
        self.call_typed("/api/apps/search", serde_json::json!({ "term": term })).await
    }
    pub async fn get_steam_app_version_info(&self, app_id: u32) -> Result<SteamAppVersionInfo, RemoteSteamUserError> {
        self.call_typed("/api/apps/version_info", serde_json::json!({ "app_id": app_id })).await
    }
    pub async fn get_dynamic_store_user_data(&self) -> Result<DynamicStoreUserData, RemoteSteamUserError> {
        self.call_typed("/api/apps/dynamic_store", serde_json::json!({})).await
    }
    pub async fn fetch_batched_loyalty_reward_items(&self, app_ids: &[u32]) -> Result<Vec<steam_protos::messages::CLoyaltyRewardsBatchedQueryRewardItemsResponseResponse>, RemoteSteamUserError> {
        self.call_typed("/api/apps/loyalty_rewards", serde_json::json!({ "app_ids": app_ids })).await
    }
}