Skip to main content

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)]
16#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
17pub struct CarSpecification {
18    /// weight in kg
19    #[serde(rename = "weight")]
20    pub weight: i32,
21    /// size in cm
22    #[serde(rename = "length")]
23    pub length: i32,
24    /// size in cm
25    #[serde(rename = "width")]
26    pub width: i32,
27    /// size in cm
28    #[serde(rename = "height")]
29    pub height: i32,
30    /// Free text description of the brand (e.g. BMW) 
31    #[serde(rename = "brand")]
32    pub brand: String,
33    /// Free text description of the model (e.g. X5) 
34    #[serde(rename = "model")]
35    pub model: String,
36    #[serde(rename = "specialType", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
37    pub special_type: Option<Option<String>>,
38    #[serde(rename = "roofWidth")]
39    pub roof_width: i32,
40    /// indication that the car has a textile rook only
41    #[serde(rename = "textileRoof", skip_serializing_if = "Option::is_none")]
42    pub textile_roof: Option<bool>,
43    #[serde(rename = "rack", skip_serializing_if = "Option::is_none")]
44    pub rack: Option<Box<models::CarRack>>,
45    /// Indication of items attached to the car
46    #[serde(rename = "attachedItems", skip_serializing_if = "Option::is_none")]
47    pub attached_items: Option<Vec<String>>,
48}
49
50impl CarSpecification {
51    /// car, trailer or special vehicle to be transported (car carriage trains) 
52    pub fn new(weight: i32, length: i32, width: i32, height: i32, brand: String, model: String, roof_width: i32) -> CarSpecification {
53        CarSpecification {
54            weight,
55            length,
56            width,
57            height,
58            brand,
59            model,
60            special_type: None,
61            roof_width,
62            textile_roof: None,
63            rack: None,
64            attached_items: None,
65        }
66    }
67}
68