amazon_spapi/models/orders_v0/
package_detail.rs

1/*
2 * Selling Partner API for Orders
3 *
4 * Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools.   _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).
5 *
6 * The version of the OpenAPI document: v0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// PackageDetail : Properties of packages
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PackageDetail {
17    /// A seller-supplied identifier that uniquely identifies a package within the scope of an order. Only positive numeric values are supported.
18    #[serde(rename = "packageReferenceId")]
19    pub package_reference_id: String,
20    /// Identifies the carrier that will deliver the package. This field is required for all marketplaces. For more information, refer to the [`CarrierCode` announcement](https://developer-docs.amazon.com/sp-api/changelog/carriercode-value-required-in-shipment-confirmations-for-br-mx-ca-sg-au-in-jp-marketplaces).
21    #[serde(rename = "carrierCode")]
22    pub carrier_code: String,
23    /// Carrier name that will deliver the package. Required when `carrierCode` is \"Other\" 
24    #[serde(rename = "carrierName", skip_serializing_if = "Option::is_none")]
25    pub carrier_name: Option<String>,
26    /// Ship method to be used for shipping the order.
27    #[serde(rename = "shippingMethod", skip_serializing_if = "Option::is_none")]
28    pub shipping_method: Option<String>,
29    /// The tracking number used to obtain tracking and delivery information.
30    #[serde(rename = "trackingNumber")]
31    pub tracking_number: String,
32    /// The shipping date for the package. Must be in <a href='https://developer-docs.amazon.com/sp-api/docs/iso-8601'>ISO 8601</a> date/time format.
33    #[serde(rename = "shipDate")]
34    pub ship_date: String,
35    /// The unique identifier for the supply source.
36    #[serde(rename = "shipFromSupplySourceId", skip_serializing_if = "Option::is_none")]
37    pub ship_from_supply_source_id: Option<String>,
38    /// A list of order items.
39    #[serde(rename = "orderItems")]
40    pub order_items: Vec<models::orders_v0::ConfirmShipmentOrderItem>,
41}
42
43impl PackageDetail {
44    /// Properties of packages
45    pub fn new(package_reference_id: String, carrier_code: String, tracking_number: String, ship_date: String, order_items: Vec<models::orders_v0::ConfirmShipmentOrderItem>) -> PackageDetail {
46        PackageDetail {
47            package_reference_id,
48            carrier_code,
49            carrier_name: None,
50            shipping_method: None,
51            tracking_number,
52            ship_date,
53            ship_from_supply_source_id: None,
54            order_items,
55        }
56    }
57}
58