osdm_sys/models/
motorcycle_specification.rs1use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
16pub struct MotorcycleSpecification {
17 #[serde(rename = "weight")]
19 pub weight: i32,
20 #[serde(rename = "length")]
22 pub length: i32,
23 #[serde(rename = "width")]
25 pub width: i32,
26 #[serde(rename = "height")]
28 pub height: i32,
29 #[serde(rename = "brand")]
31 pub brand: String,
32 #[serde(rename = "model")]
34 pub model: String,
35 #[serde(rename = "isSideCarIncluded", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
37 pub is_side_car_included: Option<Option<bool>>,
38}
39
40impl MotorcycleSpecification {
41 pub fn new(weight: i32, length: i32, width: i32, height: i32, brand: String, model: String) -> MotorcycleSpecification {
42 MotorcycleSpecification {
43 weight,
44 length,
45 width,
46 height,
47 brand,
48 model,
49 is_side_car_included: None,
50 }
51 }
52}
53