osdm_sys/models/
car_specification.rs

1/*
2 * UIC 90918-10 - OSDM
3 *
4 * 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/) 
5 *
6 * The version of the OpenAPI document: 3.7.0
7 * Contact: osdm@uic.org
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14/// CarSpecification : car, trailer or special vehicle to be transported (car carriage trains) 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct CarSpecification {
17    /// weight in kg
18    #[serde(rename = "weight")]
19    pub weight: i32,
20    /// size in cm
21    #[serde(rename = "length")]
22    pub length: i32,
23    /// size in cm
24    #[serde(rename = "width")]
25    pub width: i32,
26    /// size in cm
27    #[serde(rename = "height")]
28    pub height: i32,
29    /// Free text description of the brand (e.g. BMW) 
30    #[serde(rename = "brand")]
31    pub brand: String,
32    /// Free text description of the model (e.g. X5) 
33    #[serde(rename = "model")]
34    pub model: String,
35    #[serde(rename = "specialType", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
36    pub special_type: Option<Option<String>>,
37    #[serde(rename = "roofWidth")]
38    pub roof_width: i32,
39    /// indication that the car has a textile rook only
40    #[serde(rename = "textileRoof", skip_serializing_if = "Option::is_none")]
41    pub textile_roof: Option<bool>,
42    #[serde(rename = "rack", skip_serializing_if = "Option::is_none")]
43    pub rack: Option<Box<models::CarRack>>,
44    /// Indication of items attached to the car
45    #[serde(rename = "attachedItems", skip_serializing_if = "Option::is_none")]
46    pub attached_items: Option<Vec<String>>,
47}
48
49impl CarSpecification {
50    /// car, trailer or special vehicle to be transported (car carriage trains) 
51    pub fn new(weight: i32, length: i32, width: i32, height: i32, brand: String, model: String, roof_width: i32) -> CarSpecification {
52        CarSpecification {
53            weight,
54            length,
55            width,
56            height,
57            brand,
58            model,
59            special_type: None,
60            roof_width,
61            textile_roof: None,
62            rack: None,
63            attached_items: None,
64        }
65    }
66}
67