osdm_sys/models/
car.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)]
15pub struct Car {
16    /// weight in kg
17    #[serde(rename = "weight")]
18    pub weight: i32,
19    /// size in cm
20    #[serde(rename = "length")]
21    pub length: i32,
22    /// size in cm
23    #[serde(rename = "width")]
24    pub width: i32,
25    /// size in cm
26    #[serde(rename = "height")]
27    pub height: i32,
28    /// Free text description of the brand (e.g. BMW) 
29    #[serde(rename = "brand")]
30    pub brand: String,
31    /// Free text description of the model (e.g. X5) 
32    #[serde(rename = "model")]
33    pub model: String,
34    #[serde(rename = "specialType", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
35    pub special_type: Option<Option<String>>,
36    #[serde(rename = "roofWidth")]
37    pub roof_width: i32,
38    /// indication that the car has a textile rook only
39    #[serde(rename = "textileRoof", skip_serializing_if = "Option::is_none")]
40    pub textile_roof: Option<bool>,
41    #[serde(rename = "rack", skip_serializing_if = "Option::is_none")]
42    pub rack: Option<Box<models::CarRack>>,
43    /// Indication of items attached to the car
44    #[serde(rename = "attachedItems", skip_serializing_if = "Option::is_none")]
45    pub attached_items: Option<Vec<String>>,
46    /// Name of a contact person or company in case the car transport is booked stand alone. 
47    #[serde(rename = "contactName", skip_serializing_if = "Option::is_none")]
48    pub contact_name: Option<String>,
49    #[serde(rename = "contactDetail", skip_serializing_if = "Option::is_none")]
50    pub contact_detail: Option<Box<models::ContactDetail>>,
51    /// 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. 
52    #[serde(rename = "licensePlate")]
53    pub license_plate: String,
54}
55
56impl Car {
57    pub fn new(weight: i32, length: i32, width: i32, height: i32, brand: String, model: String, roof_width: i32, license_plate: String) -> Car {
58        Car {
59            weight,
60            length,
61            width,
62            height,
63            brand,
64            model,
65            special_type: None,
66            roof_width,
67            textile_roof: None,
68            rack: None,
69            attached_items: None,
70            contact_name: None,
71            contact_detail: None,
72            license_plate,
73        }
74    }
75}
76