Skip to main content

osdm_sys/models/
continuous_service_usage_patch_request.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
14use serde_with::serde_as;
15
16/// ContinuousServiceUsagePatchRequest : Usage of a continuos service vehicle
17#[serde_as]
18#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
19#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
20pub struct ContinuousServiceUsagePatchRequest {
21    #[serde(rename = "id")]
22    pub id: String,
23    /// status of the usage of a vehicle
24    #[serde(rename = "status")]
25    pub status: String,
26    /// base64 encoded binary of the jpg image of the parked vehicle when ending the usage. 
27    #[serde_as(as = "Option<serde_with::base64::Base64>")]
28    #[serde(rename = "parkingImage", skip_serializing_if = "Option::is_none")]
29    pub parking_image: Option<Vec<u8>>,
30    #[serde(rename = "tip", skip_serializing_if = "Option::is_none")]
31    pub tip: Option<Box<models::Tip>>,
32}
33
34impl ContinuousServiceUsagePatchRequest {
35    /// Usage of a continuos service vehicle
36    pub fn new(id: String, status: String) -> ContinuousServiceUsagePatchRequest {
37        ContinuousServiceUsagePatchRequest {
38            id,
39            status,
40            parking_image: None,
41            tip: None,
42        }
43    }
44}
45