amazon_spapi/models/feeds_2021_06_30/
feed.rs

1/*
2 * Selling Partner API for Feeds
3 *
4 * The Selling Partner API for Feeds lets you upload data to Amazon on behalf of a selling partner.
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/// Feed : Detailed information about the feed.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Feed {
17    /// The identifier for the feed. This identifier is unique only in combination with a seller ID.
18    #[serde(rename = "feedId")]
19    pub feed_id: String,
20    /// The feed type.
21    #[serde(rename = "feedType")]
22    pub feed_type: String,
23    /// A list of identifiers for the marketplaces that the feed is applied to.
24    #[serde(rename = "marketplaceIds", skip_serializing_if = "Option::is_none")]
25    pub marketplace_ids: Option<Vec<String>>,
26    /// The date and time when the feed was created, in ISO 8601 date time format.
27    #[serde(rename = "createdTime")]
28    pub created_time: String,
29    /// The processing status of the feed.
30    #[serde(rename = "processingStatus")]
31    pub processing_status: ProcessingStatus,
32    /// The date and time when feed processing started, in ISO 8601 date time format.
33    #[serde(rename = "processingStartTime", skip_serializing_if = "Option::is_none")]
34    pub processing_start_time: Option<String>,
35    /// The date and time when feed processing completed, in ISO 8601 date time format.
36    #[serde(rename = "processingEndTime", skip_serializing_if = "Option::is_none")]
37    pub processing_end_time: Option<String>,
38    /// The identifier for the feed document. This identifier is unique only in combination with a seller ID.
39    #[serde(rename = "resultFeedDocumentId", skip_serializing_if = "Option::is_none")]
40    pub result_feed_document_id: Option<String>,
41}
42
43impl Feed {
44    /// Detailed information about the feed.
45    pub fn new(feed_id: String, feed_type: String, created_time: String, processing_status: ProcessingStatus) -> Feed {
46        Feed {
47            feed_id,
48            feed_type,
49            marketplace_ids: None,
50            created_time,
51            processing_status,
52            processing_start_time: None,
53            processing_end_time: None,
54            result_feed_document_id: None,
55        }
56    }
57}
58/// The processing status of the feed.
59#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
60pub enum ProcessingStatus {
61    #[serde(rename = "CANCELLED")]
62    Cancelled,
63    #[serde(rename = "DONE")]
64    Done,
65    #[serde(rename = "FATAL")]
66    Fatal,
67    #[serde(rename = "IN_PROGRESS")]
68    InProgress,
69    #[serde(rename = "IN_QUEUE")]
70    InQueue,
71}
72
73impl Default for ProcessingStatus {
74    fn default() -> ProcessingStatus {
75        Self::Cancelled
76    }
77}
78