1use crate::Isk;
2use chrono::{DateTime, Utc};
3use serde::{Deserialize, Serialize};
4
5#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct EsiContract {
8 pub contract_id: i64,
9 pub issuer_id: i64,
10 pub issuer_corporation_id: i64,
11 #[serde(default)]
12 pub assignee_id: Option<i64>,
13 #[serde(default)]
14 pub acceptor_id: Option<i64>,
15 #[serde(rename = "type")]
16 pub contract_type: String,
17 pub status: String,
18 pub availability: String,
19 pub date_issued: DateTime<Utc>,
20 pub date_expired: DateTime<Utc>,
21 pub for_corporation: bool,
22 #[serde(default)]
23 pub title: Option<String>,
24 #[serde(default)]
25 pub date_accepted: Option<DateTime<Utc>>,
26 #[serde(default)]
27 pub date_completed: Option<DateTime<Utc>>,
28 #[serde(default)]
29 pub price: Option<Isk>,
30 #[serde(default)]
31 pub reward: Option<Isk>,
32 #[serde(default)]
33 pub collateral: Option<Isk>,
34 #[serde(default)]
35 pub buyout: Option<Isk>,
36 #[serde(default)]
37 pub volume: Option<f64>,
38 #[serde(default)]
39 pub days_to_complete: Option<i32>,
40 #[serde(default)]
41 pub start_location_id: Option<i64>,
42 #[serde(default)]
43 pub end_location_id: Option<i64>,
44}
45
46#[derive(Debug, Clone, Serialize, Deserialize)]
48pub struct EsiContractItem {
49 pub record_id: i64,
50 pub type_id: i32,
51 pub quantity: i32,
52 pub is_included: bool,
53 #[serde(default)]
54 pub is_singleton: Option<bool>,
55 #[serde(default)]
56 pub raw_quantity: Option<i32>,
57}
58
59#[derive(Debug, Clone, Serialize, Deserialize)]
61pub struct EsiContractBid {
62 pub bid_id: i64,
63 pub bidder_id: i64,
64 pub date_bid: DateTime<Utc>,
65 pub amount: Isk,
66}
67
68#[derive(Debug, Clone, Serialize, Deserialize)]
70pub struct EsiFitting {
71 pub fitting_id: i64,
72 pub name: String,
73 pub description: String,
74 pub ship_type_id: i32,
75 #[serde(default)]
76 pub items: Vec<EsiFittingItem>,
77}
78
79#[derive(Debug, Clone, Serialize, Deserialize)]
81pub struct EsiFittingItem {
82 pub type_id: i32,
83 pub flag: i32,
84 pub quantity: i32,
85}
86
87#[derive(Debug, Clone, Serialize)]
89pub struct EsiNewFitting {
90 pub name: String,
91 pub description: String,
92 pub ship_type_id: i32,
93 pub items: Vec<EsiFittingItem>,
94}
95
96#[derive(Debug, Clone, Serialize, Deserialize)]
98pub struct EsiNewFittingResponse {
99 pub fitting_id: i64,
100}
101
102#[derive(Debug, Clone, Serialize, Deserialize)]
104pub struct EsiMailHeader {
105 pub mail_id: i64,
106 pub timestamp: DateTime<Utc>,
107 #[serde(default)]
108 pub from: Option<i64>,
109 #[serde(default)]
110 pub subject: Option<String>,
111 #[serde(default)]
112 pub is_read: Option<bool>,
113 #[serde(default)]
114 pub labels: Vec<i32>,
115 #[serde(default)]
116 pub recipients: Vec<EsiMailRecipient>,
117}
118
119#[derive(Debug, Clone, Serialize, Deserialize)]
121pub struct EsiMailRecipient {
122 pub recipient_id: i64,
123 pub recipient_type: String,
124}
125
126#[derive(Debug, Clone, Serialize, Deserialize)]
128pub struct EsiMailBody {
129 #[serde(default)]
130 pub body: Option<String>,
131 #[serde(default)]
132 pub from: Option<i64>,
133 #[serde(default)]
134 pub read: Option<bool>,
135 #[serde(default)]
136 pub subject: Option<String>,
137 #[serde(default)]
138 pub timestamp: Option<DateTime<Utc>>,
139 #[serde(default)]
140 pub labels: Vec<i32>,
141 #[serde(default)]
142 pub recipients: Vec<EsiMailRecipient>,
143}
144
145#[derive(Debug, Clone, Serialize)]
147pub struct EsiNewMail {
148 pub recipients: Vec<EsiMailRecipient>,
149 pub subject: String,
150 pub body: String,
151 #[serde(skip_serializing_if = "Option::is_none")]
152 pub approved_cost: Option<i64>,
153}
154
155#[derive(Debug, Clone, Serialize, Deserialize)]
157pub struct EsiMailLabels {
158 pub total_unread_count: i32,
159 #[serde(default)]
160 pub labels: Vec<EsiMailLabel>,
161}
162
163#[derive(Debug, Clone, Serialize, Deserialize)]
165pub struct EsiMailLabel {
166 pub label_id: i32,
167 pub name: String,
168 #[serde(default)]
169 pub color: Option<String>,
170 #[serde(default)]
171 pub unread_count: Option<i32>,
172}
173
174#[derive(Debug, Clone, Serialize, Deserialize)]
176pub struct EsiNotification {
177 pub notification_id: i64,
178 #[serde(rename = "type")]
179 pub notification_type: String,
180 pub sender_id: i64,
181 pub sender_type: String,
182 pub timestamp: DateTime<Utc>,
183 #[serde(default)]
184 pub is_read: Option<bool>,
185 #[serde(default)]
186 pub text: Option<String>,
187}
188
189#[derive(Debug, Clone, Serialize, Deserialize)]
191pub struct EsiContact {
192 pub contact_id: i64,
193 pub contact_type: String,
194 pub standing: f64,
195 #[serde(default)]
196 pub label_ids: Vec<i64>,
197 #[serde(default)]
198 pub is_watched: Option<bool>,
199}
200
201#[derive(Debug, Clone, Serialize, Deserialize)]
203pub struct EsiContactLabel {
204 pub label_id: i64,
205 pub label_name: String,
206}
207
208#[derive(Debug, Clone, Serialize, Deserialize)]
210pub struct EsiCalendarEvent {
211 pub event_id: i64,
212 pub event_date: DateTime<Utc>,
213 pub title: String,
214 #[serde(default)]
215 pub importance: Option<i32>,
216 #[serde(default)]
217 pub event_response: Option<String>,
218}
219
220#[derive(Debug, Clone, Serialize, Deserialize)]
222pub struct EsiCalendarEventDetail {
223 pub event_id: i64,
224 pub date: DateTime<Utc>,
225 pub title: String,
226 pub owner_id: i64,
227 pub owner_name: String,
228 pub owner_type: String,
229 pub duration: i32,
230 #[serde(default)]
231 pub text: Option<String>,
232 #[serde(default)]
233 pub importance: Option<i32>,
234 #[serde(default)]
235 pub response: Option<String>,
236}
237
238#[derive(Debug, Clone, Serialize, Deserialize)]
240pub struct EsiEventAttendee {
241 pub character_id: i64,
242 #[serde(default)]
243 pub event_response: Option<String>,
244}
245
246#[derive(Debug, Clone, Serialize)]
248pub struct EsiEventResponse {
249 pub response: String,
250}
251
252#[derive(Debug, Clone, Serialize)]
254pub struct EsiNewMailLabel {
255 pub name: String,
256 #[serde(skip_serializing_if = "Option::is_none")]
257 pub color: Option<String>,
258}
259
260#[derive(Debug, Clone, Serialize, Deserialize)]
262pub struct EsiMailingList {
263 pub mailing_list_id: i64,
264 pub name: String,
265}
266
267#[derive(Debug, Clone, Serialize)]
269pub struct EsiMailUpdate {
270 #[serde(skip_serializing_if = "Option::is_none")]
271 pub read: Option<bool>,
272 #[serde(skip_serializing_if = "Option::is_none")]
273 pub labels: Option<Vec<i32>>,
274}
275
276#[derive(Debug, Clone, Serialize)]
278pub struct EsiNewMailWindow {
279 pub recipients: Vec<i64>,
280 pub subject: String,
281 pub body: String,
282 #[serde(skip_serializing_if = "Option::is_none")]
283 pub to_corp_or_alliance_id: Option<i64>,
284 #[serde(skip_serializing_if = "Option::is_none")]
285 pub to_mailing_list_id: Option<i64>,
286}