amazon_spapi/models/vendor_shipments/
stop.rs

1/*
2 * Selling Partner API for Retail Procurement Shipments
3 *
4 * The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.
5 *
6 * The version of the OpenAPI document: v1
7 * 
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// Stop : Contractual or operational port or point relevant to the movement of the cargo.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Stop {
17    /// Provide the function code.
18    #[serde(rename = "functionCode")]
19    pub function_code: FunctionCode,
20    #[serde(rename = "locationIdentification", skip_serializing_if = "Option::is_none")]
21    pub location_identification: Option<Box<models::vendor_shipments::Location>>,
22    /// Date and time of the arrival of the cargo.
23    #[serde(rename = "arrivalTime", skip_serializing_if = "Option::is_none")]
24    pub arrival_time: Option<String>,
25    /// Date and time of the departure of the cargo.
26    #[serde(rename = "departureTime", skip_serializing_if = "Option::is_none")]
27    pub departure_time: Option<String>,
28}
29
30impl Stop {
31    /// Contractual or operational port or point relevant to the movement of the cargo.
32    pub fn new(function_code: FunctionCode) -> Stop {
33        Stop {
34            function_code,
35            location_identification: None,
36            arrival_time: None,
37            departure_time: None,
38        }
39    }
40}
41/// Provide the function code.
42#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
43pub enum FunctionCode {
44    #[serde(rename = "PortOfDischarge")]
45    PortOfDischarge,
46    #[serde(rename = "FreightPayableAt")]
47    FreightPayableAt,
48    #[serde(rename = "PortOfLoading")]
49    PortOfLoading,
50}
51
52impl Default for FunctionCode {
53    fn default() -> FunctionCode {
54        Self::PortOfDischarge
55    }
56}
57