Skip to main content

esi_openapi/groups/
faction_warfare.rs

1use crate::prelude::*;
2
3/// Endpoints for FactionWarfare
4pub struct FactionWarfareGroup<'a> {
5    pub(crate) esi: &'a Esi,
6}
7
8#[derive(Debug, Deserialize)]
9#[allow(missing_docs)]
10pub struct FactionLeaderboardItem {
11    pub amount: Option<i32>,
12    pub faction_id: Option<i32>,
13}
14
15#[derive(Debug, Deserialize)]
16#[allow(missing_docs)]
17pub struct FactionLeaderboardListing {
18    pub active_total: Vec<FactionLeaderboardItem>,
19    pub last_week: Vec<FactionLeaderboardItem>,
20    pub yesterday: Vec<FactionLeaderboardItem>,
21}
22
23#[derive(Debug, Deserialize)]
24#[allow(missing_docs)]
25pub struct FWLeaderboards {
26    pub kills: FactionLeaderboardListing,
27    pub victory_points: FactionLeaderboardListing,
28}
29
30#[derive(Debug, Deserialize)]
31#[allow(missing_docs)]
32pub struct CharacterLeaderboardItem {
33    pub amount: i32,
34    pub character_id: i32,
35}
36
37#[derive(Debug, Deserialize)]
38#[allow(missing_docs)]
39pub struct CharacterLeaderboardListing {
40    pub active_total: Vec<CharacterLeaderboardItem>,
41    pub last_week: Vec<CharacterLeaderboardItem>,
42    pub yesterday: Vec<CharacterLeaderboardItem>,
43}
44
45#[derive(Debug, Deserialize)]
46#[allow(missing_docs)]
47pub struct FWCharacterLeaderboards {
48    pub kills: CharacterLeaderboardListing,
49    pub victory_points: CharacterLeaderboardListing,
50}
51
52#[derive(Debug, Deserialize)]
53#[allow(missing_docs)]
54pub struct CorporationLeaderboardItem {
55    pub amount: i32,
56    pub corporation_id: i32,
57}
58
59#[derive(Debug, Deserialize)]
60#[allow(missing_docs)]
61pub struct CorporationLeaderboardListing {
62    pub active_total: Vec<CorporationLeaderboardItem>,
63    pub last_week: Vec<CorporationLeaderboardItem>,
64    pub yesterday: Vec<CorporationLeaderboardItem>,
65}
66
67#[derive(Debug, Deserialize)]
68#[allow(missing_docs)]
69pub struct FWCorporationLeaderboards {
70    pub kills: CorporationLeaderboardListing,
71    pub victory_points: CorporationLeaderboardListing,
72}
73
74#[derive(Debug, Deserialize)]
75#[allow(missing_docs)]
76pub struct FWStatsItemRange {
77    pub total: i32,
78    pub last_week: i32,
79    pub yesterday: i32,
80}
81
82#[derive(Debug, Deserialize)]
83#[allow(missing_docs)]
84pub struct FWStatsItem {
85    pub faction_id: u32,
86    pub kills: FWStatsItemRange,
87    pub pilots: u32,
88    pub systems_controlled: u32,
89    pub victory_points: FWStatsItemRange,
90}
91
92#[derive(Debug, Deserialize)]
93#[allow(missing_docs)]
94pub struct FWSystem {
95    pub contested: String,
96    pub occupier_faction_id: u8,
97    pub owner_faction_id: u32,
98    pub solar_system_id: u32,
99    pub victory_points: u32,
100    pub victory_points_threshold: u32,
101}
102
103#[derive(Debug, Deserialize)]
104#[allow(missing_docs)]
105pub struct FWWar {
106    pub faction_id: i32,
107    pub against_id: i32,
108}
109
110impl FactionWarfareGroup<'_> {
111    api_get!(
112        /// Get the top 4 leaderboards of factions for total, last week, and yesterday.
113        leaderboards,
114        "GetFwLeaderboards",
115        RequestType::Public,
116        FWLeaderboards,
117    );
118
119    api_get!(
120        /// Get top 100 characters for total, last week, and yesterday.
121        leaderboard_characters,
122        "GetFwLeaderboardsCharacters",
123        RequestType::Public,
124        FWCharacterLeaderboards,
125    );
126
127    api_get!(
128        /// Get top 10 corporations for total, last week, and yesterday.
129        leaderboard_corporations,
130        "GetFwLeaderboardsCorporations",
131        RequestType::Public,
132        FWCorporationLeaderboards,
133    );
134
135    api_get!(
136        /// Get FW overview stats.
137        stats,
138        "GetFwStats",
139        RequestType::Public,
140        Vec<FWStatsItem>,
141    );
142
143    api_get!(
144        /// Get FW system ownership.
145        systems,
146        "GetFwSystems",
147        RequestType::Public,
148        Vec<FWSystem>,
149    );
150
151    api_get!(
152        /// Get FW faction information.
153        wars,
154        "GetFwWars",
155        RequestType::Public,
156        Vec<FWWar>,
157    );
158
159    // more endpoints ...
160}