osdm_sys/models/
continuous_service_usage.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/// ContinuousServiceUsage : Usage of a continuos service vehicle
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct ContinuousServiceUsage {
17    #[serde(rename = "id")]
18    pub id: String,
19    /// status of the usage of a vehicle
20    #[serde(rename = "status")]
21    pub status: String,
22    #[serde(rename = "geoPosition", skip_serializing_if = "Option::is_none")]
23    pub geo_position: Option<Box<models::GeoPosition>>,
24    /// start usage procedure description
25    #[serde(rename = "startUsageDescription")]
26    pub start_usage_description: String,
27    /// end usage procedure description
28    #[serde(rename = "endUsageDescription")]
29    pub end_usage_description: String,
30    #[serde(rename = "startUsageCredentials", skip_serializing_if = "Option::is_none")]
31    pub start_usage_credentials: Option<Box<models::FulfillmentDocument>>,
32    /// time limit to start the usage
33    #[serde(rename = "startUsageTimeLimit", skip_serializing_if = "Option::is_none")]
34    pub start_usage_time_limit: Option<String>,
35    /// id of the fee taken on blocking the vehicle
36    #[serde(rename = "blockingFeeRef", skip_serializing_if = "Option::is_none")]
37    pub blocking_fee_ref: Option<String>,
38    /// id of the tip provided to staff
39    #[serde(rename = "tipRef", skip_serializing_if = "Option::is_none")]
40    pub tip_ref: Option<String>,
41    #[serde(rename = "consumptionForPostPayment", skip_serializing_if = "Option::is_none")]
42    pub consumption_for_post_payment: Option<Box<models::IndicatedConsumption>>,
43    #[serde(rename = "remainingConsumptionFromPrePayment", skip_serializing_if = "Option::is_none")]
44    pub remaining_consumption_from_pre_payment: Option<Box<models::IndicatedConsumption>>,
45    #[serde(rename = "estimatedTimeOfArrivalAtPickUpPlace", skip_serializing_if = "Option::is_none")]
46    pub estimated_time_of_arrival_at_pick_up_place: Option<String>,
47}
48
49impl ContinuousServiceUsage {
50    /// Usage of a continuos service vehicle
51    pub fn new(id: String, status: String, start_usage_description: String, end_usage_description: String) -> ContinuousServiceUsage {
52        ContinuousServiceUsage {
53            id,
54            status,
55            geo_position: None,
56            start_usage_description,
57            end_usage_description,
58            start_usage_credentials: None,
59            start_usage_time_limit: None,
60            blocking_fee_ref: None,
61            tip_ref: None,
62            consumption_for_post_payment: None,
63            remaining_consumption_from_pre_payment: None,
64            estimated_time_of_arrival_at_pick_up_place: None,
65        }
66    }
67}
68