amazon_spapi/models/shipping_v2/
package.rs

1/*
2 * Amazon Shipping API
3 *
4 * The Amazon Shipping API is designed to support outbound shipping use cases both for orders originating on Amazon-owned marketplaces as well as external channels/marketplaces. With these APIs, you can request shipping rates, create shipments, cancel shipments, and track shipments.
5 *
6 * The version of the OpenAPI document: v2
7 * Contact: swa-api-core@amazon.com
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Package : A package to be shipped through a shipping service offering.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Package {
17    #[serde(rename = "dimensions")]
18    pub dimensions: Box<models::shipping_v2::Dimensions>,
19    #[serde(rename = "weight")]
20    pub weight: Box<models::shipping_v2::Weight>,
21    #[serde(rename = "insuredValue")]
22    pub insured_value: Box<models::shipping_v2::Currency>,
23    /// When true, the package contains hazardous materials. Defaults to false.
24    #[serde(rename = "isHazmat", skip_serializing_if = "Option::is_none")]
25    pub is_hazmat: Option<bool>,
26    /// The seller name displayed on the label.
27    #[serde(rename = "sellerDisplayName", skip_serializing_if = "Option::is_none")]
28    pub seller_display_name: Option<String>,
29    /// A list of charges based on the shipping service charges applied on a package.
30    #[serde(rename = "charges", skip_serializing_if = "Option::is_none")]
31    pub charges: Option<Vec<models::shipping_v2::ChargeComponent>>,
32    /// A client provided unique identifier for a package being shipped. This value should be saved by the client to pass as a parameter to the getShipmentDocuments operation.
33    #[serde(rename = "packageClientReferenceId")]
34    pub package_client_reference_id: String,
35    /// A list of items.
36    #[serde(rename = "items")]
37    pub items: Vec<models::shipping_v2::Item>,
38}
39
40impl Package {
41    /// A package to be shipped through a shipping service offering.
42    pub fn new(dimensions: models::shipping_v2::Dimensions, weight: models::shipping_v2::Weight, insured_value: models::shipping_v2::Currency, package_client_reference_id: String, items: Vec<models::shipping_v2::Item>) -> Package {
43        Package {
44            dimensions: Box::new(dimensions),
45            weight: Box::new(weight),
46            insured_value: Box::new(insured_value),
47            is_hazmat: None,
48            seller_display_name: None,
49            charges: None,
50            package_client_reference_id,
51            items,
52        }
53    }
54}
55