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
/*
 * Selling Partner API for Reports
 *
 * The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses.
 *
 * The version of the OpenAPI document: 2020-09-04
 * 
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Report {
    /// A list of marketplace identifiers for the report.
    #[serde(default, rename = "marketplaceIds", skip_serializing_if = "Option::is_none")]
    pub marketplace_ids: Option<Vec<String>>,
    /// The identifier for the report. This identifier is unique only in combination with a seller ID.
    #[serde(default, rename = "reportId")]
    pub report_id: String,
    /// The report type.
    #[serde(default, rename = "reportType")]
    pub report_type: String,
    /// The start of a date and time range used for selecting the data to report.
    #[serde(default, rename = "dataStartTime", skip_serializing_if = "Option::is_none")]
    pub data_start_time: Option<String>,
    /// The end of a date and time range used for selecting the data to report.
    #[serde(default, rename = "dataEndTime", skip_serializing_if = "Option::is_none")]
    pub data_end_time: Option<String>,
    /// The identifier of the report schedule that created this report (if any). This identifier is unique only in combination with a seller ID.
    #[serde(default, rename = "reportScheduleId", skip_serializing_if = "Option::is_none")]
    pub report_schedule_id: Option<String>,
    /// The date and time when the report was created.
    #[serde(default, rename = "createdTime")]
    pub created_time: String,
    /// The processing status of the report.
    #[serde(default, rename = "processingStatus")]
    pub processing_status: ProcessingStatus,
    /// The date and time when the report processing started, in ISO 8601 date time format.
    #[serde(default, rename = "processingStartTime", skip_serializing_if = "Option::is_none")]
    pub processing_start_time: Option<String>,
    /// The date and time when the report processing completed, in ISO 8601 date time format.
    #[serde(default, rename = "processingEndTime", skip_serializing_if = "Option::is_none")]
    pub processing_end_time: Option<String>,
    /// The identifier for the report document. Pass this into the getReportDocument operation to get the information you will need to retrieve and decrypt the report document's contents.
    #[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,
        }
    }
}

/// The processing status of the report.
#[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
    }
}