use serde::{Deserialize, Serialize};
use steamid::SteamID;
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[non_exhaustive]
#[derive(Default)]
pub enum ActivityType {
NewFriend,
PlayedFirstTime,
Achieved,
AddedToWishlist,
Following,
Joined,
GamePurchase,
WorkshopItemPublished,
Recommendation,
UserStatus,
Screenshot,
VideoPublished,
#[default]
DailyRollup,
Unknown(String),
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ActivityPlayer {
pub name: String,
pub nickname: Option<String>,
pub miniprofile: u64,
pub steam_id: SteamID,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ActivityApp {
pub id: u32,
pub name: String,
pub link: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ActivityAchievement {
pub title: String,
pub img: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ActivityGroup {
pub name: String,
pub link: String,
pub url: String,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ActivityComment {
pub id: String,
pub author_steam_id: SteamID,
pub author_miniprofile: u64,
pub author_avatar_hash: String,
pub timestamp: u64,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ActivityAuthor {
pub name: String,
pub nickname: Option<String>,
pub avatar_hash: String,
pub miniprofile: u64,
pub steam_id: SteamID,
pub profile_url: String,
pub custom_url: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct FriendActivity {
pub activity_type: ActivityType,
pub timestamp: u64,
pub header_date: String,
pub players: Vec<ActivityPlayer>,
pub apps: Vec<ActivityApp>,
pub groups: Vec<ActivityGroup>,
pub achieved: Vec<ActivityAchievement>,
pub author: Option<ActivityAuthor>,
pub thread_id: Option<u64>,
pub comments: Vec<ActivityComment>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct FriendActivityResponse {
pub activities: Vec<FriendActivity>,
pub next_request_timestart: Option<u64>,
pub next_request_url: Option<String>,
}
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ActivityCommentResponse {
pub success: bool,
pub total_count: u32,
pub upvotes: u32,
pub has_upvoted: bool,
}