Skip to main content

esi_openapi/groups/
universe.rs

1#![allow(unused)]
2
3use crate::prelude::*;
4
5/// Endpoints for Universe
6pub struct UniverseGroup<'a> {
7    pub(crate) esi: &'a Esi,
8}
9
10#[derive(Debug, Deserialize, Serialize, Clone)]
11#[allow(missing_docs)]
12pub struct Position {
13    pub x: f64,
14    pub y: f64,
15    pub z: f64,
16}
17
18#[derive(Debug, Deserialize, Serialize, Clone)]
19#[allow(missing_docs)]
20pub struct Constellation {
21    pub constellation_id: i32,
22    pub name: String,
23    pub position: Position,
24    pub region_id: i32,
25    pub systems: Vec<i32>,
26}
27
28#[derive(Debug, Deserialize, Serialize, Clone)]
29#[allow(missing_docs)]
30pub struct Region {
31    pub constellations: Vec<i32>,
32    pub description: Option<String>,
33    pub name: String,
34    pub region_id: i32,
35}
36
37#[derive(Debug, Deserialize, Serialize, Clone)]
38#[allow(missing_docs)]
39pub struct SystemPlanet {
40    pub asteroid_belts: Option<Vec<i32>>,
41    pub moons: Option<Vec<i32>>,
42    pub planet_id: i32,
43}
44
45#[derive(Debug, Deserialize, Serialize, Clone)]
46#[allow(missing_docs)]
47pub struct System {
48    pub constellation_id: i32,
49    pub name: String,
50    pub planets: Option<Vec<SystemPlanet>>,
51    pub position: Position,
52    pub security_class: Option<String>,
53    pub security_status: f64,
54    pub star_id: Option<i32>,
55    pub stargates: Option<Vec<i32>>,
56    pub stations: Option<Vec<i32>>,
57    pub system_id: i32,
58}
59
60#[derive(Debug, Deserialize)]
61#[allow(missing_docs)]
62pub struct Ids {
63    pub characters: Option<Vec<Category>>,
64    pub alliances: Option<Vec<Category>>,
65    pub constellations: Option<Vec<Category>>,
66    pub agents: Option<Vec<Category>>,
67    pub regions: Option<Vec<Category>>,
68    pub systems: Option<Vec<Category>>,
69    pub stations: Option<Vec<Category>>,
70}
71
72#[derive(Debug, Deserialize)]
73#[allow(missing_docs)]
74pub struct Category {
75    pub id: i32,
76    pub name: String,
77}
78
79#[derive(Debug, Deserialize, Serialize, Clone)]
80#[allow(missing_docs)]
81pub struct TypeDogmaAttribute {
82    pub attribute_id: i32,
83    pub value: f64,
84}
85
86#[derive(Debug, Deserialize, Serialize, Clone)]
87#[allow(missing_docs)]
88pub struct TypeDogmaEffect {
89    pub effect_id: i32,
90    pub is_default: bool,
91}
92
93#[derive(Debug, Deserialize, Serialize, Clone)]
94#[allow(missing_docs)]
95pub struct Type {
96    pub capacity: Option<f64>,
97    pub description: String,
98    pub dogma_attributes: Option<Vec<TypeDogmaAttribute>>,
99    pub dogma_effects: Option<Vec<TypeDogmaEffect>>,
100    pub graphic_id: Option<i32>,
101    pub group_id: i32,
102    pub icon_id: Option<i32>,
103    pub market_group_id: Option<i32>,
104    pub mass: Option<f64>,
105    pub name: String,
106    pub packaged_volume: Option<f64>,
107    pub portion_size: Option<i32>,
108    pub published: bool,
109    pub radius: Option<f64>,
110    pub type_id: i32,
111    pub volume: Option<f64>,
112}
113
114#[derive(Debug, Deserialize, Serialize, Clone)]
115#[allow(missing_docs)]
116pub struct Station {
117    pub max_dockable_ship_volume: f64,
118    pub name: String,
119    pub office_rental_cost: f64,
120    pub owner: Option<i32>,
121    pub position: Position,
122    pub race_id: Option<i32>,
123    pub reprocessing_efficiency: f64,
124    pub reprocessing_stations_take: f64,
125    pub services: Vec<String>,
126    pub station_id: i32,
127    pub system_id: i32,
128    pub type_id: i32,
129}
130
131#[derive(Debug, Deserialize, Serialize, Clone)]
132#[allow(missing_docs)]
133pub struct Structure {
134    pub name: String,
135    pub owner_id: i32,
136    pub position: Option<Position>,
137    pub solar_system_id: i32,
138    pub type_id: Option<i32>,
139}
140
141#[derive(Debug, Deserialize, Serialize, Clone)]
142#[allow(missing_docs)]
143pub struct CategoriesCategory {
144    pub category_id: i32,
145    pub groups: Vec<i32>,
146    pub name: String,
147    pub published: bool,
148}
149
150#[derive(Debug, Deserialize, Serialize, Clone)]
151#[allow(missing_docs)]
152pub struct Group {
153    pub category_id: i32,
154    pub group_id: i32,
155    pub name: String,
156    pub published: bool,
157    pub types: Vec<i32>,
158}
159
160impl UniverseGroup<'_> {
161    api_get!(
162        /// Get information on a category
163        get_universe_categories_category,
164        "GetUniverseCategoriesCategoryId",
165        RequestType::Public,
166        CategoriesCategory,
167        (category_id: i32) => "{category_id}"
168    );
169
170    api_get!(
171        /// Get information on a group
172        get_universe_groups_group,
173        "GetUniverseGroupsGroupId",
174        RequestType::Public,
175        Group,
176        (group_id: i32) => "{group_id}"
177    );
178
179    api_get!(
180        /// Get information on a type
181        get_universe_types_type,
182        "GetUniverseTypesTypeId",
183        RequestType::Public,
184        Type,
185        (type_id: i32) => "{type_id}"
186    );
187
188    api_get!(
189        /// Get a list of constellation ids
190        get_constellation_ids,
191        "GetUniverseConstellations",
192        RequestType::Public,
193        Vec<i32>,
194    );
195
196    api_get!(
197        /// Get information on a constellation
198        get_constellation,
199        "GetUniverseConstellationsConstellationId",
200        RequestType::Public,
201        Constellation,
202        (constellation_id: i32) => "{constellation_id}"
203    );
204
205    api_get!(
206        /// Get a list of region ids
207        get_region_ids,
208        "GetUniverseRegions",
209        RequestType::Public,
210        Vec<i32>,
211    );
212
213    api_get!(
214        /// Get information on a region
215        get_region,
216        "GetUniverseRegionsRegionId",
217        RequestType::Public,
218        Region,
219        (region_id: i32) => "{region_id}"
220    );
221
222    api_get!(
223        /// Get a list of system ids
224        get_system_ids,
225        "GetUniverseSystems",
226        RequestType::Public,
227        Vec<i32>,
228    );
229
230    api_get!(
231        /// Get information on a system
232        get_system,
233        "GetUniverseSystemsSystemId",
234        RequestType::Public,
235        System,
236        (system_id: i32) => "{system_id}"
237    );
238
239    api_get!(
240        /// Get a list of type ids
241        get_type_ids,
242        "GetUniverseTypes",
243        RequestType::Public,
244        Vec<i32>,
245    );
246
247    api_get!(
248        /// Get information on a type
249        get_type,
250        "GetUniverseTypesTypeId",
251        RequestType::Public,
252        Type,
253        (type_id: i32) => "{type_id}"
254    );
255
256    api_get!(
257        /// Information about a station
258        get_station,
259        "GetUniverseStationsStationId",
260        RequestType::Public,
261        Station,
262        (station_id: i32) => "{station_id}"
263    );
264
265    api_get!(
266        /// Returns information on requested structure if you are on the ACL. Otherwise, returns “Forbidden” for all inputs.
267        get_structure,
268        "GetUniverseStructuresStructureId",
269        RequestType::Authenticated,
270        Structure,
271        (structure_id: i64) => "{structure_id}"
272    );
273
274    api_post!(
275        /// Get IDs from a list of names
276        get_ids,
277        "PostUniverseIds",
278        RequestType::Public,
279        Ids,
280        ,
281        names: &[&str],
282    );
283}