osdm-sys 0.1.0-alpha.3

Specifications for the OSDM API standard. The OSDM specification supports two modes of operation: Retailer Mode and Distributor Mode. The API works identically in both modes, except that in distributor mode the API also returns fare information. The following resources are key to get started: - [Processes](https://osdm.io/spec/processes/) - [Models](https://osdm.io/spec/models/) - [Getting started](https://osdm.io/spec/getting-started/)
Documentation
/*
 * UIC 90918-10 - OSDM
 *
 * Specifications for the OSDM API standard. The OSDM specification supports two modes of operation: Retailer Mode and Distributor Mode. The API works identically in both modes, except that in distributor mode the API also returns fare information.  The following resources are key to get started:    -  [Processes](https://osdm.io/spec/processes/)   -  [Models](https://osdm.io/spec/models/)   -  [Getting started](https://osdm.io/spec/getting-started/) 
 *
 * The version of the OpenAPI document: 3.7.0
 * Contact: osdm@uic.org
 * Generated by: https://openapi-generator.tech
 */

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

/// CarSpecification : car, trailer or special vehicle to be transported (car carriage trains) 
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct CarSpecification {
    /// weight in kg
    #[serde(rename = "weight")]
    pub weight: i32,
    /// size in cm
    #[serde(rename = "length")]
    pub length: i32,
    /// size in cm
    #[serde(rename = "width")]
    pub width: i32,
    /// size in cm
    #[serde(rename = "height")]
    pub height: i32,
    /// Free text description of the brand (e.g. BMW) 
    #[serde(rename = "brand")]
    pub brand: String,
    /// Free text description of the model (e.g. X5) 
    #[serde(rename = "model")]
    pub model: String,
    #[serde(rename = "specialType", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
    pub special_type: Option<Option<String>>,
    #[serde(rename = "roofWidth")]
    pub roof_width: i32,
    /// indication that the car has a textile rook only
    #[serde(rename = "textileRoof", skip_serializing_if = "Option::is_none")]
    pub textile_roof: Option<bool>,
    #[serde(rename = "rack", skip_serializing_if = "Option::is_none")]
    pub rack: Option<Box<models::CarRack>>,
    /// Indication of items attached to the car
    #[serde(rename = "attachedItems", skip_serializing_if = "Option::is_none")]
    pub attached_items: Option<Vec<String>>,
}

impl CarSpecification {
    /// car, trailer or special vehicle to be transported (car carriage trains) 
    pub fn new(weight: i32, length: i32, width: i32, height: i32, brand: String, model: String, roof_width: i32) -> CarSpecification {
        CarSpecification {
            weight,
            length,
            width,
            height,
            brand,
            model,
            special_type: None,
            roof_width,
            textile_roof: None,
            rack: None,
            attached_items: None,
        }
    }
}