amazon_spapi/models/shipping_v2/
one_click_shipment_result.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/// OneClickShipmentResult : The payload for the OneClickShipment API.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct OneClickShipmentResult {
17    /// The unique shipment identifier provided by a shipping service.
18    #[serde(rename = "shipmentId")]
19    pub shipment_id: String,
20    /// A list of post-purchase details about a package that will be shipped using a shipping service.
21    #[serde(rename = "packageDocumentDetails")]
22    pub package_document_details: Vec<models::shipping_v2::PackageDocumentDetail>,
23    #[serde(rename = "promise")]
24    pub promise: Box<models::shipping_v2::Promise>,
25    #[serde(rename = "carrier")]
26    pub carrier: Box<models::shipping_v2::Carrier>,
27    #[serde(rename = "service")]
28    pub service: Box<models::shipping_v2::Service>,
29    #[serde(rename = "totalCharge")]
30    pub total_charge: Box<models::shipping_v2::Currency>,
31}
32
33impl OneClickShipmentResult {
34    /// The payload for the OneClickShipment API.
35    pub fn new(shipment_id: String, package_document_details: Vec<models::shipping_v2::PackageDocumentDetail>, promise: models::shipping_v2::Promise, carrier: models::shipping_v2::Carrier, service: models::shipping_v2::Service, total_charge: models::shipping_v2::Currency) -> OneClickShipmentResult {
36        OneClickShipmentResult {
37            shipment_id,
38            package_document_details,
39            promise: Box::new(promise),
40            carrier: Box::new(carrier),
41            service: Box::new(service),
42            total_charge: Box::new(total_charge),
43        }
44    }
45}
46