amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * Amazon Shipping API
 *
 * 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.
 *
 * The version of the OpenAPI document: v2
 * Contact: swa-api-core@amazon.com
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// OneClickShipmentResult : The payload for the OneClickShipment API.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OneClickShipmentResult {
    /// The unique shipment identifier provided by a shipping service.
    #[serde(rename = "shipmentId")]
    pub shipment_id: String,
    /// A list of post-purchase details about a package that will be shipped using a shipping service.
    #[serde(rename = "packageDocumentDetails")]
    pub package_document_details: Vec<models::shipping_v2::PackageDocumentDetail>,
    #[serde(rename = "promise")]
    pub promise: Box<models::shipping_v2::Promise>,
    #[serde(rename = "carrier")]
    pub carrier: Box<models::shipping_v2::Carrier>,
    #[serde(rename = "service")]
    pub service: Box<models::shipping_v2::Service>,
    #[serde(rename = "totalCharge")]
    pub total_charge: Box<models::shipping_v2::Currency>,
}

impl OneClickShipmentResult {
    /// The payload for the OneClickShipment API.
    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 {
        OneClickShipmentResult {
            shipment_id,
            package_document_details,
            promise: Box::new(promise),
            carrier: Box::new(carrier),
            service: Box::new(service),
            total_charge: Box::new(total_charge),
        }
    }
}