late 0.0.1395

API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal. Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema). Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
Documentation
/*
 * Zernio API
 *
 * API reference for Zernio. Authenticate with a Bearer API key. Base URL: https://zernio.com/api  Versioning and deprecation: all endpoints are versioned in the URL path (current version: /v1). Breaking changes only ship in a new path version; existing versions keep working. Deprecated operations are marked 'deprecated: true' in this spec and announced in the changelog (https://zernio.com/changelog) before removal.  Errors: every 4xx/5xx response is application/json with a machine-readable 'code' and a human-readable 'error' message (see the ErrorResponse schema).  Request ids: responses carry an X-Request-Id header with the id we log the request under. Quote it when reporting a problem. A valid x-request-id you send is reused as that id.
 *
 * The version of the OpenAPI document: 1.615.0
 * Contact: support@zernio.com
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct CommerceOrderFulfillmentsInner {
    /// The shipment (fulfillment) id. Entries of one shipment with several tracking numbers share it.
    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
    pub id: Option<String>,
    #[serde(
        rename = "carrierName",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub carrier_name: Option<Option<String>>,
    #[serde(
        rename = "trackingNumber",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub tracking_number: Option<Option<String>>,
    #[serde(
        rename = "trackingUrl",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub tracking_url: Option<Option<String>>,
    /// Where the shipment is. pending means no carrier scan yet. Null when the platform has no delivery tracking for it. Shopify only knows it when the carrier sends tracking events.
    #[serde(
        rename = "deliveryStatus",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub delivery_status: Option<Option<DeliveryStatus>>,
    /// The platform's raw value, e.g. Shopify ATTEMPTED_DELIVERY.
    #[serde(
        rename = "platformDeliveryStatus",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub platform_delivery_status: Option<Option<String>>,
    #[serde(
        rename = "estimatedDeliveryAt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub estimated_delivery_at: Option<Option<String>>,
    #[serde(
        rename = "inTransitAt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub in_transit_at: Option<Option<String>>,
    #[serde(
        rename = "deliveredAt",
        default,
        with = "::serde_with::rust::double_option",
        skip_serializing_if = "Option::is_none"
    )]
    pub delivered_at: Option<Option<String>>,
}

impl CommerceOrderFulfillmentsInner {
    pub fn new() -> CommerceOrderFulfillmentsInner {
        CommerceOrderFulfillmentsInner {
            id: None,
            carrier_name: None,
            tracking_number: None,
            tracking_url: None,
            delivery_status: None,
            platform_delivery_status: None,
            estimated_delivery_at: None,
            in_transit_at: None,
            delivered_at: None,
        }
    }
}
/// Where the shipment is. pending means no carrier scan yet. Null when the platform has no delivery tracking for it. Shopify only knows it when the carrier sends tracking events.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
pub enum DeliveryStatus {
    #[serde(rename = "pending")]
    Pending,
    #[serde(rename = "in_transit")]
    InTransit,
    #[serde(rename = "delayed")]
    Delayed,
    #[serde(rename = "out_for_delivery")]
    OutForDelivery,
    #[serde(rename = "ready_for_pickup")]
    ReadyForPickup,
    #[serde(rename = "attempted_delivery")]
    AttemptedDelivery,
    #[serde(rename = "delivered")]
    Delivered,
    #[serde(rename = "failed")]
    Failed,
    #[serde(rename = "cancelled")]
    Cancelled,
}

impl Default for DeliveryStatus {
    fn default() -> DeliveryStatus {
        Self::Pending
    }
}