use steamid::SteamID;
use super::super::{RemoteSteamUser, RemoteSteamUserError};
use crate::types::{LoggedInResult, Notifications};
impl RemoteSteamUser {
pub async fn logged_in(&self) -> Result<LoggedInResult, RemoteSteamUserError> {
self.call_typed("/api/misc/logged_in", serde_json::json!({})).await
}
pub async fn get_notifications(&self) -> Result<Notifications, RemoteSteamUserError> {
self.call_typed("/api/misc/notifications", serde_json::json!({})).await
}
pub async fn get_web_api_key(&self, domain: &str) -> Result<String, RemoteSteamUserError> {
self.call_typed("/api/misc/web_api_key", serde_json::json!({"domain": domain})).await
}
pub async fn resolve_vanity_url(&self, api_key: &str, vanity_name: &str) -> Result<SteamID, RemoteSteamUserError> {
self.call_typed("/api/misc/resolve_vanity", serde_json::json!({"api_key": api_key, "vanity_name": vanity_name})).await
}
pub async fn get_client_js_token(&self) -> Result<serde_json::Value, RemoteSteamUserError> {
self.call("/api/misc/client_js_token", serde_json::json!({})).await
}
pub async fn revoke_web_api_key(&self) -> Result<(), RemoteSteamUserError> {
self.call_void("/api/misc/revoke_web_api_key", serde_json::json!({})).await
}
}