steam-user 0.1.0

Steam User web client for Rust - HTTP-based Steam Community interactions
Documentation
//! Steam group types.

use serde::{Deserialize, Serialize};
use steamid::SteamID;

/// Information about a Steam group.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GroupInfo {
    /// Group SteamID.
    pub steamid: SteamID,
    /// Group name.
    pub name: String,
    /// Group vanity URL.
    pub url: Option<String>,
    /// Group headline/tagline.
    pub headline: Option<String>,
    /// Group summary.
    pub summary: Option<String>,
    /// Member count.
    pub member_count: u32,
    /// Online member count.
    pub members_online: u32,
    /// In-game member count.
    pub members_in_game: u32,
    /// Avatar icon URL.
    pub avatar_icon: Option<String>,
    /// Avatar medium URL.
    pub avatar_medium: Option<String>,
    /// Avatar full URL.
    pub avatar_full: Option<String>,
}

/// A member in a group overview.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GroupOverviewMember {
    pub steamid: SteamID,
    pub name: String,
    pub avatar_hash: String,
    pub custom_url: Option<String>,
    pub rank: Option<String>,
}

/// Detailed overview of a Steam group.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GroupOverview {
    pub id: SteamID,
    pub name: String,
    pub url: Option<String>,
    pub headline: Option<String>,
    pub summary: Option<String>,
    pub avatar_hash: String,
    pub member_count: u32,
    pub member_detail_count: u32,
    pub members_online: u32,
    pub members_in_chat: u32,
    pub members_in_game: u32,
    pub total_pages: i32,
    pub current_page: i32,
    pub next_page: Option<i32>,
    pub next_page_link: Option<String>,
    pub members: Vec<GroupOverviewMember>,
    pub founded_str: Option<String>,
    pub language: Option<String>,
    pub location: Option<String>,
}

/// Options for fetching group overview.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct GroupOverviewOptions {
    pub group_url: Option<String>,
    pub gid: Option<SteamID>,
    pub page: i32,
    pub search_key: Option<String>,
}

/// A group announcement.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GroupAnnouncement {
    /// Announcement ID.
    pub aid: String,
    /// Headline/title.
    pub headline: String,
    /// Content (may contain HTML).
    pub content: String,
    /// Author username.
    pub author: Option<String>,
    /// Post date.
    pub date: String,
}

/// A group event.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GroupEvent {
    /// Event ID.
    pub event_id: String,
    /// Event name.
    pub name: String,
    /// Event type.
    pub event_type: String,
    /// Event description.
    pub description: String,
    /// App ID (for game events).
    pub appid: Option<u32>,
    /// Server IP (for game events).
    pub server_ip: Option<String>,
    /// Start time.
    pub start_time: Option<String>,
}

/// A group comment.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GroupComment {
    /// Comment ID.
    pub comment_id: String,
    /// Author name.
    pub author_name: String,
    /// Author profile ID.
    pub author_id: String,
    /// Post date.
    pub date: String,
    /// Comment text.
    pub text: String,
}

/// Group history entry.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GroupHistoryEntry {
    /// Type of action (Join, Leave, etc.).
    pub action_type: String,
    /// User who performed/received the action.
    pub user: Option<SteamID>,
    /// Actor (for actions like kicks/bans).
    pub actor: Option<SteamID>,
    /// When it happened.
    pub date: String,
}

/// Group information from XML API (memberslistxml endpoint).
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct GroupInfoXml {
    /// Group SteamID.
    pub id: SteamID,
    /// Group name.
    pub name: String,
    /// Group vanity URL.
    pub url: String,
    /// Group headline/tagline.
    pub headline: Option<String>,
    /// Group summary.
    pub summary: Option<String>,
    /// Avatar hash.
    pub avatar_hash: String,
    /// Total member count.
    pub member_count: u32,
    /// Detailed member count.
    pub member_detail_count: u32,
    /// Members in chat.
    pub members_in_chat: u32,
    /// Members in game.
    pub members_in_game: u32,
    /// Members online.
    pub members_online: u32,
    /// Total pages of members.
    pub total_pages: u32,
    /// Current page number.
    pub current_page: u32,
    /// Starting member index.
    pub starting_member: u32,
    /// Link to next page (if any).
    pub next_page_link: Option<String>,
    /// List of member SteamIDs on this page.
    pub members: Vec<SteamID>,
}

/// A group that a user can be invited to.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct InvitableGroup {
    /// Group SteamID.
    pub id: SteamID,
    /// Avatar hash.
    pub avatar_hash: Option<String>,
    /// Avatar URL.
    pub avatar_url: Option<String>,
    /// Group name.
    pub name: String,
}