amazon_spapi/models/shipping_v2/
one_click_shipment_request.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/// OneClickShipmentRequest : The request schema for the OneClickShipment operation. When the channelType is not Amazon, shipTo is required and when channelType is Amazon shipTo is ignored.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct OneClickShipmentRequest {
17    #[serde(rename = "shipTo", skip_serializing_if = "Option::is_none")]
18    pub ship_to: Option<Box<models::shipping_v2::Address>>,
19    #[serde(rename = "shipFrom")]
20    pub ship_from: Box<models::shipping_v2::Address>,
21    #[serde(rename = "returnTo", skip_serializing_if = "Option::is_none")]
22    pub return_to: Option<Box<models::shipping_v2::Address>>,
23    /// The ship date and time (the requested pickup). This defaults to the current date and time.
24    #[serde(rename = "shipDate", skip_serializing_if = "Option::is_none")]
25    pub ship_date: Option<String>,
26    #[serde(rename = "goodsOwner", skip_serializing_if = "Option::is_none")]
27    pub goods_owner: Option<Box<models::shipping_v2::GoodsOwner>>,
28    /// A list of packages to be shipped through a shipping service offering.
29    #[serde(rename = "packages")]
30    pub packages: Vec<models::shipping_v2::Package>,
31    /// The value-added services to be added to a shipping service purchase.
32    #[serde(rename = "valueAddedServicesDetails", skip_serializing_if = "Option::is_none")]
33    pub value_added_services_details: Option<Vec<models::shipping_v2::OneClickShipmentValueAddedService>>,
34    /// A list of tax detail information.
35    #[serde(rename = "taxDetails", skip_serializing_if = "Option::is_none")]
36    pub tax_details: Option<Vec<models::shipping_v2::TaxDetail>>,
37    #[serde(rename = "channelDetails")]
38    pub channel_details: Box<models::shipping_v2::ChannelDetails>,
39    #[serde(rename = "labelSpecifications")]
40    pub label_specifications: Box<models::shipping_v2::RequestedDocumentSpecification>,
41    #[serde(rename = "serviceSelection")]
42    pub service_selection: Box<models::shipping_v2::ServiceSelection>,
43    #[serde(rename = "shipperInstruction", skip_serializing_if = "Option::is_none")]
44    pub shipper_instruction: Option<Box<models::shipping_v2::ShipperInstruction>>,
45    #[serde(rename = "destinationAccessPointDetails", skip_serializing_if = "Option::is_none")]
46    pub destination_access_point_details: Option<Box<models::shipping_v2::AccessPointDetails>>,
47}
48
49impl OneClickShipmentRequest {
50    /// The request schema for the OneClickShipment operation. When the channelType is not Amazon, shipTo is required and when channelType is Amazon shipTo is ignored.
51    pub fn new(ship_from: models::shipping_v2::Address, packages: Vec<models::shipping_v2::Package>, channel_details: models::shipping_v2::ChannelDetails, label_specifications: models::shipping_v2::RequestedDocumentSpecification, service_selection: models::shipping_v2::ServiceSelection) -> OneClickShipmentRequest {
52        OneClickShipmentRequest {
53            ship_to: None,
54            ship_from: Box::new(ship_from),
55            return_to: None,
56            ship_date: None,
57            goods_owner: None,
58            packages,
59            value_added_services_details: None,
60            tax_details: None,
61            channel_details: Box::new(channel_details),
62            label_specifications: Box::new(label_specifications),
63            service_selection: Box::new(service_selection),
64            shipper_instruction: None,
65            destination_access_point_details: None,
66        }
67    }
68}
69