use steamid::SteamID;
use super::super::{GasError, GasSteamUser};
use crate::types::{ActivityCommentResponse, FriendActivity, FriendActivityResponse};
impl GasSteamUser {
pub async fn get_friend_activity(&self, start: Option<u64>) -> Result<FriendActivityResponse, GasError> {
match start {
Some(s) => {
let v = s.to_string();
self.call("get_friend_activity", &[("start", &v)]).await
}
None => self.call("get_friend_activity", &[]).await,
}
}
pub async fn get_friend_activity_full(&self) -> Result<Vec<FriendActivity>, GasError> {
self.call("get_friend_activity_full", &[]).await
}
pub async fn comment_user_received_new_game(&self, steam_id: SteamID, thread_id: u64, comment: &str) -> Result<ActivityCommentResponse, GasError> {
let sid = steam_id.steam_id64().to_string();
let tid = thread_id.to_string();
self.call("comment_user_received_new_game", &[("steamId64", &sid), ("threadId", &tid), ("comment", comment)]).await
}
pub async fn rate_up_user_received_new_game(&self, steam_id: SteamID, thread_id: u64) -> Result<ActivityCommentResponse, GasError> {
let sid = steam_id.steam_id64().to_string();
let tid = thread_id.to_string();
self.call("rate_up_user_received_new_game", &[("steamId64", &sid), ("threadId", &tid)]).await
}
pub async fn delete_comment_user_received_new_game(&self, steam_id: SteamID, thread_id: u64, comment_id: &str) -> Result<ActivityCommentResponse, GasError> {
let sid = steam_id.steam_id64().to_string();
let tid = thread_id.to_string();
self.call("delete_comment_user_received_new_game", &[("steamId64", &sid), ("threadId", &tid), ("commentId", comment_id)]).await
}
}