Skip to main content

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