artifacts/models/
account_leaderboard_schema.rs

1use crate::models;
2use serde::{Deserialize, Serialize};
3
4#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
5#[cfg_attr(feature = "specta", derive(specta::Type))]
6pub struct AccountLeaderboardSchema {
7    /// Position in the leaderboard.
8    #[serde(rename = "position")]
9    pub position: i32,
10    /// Account name.
11    #[serde(rename = "account")]
12    pub account: String,
13    /// Member status.
14    #[serde(rename = "status")]
15    pub status: models::AccountStatus,
16    /// Achievements points.
17    #[serde(rename = "achievements_points")]
18    pub achievements_points: i32,
19    /// Gold in the account.
20    #[serde(rename = "gold")]
21    pub gold: i32,
22}
23
24impl AccountLeaderboardSchema {
25    pub fn new(
26        position: i32,
27        account: String,
28        status: models::AccountStatus,
29        achievements_points: i32,
30        gold: i32,
31    ) -> AccountLeaderboardSchema {
32        AccountLeaderboardSchema {
33            position,
34            account,
35            status,
36            achievements_points,
37            gold,
38        }
39    }
40}