amazon_spapi/models/shipping/
purchase_shipment_request.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/// PurchaseShipmentRequest : The payload schema for the purchaseShipment operation.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct PurchaseShipmentRequest {
17    /// Client reference id.
18    #[serde(rename = "clientReferenceId")]
19    pub client_reference_id: String,
20    #[serde(rename = "shipTo")]
21    pub ship_to: Box<models::shipping::Address>,
22    #[serde(rename = "shipFrom")]
23    pub ship_from: Box<models::shipping::Address>,
24    /// The start date and time. This defaults to the current date and time.
25    #[serde(rename = "shipDate", skip_serializing_if = "Option::is_none")]
26    pub ship_date: Option<String>,
27    #[serde(rename = "serviceType")]
28    pub service_type: models::shipping::ServiceType,
29    /// A list of container.
30    #[serde(rename = "containers")]
31    pub containers: Vec<models::shipping::Container>,
32    #[serde(rename = "labelSpecification")]
33    pub label_specification: Box<models::shipping::LabelSpecification>,
34}
35
36impl PurchaseShipmentRequest {
37    /// The payload schema for the purchaseShipment operation.
38    pub fn new(client_reference_id: String, ship_to: models::shipping::Address, ship_from: models::shipping::Address, service_type: models::shipping::ServiceType, containers: Vec<models::shipping::Container>, label_specification: models::shipping::LabelSpecification) -> PurchaseShipmentRequest {
39        PurchaseShipmentRequest {
40            client_reference_id,
41            ship_to: Box::new(ship_to),
42            ship_from: Box::new(ship_from),
43            ship_date: None,
44            service_type,
45            containers,
46            label_specification: Box::new(label_specification),
47        }
48    }
49}
50