steam-user 0.1.0

Steam User web client for Rust - HTTP-based Steam Community interactions
Documentation
use steamid::SteamID;

use super::super::{RemoteSteamUser, RemoteSteamUserError};
use crate::types::{ActiveInventory, AppId, ContextId, EconItem, InventoryHistoryItem, InventoryHistoryResult, PriceOverview};

impl RemoteSteamUser {
    pub async fn get_inventory(&self, appid: AppId, context_id: ContextId) -> Result<Vec<EconItem>, RemoteSteamUserError> {
        self.call_typed("/api/inventory/contents", serde_json::json!({"appid": appid.get(), "context_id": context_id.get()})).await
    }
    pub async fn get_user_inventory_contents(&self, steam_id: SteamID, appid: AppId, context_id: ContextId) -> Result<Vec<EconItem>, RemoteSteamUserError> {
        self.call_typed("/api/inventory/user_contents", serde_json::json!({"steam_id": steam_id.steam_id64(), "appid": appid.get(), "context_id": context_id.get()})).await
    }
    pub async fn get_inventory_history(&self) -> Result<InventoryHistoryResult, RemoteSteamUserError> {
        self.call_typed("/api/inventory/history", serde_json::json!({})).await
    }
    pub async fn get_price_overview(&self, appid: AppId, market_hash_name: &str) -> Result<PriceOverview, RemoteSteamUserError> {
        self.call_typed("/api/inventory/price_overview", serde_json::json!({"appid": appid.get(), "market_hash_name": market_hash_name})).await
    }
    pub async fn get_active_inventories(&self) -> Result<Vec<ActiveInventory>, RemoteSteamUserError> {
        self.call_typed("/api/inventory/active", serde_json::json!({})).await
    }
    pub async fn get_inventory_trading(&self, appid: AppId, context_id: ContextId) -> Result<serde_json::Value, RemoteSteamUserError> {
        self.call("/api/inventory/trading", serde_json::json!({"appid": appid.get(), "context_id": context_id.get()})).await
    }
    pub async fn get_inventory_trading_partner(&self, appid: AppId, partner: SteamID, context_id: ContextId) -> Result<serde_json::Value, RemoteSteamUserError> {
        self.call("/api/inventory/trading_partner", serde_json::json!({"appid": appid.get(), "partner": partner.steam_id64(), "context_id": context_id.get()})).await
    }
    pub async fn get_full_inventory_history(&self) -> Result<Vec<InventoryHistoryItem>, RemoteSteamUserError> {
        self.call_typed("/api/inventory/full_history", serde_json::json!({})).await
    }
}