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
/*
 * Selling Partner API for Direct Fulfillment Shipping
 *
 * The Selling Partner API for Direct Fulfillment Shipping provides programmatic access to a direct fulfillment vendor's shipping data.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */




#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct ShippingLabel {
    /// This field will contain the Purchase Order Number for this order.
    #[serde(default, rename = "purchaseOrderNumber")]
    pub purchase_order_number: String,
    #[serde(default, rename = "sellingParty")]
    pub selling_party: Box<crate::models::PartyIdentification>,
    #[serde(default, rename = "shipFromParty")]
    pub ship_from_party: Box<crate::models::PartyIdentification>,
    /// Format of the label.
    #[serde(default, rename = "labelFormat")]
    pub label_format: LabelFormat,
    /// Provides the details of the packages in this shipment.
    #[serde(default, rename = "labelData")]
    pub label_data: Vec<crate::models::LabelData>,
}

impl ShippingLabel {
    pub fn new(purchase_order_number: String, selling_party: crate::models::PartyIdentification, ship_from_party: crate::models::PartyIdentification, label_format: LabelFormat, label_data: Vec<crate::models::LabelData>) -> ShippingLabel {
        ShippingLabel {
            purchase_order_number,
            selling_party: Box::new(selling_party),
            ship_from_party: Box::new(ship_from_party),
            label_format,
            label_data,
        }
    }
}

/// Format of the label.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum LabelFormat {
    #[serde(rename = "PNG")]
    PNG,
    #[serde(rename = "ZPL")]
    ZPL,
}

impl Default for LabelFormat {
    fn default() -> LabelFormat {
        Self::PNG
    }
}