amazon-spapi 2.0.3

A Rust client library for Amazon Selling Partner API (SP-API)
Documentation
/*
 * 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
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// Stop : Contractual or operational port or point relevant to the movement of the cargo.
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct Stop {
    /// Provide the function code.
    #[serde(rename = "functionCode")]
    pub function_code: FunctionCode,
    #[serde(rename = "locationIdentification", skip_serializing_if = "Option::is_none")]
    pub location_identification: Option<Box<models::vendor_shipments::Location>>,
    /// Date and time of the arrival of the cargo.
    #[serde(rename = "arrivalTime", skip_serializing_if = "Option::is_none")]
    pub arrival_time: Option<String>,
    /// Date and time of the departure of the cargo.
    #[serde(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
    }
}