1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#![allow(unused)]

use crate::prelude::*;

/// Endpoints for Industry
pub struct IndustryGroup<'a> {
    pub(crate) esi: &'a Esi,
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[allow(missing_docs)]
pub struct CostIndex {
    pub activity: String,
    pub cost_index: f64,
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[allow(missing_docs)]
pub struct IndustrialSystem {
    pub cost_indices: Vec<CostIndex>,
    pub solar_system_id: i32,
}

#[derive(Debug, Deserialize, Serialize, Clone)]
#[allow(missing_docs)]
pub struct IndustryJob {
    pub activity_id: i32,
    pub blueprint_id: i64,
    pub blueprint_location_id: i64,
    pub blueprint_type_id: i32,
    pub completed_character_id: Option<i32>,
    pub completed_date: Option<String>,
    pub cost: Option<f64>,
    pub duration: i32,
    pub end_date: String,
    pub facility_id: i64,
    pub installer_id: i32,
    pub job_id: i32,
    pub licensed_runs: Option<i32>,
    pub output_location_id: i64,
    pub pause_date: Option<String>,
    pub probability: Option<f64>,
    pub product_type_id: Option<i32>,
    pub runs: i32,
    pub start_date: String,
    pub station_id: i64,
    pub status: String,
    pub successful_runs: Option<i32>,
}

impl<'a> IndustryGroup<'a> {
    api_get!(
        /// Returns a list of solar systems with the cost index for every
        /// activity
        get_industry_systems,
        "get_industry_systems",
        RequestType::Public,
        Vec<IndustrialSystem>,
    );

    api_get!(
        /// List industry jobs placed by a character
        get_character_industry_jobs,
        "get_characters_character_id_industry_jobs",
        RequestType::Authenticated,
        Vec<IndustryJob>,
        (character_id: i32) => "{character_id}";
        Optional(include_completed: bool) => "include_completed"
    );
}