1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*
 * Selling Partner API for Retail Procurement Shipments
 *
 * The Selling Partner API for Retail Procurement Shipments provides programmatic access to retail shipping data for vendors.
 *
 * The version of the OpenAPI document: v1
 * 
 * Generated by: https://openapi-generator.tech
 */

/// Stop : Contractual or operational port or point relevant to the movement of the cargo.



#[derive(Clone, Debug, PartialEq, Default, Serialize, Deserialize)]
pub struct Stop {
    /// Provide the function code.
    #[serde(default, rename = "functionCode")]
    pub function_code: FunctionCode,
    #[serde(default, rename = "locationIdentification", skip_serializing_if = "Option::is_none")]
    pub location_identification: Option<Box<crate::models::Location>>,
    /// Date and time of the arrival of the cargo.
    #[serde(default, rename = "arrivalTime", skip_serializing_if = "Option::is_none")]
    pub arrival_time: Option<String>,
    /// Date and time of the departure of the cargo.
    #[serde(default, rename = "departureTime", skip_serializing_if = "Option::is_none")]
    pub departure_time: Option<String>,
}

impl Stop {
    /// Contractual or operational port or point relevant to the movement of the cargo.
    pub fn new(function_code: FunctionCode) -> Stop {
        Stop {
            function_code,
            location_identification: None,
            arrival_time: None,
            departure_time: None,
        }
    }
}

/// Provide the function code.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum FunctionCode {
    #[serde(rename = "PortOfDischarge")]
    PortOfDischarge,
    #[serde(rename = "FreightPayableAt")]
    FreightPayableAt,
    #[serde(rename = "PortOfLoading")]
    PortOfLoading,
}

impl Default for FunctionCode {
    fn default() -> FunctionCode {
        Self::PortOfDischarge
    }
}