open-logistics 0.2.2

Rust client for the Open Logistics Shiprocket and Delhivery APIs.
Documentation
/*
 * Open Logistics — Shiprocket
 *
 * OpenAPI description of the Shiprocket endpoints wrapped by `open-logistics`.  Source of truth for generated Python and Rust clients. Operation IDs and schema field names are intentionally snake_case so every language exposes the same names.  Two TypeScript methods (`checkServiceability` and `calculateRates`) call `GET /courier/serviceability`; OpenAPI permits one operation per path + method, so this spec exposes a single `courier_serviceability` operation. Language facades may alias it as `calculate_rates`. 
 *
 * The version of the OpenAPI document: 0.2.2
 * 
 * Generated by: https://openapi-generator.tech
 */

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

#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
pub struct OrderResponse {
    #[serde(rename = "order_id")]
    pub order_id: i32,
    #[serde(rename = "shipment_id")]
    pub shipment_id: i32,
    #[serde(rename = "status")]
    pub status: String,
    #[serde(rename = "status_code")]
    pub status_code: i32,
    #[serde(rename = "onboarding_completed_now")]
    pub onboarding_completed_now: bool,
    #[serde(rename = "awb_code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub awb_code: Option<Option<String>>,
    #[serde(rename = "courier_company_id", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub courier_company_id: Option<Option<i32>>,
    #[serde(rename = "courier_name", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub courier_name: Option<Option<String>>,
}

impl OrderResponse {
    pub fn new(order_id: i32, shipment_id: i32, status: String, status_code: i32, onboarding_completed_now: bool) -> OrderResponse {
        OrderResponse {
            order_id,
            shipment_id,
            status,
            status_code,
            onboarding_completed_now,
            awb_code: None,
            courier_company_id: None,
            courier_name: None,
        }
    }
}