Skip to main content

amazon_spapi/models/reports_2021_06_30/
report.rs

1/*
2 * Selling Partner API for Reports
3 *
4 * The Selling Partner API for Reports lets you retrieve and manage a variety of reports that can help selling partners manage their businesses.
5 *
6 * The version of the OpenAPI document: 2021-06-30
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Report : Detailed information about the report.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Report {
17    /// A list of marketplace identifiers for the report.
18    #[serde(rename = "marketplaceIds", skip_serializing_if = "Option::is_none")]
19    pub marketplace_ids: Option<Vec<String>>,
20    /// The identifier for the report. This identifier is unique only in combination with a seller ID.
21    #[serde(rename = "reportId")]
22    pub report_id: String,
23    /// The report type. Refer to [Report Type Values](https://developer-docs.amazon.com/sp-api/docs/report-type-values) for more information.
24    #[serde(rename = "reportType")]
25    pub report_type: String,
26    /// The start of a date and time range used for selecting the data to report.
27    #[serde(rename = "dataStartTime", skip_serializing_if = "Option::is_none")]
28    pub data_start_time: Option<String>,
29    /// The end of a date and time range used for selecting the data to report.
30    #[serde(rename = "dataEndTime", skip_serializing_if = "Option::is_none")]
31    pub data_end_time: Option<String>,
32    /// The identifier of the report schedule that created this report (if any). This identifier is unique only in combination with a seller ID.
33    #[serde(rename = "reportScheduleId", skip_serializing_if = "Option::is_none")]
34    pub report_schedule_id: Option<String>,
35    /// The date and time when the report was created.
36    #[serde(rename = "createdTime")]
37    pub created_time: String,
38    /// The processing status of the report.
39    #[serde(rename = "processingStatus")]
40    pub processing_status: ProcessingStatus,
41    /// The date and time when the report processing started, in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> date time format.
42    #[serde(rename = "processingStartTime", skip_serializing_if = "Option::is_none")]
43    pub processing_start_time: Option<String>,
44    /// The date and time when the report processing completed, in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> date time format.
45    #[serde(rename = "processingEndTime", skip_serializing_if = "Option::is_none")]
46    pub processing_end_time: Option<String>,
47    /// The identifier for the report document. Pass this into the `getReportDocument` operation to get the information you will need to retrieve the report document's contents.
48    #[serde(rename = "reportDocumentId", skip_serializing_if = "Option::is_none")]
49    pub report_document_id: Option<String>,
50}
51
52impl Report {
53    /// Detailed information about the report.
54    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/// The processing status of the report.
71#[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