gw2lib_model/authenticated/
account.rs1pub mod bank;
2pub mod inventory;
3pub mod materials;
4pub mod raids;
5pub mod wallet;
6
7use std::collections::BTreeSet;
8
9use serde::{Deserialize, Serialize};
10
11pub use crate::misc::worlds::WorldId;
12use crate::*;
13
14#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
15#[cfg_attr(test, serde(deny_unknown_fields))]
16#[non_exhaustive]
17pub enum Access {
18 None,
19 PlayForFree,
20 GuildWars2,
21 HeartOfThorns,
22 PathOfFire,
23 EndOfDragons,
24 SecretsOfTheObscure,
25 JanthirWilds,
26}
27
28#[derive(Clone, Debug, Serialize, Deserialize)]
29#[cfg_attr(test, serde(deny_unknown_fields))]
30pub struct Account {
31 pub id: String,
32 pub age: u64,
33 pub name: String,
34 pub world: WorldId,
35 pub guilds: Vec<String>,
36 pub guild_leader: Option<Vec<String>>,
37 pub created: TimeStamp,
38 pub access: BTreeSet<Access>,
39 pub commander: bool,
40 pub fractal_level: Option<u8>,
41 pub daily_ap: Option<u16>,
42 pub monthly_ap: Option<u16>,
43 pub wvw_rank: Option<u16>,
44 pub last_modified: String,
45}
46
47impl Endpoint for Account {
48 const AUTHENTICATED: bool = true;
49 const LOCALE: bool = false;
50 const URL: &'static str = "v2/account";
51 const VERSION: &'static str = "2022-07-22T00:00:00.000Z";
52}
53
54impl FixedEndpoint for Account {}