amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * 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
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// ShippingLabel : Shipping label information for an order, including the purchase order number, selling party, ship from party, label format, and package details.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct ShippingLabel {
    /// This field will contain the Purchase Order Number for this order.
    #[serde(rename = "purchaseOrderNumber")]
    pub purchase_order_number: String,
    #[serde(rename = "sellingParty")]
    pub selling_party: Box<models::vendor_direct_fulfillment_shipping_v1::PartyIdentification>,
    #[serde(rename = "shipFromParty")]
    pub ship_from_party: Box<models::vendor_direct_fulfillment_shipping_v1::PartyIdentification>,
    /// Format of the label.
    #[serde(rename = "labelFormat")]
    pub label_format: LabelFormat,
    /// Provides the details of the packages in this shipment.
    #[serde(rename = "labelData")]
    pub label_data: Vec<models::vendor_direct_fulfillment_shipping_v1::LabelData>,
}

impl ShippingLabel {
    /// Shipping label information for an order, including the purchase order number, selling party, ship from party, label format, and package details.
    pub fn new(purchase_order_number: String, selling_party: models::vendor_direct_fulfillment_shipping_v1::PartyIdentification, ship_from_party: models::vendor_direct_fulfillment_shipping_v1::PartyIdentification, label_format: LabelFormat, label_data: Vec<models::vendor_direct_fulfillment_shipping_v1::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
    }
}