amazon_spapi/models/reports_2021_06_30/
report.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Report {
17 #[serde(rename = "marketplaceIds", skip_serializing_if = "Option::is_none")]
19 pub marketplace_ids: Option<Vec<String>>,
20 #[serde(rename = "reportId")]
22 pub report_id: String,
23 #[serde(rename = "reportType")]
25 pub report_type: String,
26 #[serde(rename = "dataStartTime", skip_serializing_if = "Option::is_none")]
28 pub data_start_time: Option<String>,
29 #[serde(rename = "dataEndTime", skip_serializing_if = "Option::is_none")]
31 pub data_end_time: Option<String>,
32 #[serde(rename = "reportScheduleId", skip_serializing_if = "Option::is_none")]
34 pub report_schedule_id: Option<String>,
35 #[serde(rename = "createdTime")]
37 pub created_time: String,
38 #[serde(rename = "processingStatus")]
40 pub processing_status: ProcessingStatus,
41 #[serde(rename = "processingStartTime", skip_serializing_if = "Option::is_none")]
43 pub processing_start_time: Option<String>,
44 #[serde(rename = "processingEndTime", skip_serializing_if = "Option::is_none")]
46 pub processing_end_time: Option<String>,
47 #[serde(rename = "reportDocumentId", skip_serializing_if = "Option::is_none")]
49 pub report_document_id: Option<String>,
50}
51
52impl Report {
53 pub fn new(report_id: String, report_type: String, created_time: String, processing_status: ProcessingStatus) -> Report {
55 Report {
56 marketplace_ids: None,
57 report_id,
58 report_type,
59 data_start_time: None,
60 data_end_time: None,
61 report_schedule_id: None,
62 created_time,
63 processing_status,
64 processing_start_time: None,
65 processing_end_time: None,
66 report_document_id: None,
67 }
68 }
69}
70#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
72pub enum ProcessingStatus {
73 #[serde(rename = "CANCELLED")]
74 Cancelled,
75 #[serde(rename = "DONE")]
76 Done,
77 #[serde(rename = "FATAL")]
78 Fatal,
79 #[serde(rename = "IN_PROGRESS")]
80 InProgress,
81 #[serde(rename = "IN_QUEUE")]
82 InQueue,
83}
84
85impl Default for ProcessingStatus {
86 fn default() -> ProcessingStatus {
87 Self::Cancelled
88 }
89}
90