Skip to main content

amazon_spapi/models/shipping/
shipment.rs

1/*
2 * Selling Partner API for Shipping
3 *
4 * Provides programmatic access to Amazon Shipping APIs.   **Note:** If you are new to the Amazon Shipping API, refer to the latest version of <a href=\"https://developer-docs.amazon.com/amazon-shipping/docs/shipping-api-v2-reference\">Amazon Shipping API (v2)</a> on the <a href=\"https://developer-docs.amazon.com/amazon-shipping/\">Amazon Shipping Developer Documentation</a> site.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Shipment : The shipment related data.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Shipment {
17    /// The unique shipment identifier.
18    #[serde(rename = "shipmentId")]
19    pub shipment_id: String,
20    /// Client reference id.
21    #[serde(rename = "clientReferenceId")]
22    pub client_reference_id: String,
23    #[serde(rename = "shipFrom")]
24    pub ship_from: Box<models::shipping::Address>,
25    #[serde(rename = "shipTo")]
26    pub ship_to: Box<models::shipping::Address>,
27    #[serde(rename = "acceptedRate", skip_serializing_if = "Option::is_none")]
28    pub accepted_rate: Option<Box<models::shipping::AcceptedRate>>,
29    #[serde(rename = "shipper", skip_serializing_if = "Option::is_none")]
30    pub shipper: Option<Box<models::shipping::Party>>,
31    /// A list of container.
32    #[serde(rename = "containers")]
33    pub containers: Vec<models::shipping::Container>,
34}
35
36impl Shipment {
37    /// The shipment related data.
38    pub fn new(shipment_id: String, client_reference_id: String, ship_from: models::shipping::Address, ship_to: models::shipping::Address, containers: Vec<models::shipping::Container>) -> Shipment {
39        Shipment {
40            shipment_id,
41            client_reference_id,
42            ship_from: Box::new(ship_from),
43            ship_to: Box::new(ship_to),
44            accepted_rate: None,
45            shipper: None,
46            containers,
47        }
48    }
49}
50