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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Report {
#[serde(default, rename = "marketplaceIds", skip_serializing_if = "Option::is_none")]
pub marketplace_ids: Option<Vec<String>>,
#[serde(default, rename = "reportId")]
pub report_id: String,
#[serde(default, rename = "reportType")]
pub report_type: String,
#[serde(default, rename = "dataStartTime", skip_serializing_if = "Option::is_none")]
pub data_start_time: Option<String>,
#[serde(default, rename = "dataEndTime", skip_serializing_if = "Option::is_none")]
pub data_end_time: Option<String>,
#[serde(default, rename = "reportScheduleId", skip_serializing_if = "Option::is_none")]
pub report_schedule_id: Option<String>,
#[serde(default, rename = "createdTime")]
pub created_time: String,
#[serde(default, rename = "processingStatus")]
pub processing_status: ProcessingStatus,
#[serde(default, rename = "processingStartTime", skip_serializing_if = "Option::is_none")]
pub processing_start_time: Option<String>,
#[serde(default, rename = "processingEndTime", skip_serializing_if = "Option::is_none")]
pub processing_end_time: Option<String>,
#[serde(default, rename = "reportDocumentId", skip_serializing_if = "Option::is_none")]
pub report_document_id: Option<String>,
}
impl Report {
pub fn new(report_id: String, report_type: String, created_time: String, processing_status: ProcessingStatus) -> Report {
Report {
marketplace_ids: None,
report_id,
report_type,
data_start_time: None,
data_end_time: None,
report_schedule_id: None,
created_time,
processing_status,
processing_start_time: None,
processing_end_time: None,
report_document_id: None,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum ProcessingStatus {
#[serde(rename = "CANCELLED")]
CANCELLED,
#[serde(rename = "DONE")]
DONE,
#[serde(rename = "FATAL")]
FATAL,
#[serde(rename = "IN_PROGRESS")]
INPROGRESS,
#[serde(rename = "IN_QUEUE")]
INQUEUE,
}
impl Default for ProcessingStatus {
fn default() -> ProcessingStatus {
Self::CANCELLED
}
}