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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct OrderDetails {
#[serde(default, rename = "purchaseOrderDate")]
pub purchase_order_date: String,
#[serde(default, rename = "purchaseOrderChangedDate", skip_serializing_if = "Option::is_none")]
pub purchase_order_changed_date: Option<String>,
#[serde(default, rename = "purchaseOrderStateChangedDate")]
pub purchase_order_state_changed_date: String,
#[serde(default, rename = "purchaseOrderType", skip_serializing_if = "Option::is_none")]
pub purchase_order_type: Option<PurchaseOrderType>,
#[serde(default, rename = "importDetails", skip_serializing_if = "Option::is_none")]
pub import_details: Option<Box<crate::models::ImportDetails>>,
#[serde(default, rename = "dealCode", skip_serializing_if = "Option::is_none")]
pub deal_code: Option<String>,
#[serde(default, rename = "paymentMethod", skip_serializing_if = "Option::is_none")]
pub payment_method: Option<PaymentMethod>,
#[serde(default, rename = "buyingParty", skip_serializing_if = "Option::is_none")]
pub buying_party: Option<Box<crate::models::PartyIdentification>>,
#[serde(default, rename = "sellingParty", skip_serializing_if = "Option::is_none")]
pub selling_party: Option<Box<crate::models::PartyIdentification>>,
#[serde(default, rename = "shipToParty", skip_serializing_if = "Option::is_none")]
pub ship_to_party: Option<Box<crate::models::PartyIdentification>>,
#[serde(default, rename = "billToParty", skip_serializing_if = "Option::is_none")]
pub bill_to_party: Option<Box<crate::models::PartyIdentification>>,
#[serde(default, rename = "shipWindow", skip_serializing_if = "Option::is_none")]
pub ship_window: Option<String>,
#[serde(default, rename = "deliveryWindow", skip_serializing_if = "Option::is_none")]
pub delivery_window: Option<String>,
#[serde(default, rename = "items")]
pub items: Vec<crate::models::OrderItem>,
}
impl OrderDetails {
pub fn new(purchase_order_date: String, purchase_order_state_changed_date: String, items: Vec<crate::models::OrderItem>) -> OrderDetails {
OrderDetails {
purchase_order_date,
purchase_order_changed_date: None,
purchase_order_state_changed_date,
purchase_order_type: None,
import_details: None,
deal_code: None,
payment_method: None,
buying_party: None,
selling_party: None,
ship_to_party: None,
bill_to_party: None,
ship_window: None,
delivery_window: None,
items,
}
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PurchaseOrderType {
#[serde(rename = "RegularOrder")]
RegularOrder,
#[serde(rename = "ConsignedOrder")]
ConsignedOrder,
#[serde(rename = "NewProductIntroduction")]
NewProductIntroduction,
#[serde(rename = "RushOrder")]
RushOrder,
}
impl Default for PurchaseOrderType {
fn default() -> PurchaseOrderType {
Self::RegularOrder
}
}
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum PaymentMethod {
#[serde(rename = "Invoice")]
Invoice,
#[serde(rename = "Consignment")]
Consignment,
#[serde(rename = "CreditCard")]
CreditCard,
#[serde(rename = "Prepaid")]
Prepaid,
}
impl Default for PaymentMethod {
fn default() -> PaymentMethod {
Self::Invoice
}
}