use super::super::{RemoteSteamUser, RemoteSteamUserError};
use crate::types::{AccountDetails, PurchaseHistoryItem, RedeemWalletCodeResponse, WalletBalance};
impl RemoteSteamUser {
pub async fn get_account_details(&self) -> Result<AccountDetails, RemoteSteamUserError> {
self.call_typed("/api/account/details", serde_json::json!({})).await
}
pub async fn get_steam_wallet_balance(&self) -> Result<WalletBalance, RemoteSteamUserError> {
self.call_typed("/api/account/wallet_balance", serde_json::json!({})).await
}
pub async fn get_amount_spent_on_steam(&self) -> Result<String, RemoteSteamUserError> {
self.call_typed("/api/account/amount_spent", serde_json::json!({})).await
}
pub async fn get_purchase_history(&self) -> Result<Vec<PurchaseHistoryItem>, RemoteSteamUserError> {
self.call_typed("/api/account/purchase_history", serde_json::json!({})).await
}
pub async fn redeem_wallet_code(&self, code: &str) -> Result<RedeemWalletCodeResponse, RemoteSteamUserError> {
self.call_typed("/api/account/redeem_wallet_code", serde_json::json!({ "code": code })).await
}
pub async fn parental_unlock(&self, pin: &str) -> Result<(), RemoteSteamUserError> {
self.call_void("/api/account/parental_unlock", serde_json::json!({ "pin": pin })).await
}
}