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
/*
 * Selling Partner API for Retail Procurement Orders
 *
 * The Selling Partner API for Retail Procurement Orders provides programmatic access to vendor orders data.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

/// OrderStatus : Current status of a purchase order.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct OrderStatus {
    /// The buyer's purchase order number for this order. Formatting Notes: 8-character alpha-numeric code.
    #[serde(default, rename = "purchaseOrderNumber")]
    pub purchase_order_number: String,
    /// The status of the buyer's purchase order for this order.
    #[serde(default, rename = "purchaseOrderStatus")]
    pub purchase_order_status: PurchaseOrderStatus,
    /// The date the purchase order was placed. Must be in ISO-8601 date/time format.
    #[serde(default, rename = "purchaseOrderDate")]
    pub purchase_order_date: String,
    /// The date when the purchase order was last updated. Must be in ISO-8601 date/time format.
    #[serde(default, rename = "lastUpdatedDate", skip_serializing_if = "Option::is_none")]
    pub last_updated_date: Option<String>,
    #[serde(default, rename = "sellingParty")]
    pub selling_party: Box<crate::models::PartyIdentification>,
    #[serde(default, rename = "shipToParty")]
    pub ship_to_party: Box<crate::models::PartyIdentification>,
    /// Detailed description of items order status.
    #[serde(default, rename = "itemStatus")]
    pub item_status: Vec<crate::models::OrderItemStatus>,
}

impl OrderStatus {
    /// Current status of a purchase order.
    pub fn new(purchase_order_number: String, purchase_order_status: PurchaseOrderStatus, purchase_order_date: String, selling_party: crate::models::PartyIdentification, ship_to_party: crate::models::PartyIdentification, item_status: Vec<crate::models::OrderItemStatus>) -> OrderStatus {
        OrderStatus {
            purchase_order_number,
            purchase_order_status,
            purchase_order_date,
            last_updated_date: None,
            selling_party: Box::new(selling_party),
            ship_to_party: Box::new(ship_to_party),
            item_status,
        }
    }
}

/// The status of the buyer's purchase order for this order.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PurchaseOrderStatus {
    #[serde(rename = "OPEN")]
    OPEN,
    #[serde(rename = "CLOSED")]
    CLOSED,
}

impl Default for PurchaseOrderStatus {
    fn default() -> PurchaseOrderStatus {
        Self::OPEN
    }
}