poe_types/
pvp.rs

1use serde::{Deserialize, Serialize};
2
3use super::account::Account;
4
5#[derive(Debug, Default, Clone, Deserialize, Serialize)]
6pub enum PvpStyle {
7    Blitz,
8    Swiss,
9    #[default]
10    Arena,
11}
12
13#[derive(Debug, Default, Clone, Deserialize, Serialize)]
14#[serde(rename_all = "camelCase")]
15pub struct PvpMatch {
16    pub id: String,
17    pub realm: Option<String>,
18    pub start_at: Option<String>,
19    pub end_at: Option<String>,
20    pub url: Option<String>,
21    pub description: String,
22    pub glicko_ratings: bool,
23    pub pvp: bool,
24    pub style: PvpStyle,
25    pub register_at: Option<String>,
26    pub complete: Option<bool>,
27    pub upcoming: Option<bool>,
28    pub in_progress: Option<bool>,
29}
30
31#[derive(Debug, Default, Clone, Deserialize, Serialize)]
32pub struct PvpLadderTeamEntry {
33    pub rank: usize,
34    pub rating: Option<usize>,
35    pub points: Option<usize>,
36    pub games_played: Option<usize>,
37    pub cumulative_opponent_points: Option<usize>,
38    pub last_game_time: Option<String>,
39    pub members: Vec<PvpLadderTeamMember>,
40}
41
42#[derive(Debug, Default, Clone, Deserialize, Serialize)]
43pub struct PvpLadderTeamMember {
44    pub account: Account,
45    pub character: PvpCharacter,
46    pub public: Option<bool>,
47}
48
49#[derive(Debug, Default, Clone, Deserialize, Serialize)]
50pub struct PvpCharacter {
51    pub id: String,
52    pub name: String,
53    pub level: usize,
54    pub class: String,
55    pub league: Option<String>,
56    pub score: Option<usize>,
57}