amazon_spapi/models/orders_v0/
confirm_shipment_request.rs

1/*
2 * Selling Partner API for Orders
3 *
4 * Use the Orders Selling Partner API to programmatically retrieve order information. With this API, you can develop fast, flexible, and custom applications to manage order synchronization, perform order research, and create demand-based decision support tools.   _Note:_ For the JP, AU, and SG marketplaces, the Orders API supports orders from 2016 onward. For all other marketplaces, the Orders API supports orders for the last two years (orders older than this don't show up in the response).
5 *
6 * The version of the OpenAPI document: v0
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// ConfirmShipmentRequest : The request schema for an shipment confirmation.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ConfirmShipmentRequest {
17    #[serde(rename = "packageDetail")]
18    pub package_detail: Box<models::orders_v0::PackageDetail>,
19    /// The COD collection method (only supported in the JP marketplace).
20    #[serde(rename = "codCollectionMethod", skip_serializing_if = "Option::is_none")]
21    pub cod_collection_method: Option<CodCollectionMethod>,
22    /// The unobfuscated marketplace identifier.
23    #[serde(rename = "marketplaceId")]
24    pub marketplace_id: String,
25}
26
27impl ConfirmShipmentRequest {
28    /// The request schema for an shipment confirmation.
29    pub fn new(package_detail: models::orders_v0::PackageDetail, marketplace_id: String) -> ConfirmShipmentRequest {
30        ConfirmShipmentRequest {
31            package_detail: Box::new(package_detail),
32            cod_collection_method: None,
33            marketplace_id,
34        }
35    }
36}
37/// The COD collection method (only supported in the JP marketplace).
38#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
39pub enum CodCollectionMethod {
40    #[serde(rename = "DirectPayment")]
41    DirectPayment,
42}
43
44impl Default for CodCollectionMethod {
45    fn default() -> CodCollectionMethod {
46        Self::DirectPayment
47    }
48}
49