osdm_sys/models/motor_cycle.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
16pub struct MotorCycle {
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 /// deprecated use car of type SPECIAL_VEHILE instead
36 #[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 /// Name of a contact person or company in case the car transport is booked stand alone.
39 #[serde(rename = "contactName")]
40 pub contact_name: String,
41 #[serde(rename = "contactDetail", skip_serializing_if = "Option::is_none")]
42 pub contact_detail: Option<Box<models::ContactDetail>>,
43 /// The license plate is a personal data item and must not be provided in an offer request. It must be patched into the offer after the customer accepted the offer for booking
44 #[serde(rename = "licensePlate")]
45 pub license_plate: String,
46}
47
48impl MotorCycle {
49 pub fn new(weight: i32, length: i32, width: i32, height: i32, brand: String, model: String, contact_name: String, license_plate: String) -> MotorCycle {
50 MotorCycle {
51 weight,
52 length,
53 width,
54 height,
55 brand,
56 model,
57 is_side_car_included: None,
58 contact_name,
59 contact_detail: None,
60 license_plate,
61 }
62 }
63}
64