amazon_spapi/models/shipping_v2/
direct_purchase_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/// DirectPurchaseRequest : The request schema for the directPurchaseShipment operation. When the channel type is Amazon, the shipTo address is not required and will be ignored.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct DirectPurchaseRequest {
17    #[serde(rename = "shipTo", skip_serializing_if = "Option::is_none")]
18    pub ship_to: Option<Box<models::shipping_v2::Address>>,
19    #[serde(rename = "shipFrom", skip_serializing_if = "Option::is_none")]
20    pub ship_from: Option<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    /// A list of packages to be shipped through a shipping service offering.
24    #[serde(rename = "packages", skip_serializing_if = "Option::is_none")]
25    pub packages: Option<Vec<models::shipping_v2::Package>>,
26    #[serde(rename = "channelDetails")]
27    pub channel_details: Box<models::shipping_v2::ChannelDetails>,
28    #[serde(rename = "labelSpecifications", skip_serializing_if = "Option::is_none")]
29    pub label_specifications: Option<Box<models::shipping_v2::RequestedDocumentSpecification>>,
30}
31
32impl DirectPurchaseRequest {
33    /// The request schema for the directPurchaseShipment operation. When the channel type is Amazon, the shipTo address is not required and will be ignored.
34    pub fn new(channel_details: models::shipping_v2::ChannelDetails) -> DirectPurchaseRequest {
35        DirectPurchaseRequest {
36            ship_to: None,
37            ship_from: None,
38            return_to: None,
39            packages: None,
40            channel_details: Box::new(channel_details),
41            label_specifications: None,
42        }
43    }
44}
45