use steamid::SteamID;
use super::super::{GasError, GasSteamUser};
use crate::types::{LoggedInResult, Notifications};
impl GasSteamUser {
pub async fn logged_in(&self) -> Result<LoggedInResult, GasError> {
self.call("logged_in", &[]).await
}
pub async fn get_notifications(&self) -> Result<Notifications, GasError> {
self.call("get_notifications", &[]).await
}
pub async fn get_web_api_key(&self, domain: &str) -> Result<String, GasError> {
self.call("get_web_api_key", &[("domain", domain)]).await
}
pub async fn resolve_vanity_url(&self, api_key: &str, vanity_name: &str) -> Result<SteamID, GasError> {
self.call("resolve_vanity_url", &[("apiKey", api_key), ("vanityName", vanity_name)]).await
}
pub async fn revoke_web_api_key(&self) -> Result<(), GasError> {
self.call_void("revoke_web_api_key", &[]).await
}
pub async fn redeem_points(&self, definition_id: u32) -> Result<steam_protos::messages::loyalty_rewards::CLoyaltyRewardsRedeemPointsResponse, GasError> {
let def = definition_id.to_string();
self.call("redeem_points", &[("definitionId", &def)]).await
}
}