osdm-sys 0.1.0-alpha.2

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/)
Documentation
/*
 * UIC 90918-10 - OSDM
 *
 * 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/) 
 *
 * The version of the OpenAPI document: 3.7.0
 * Contact: osdm@uic.org
 * Generated by: https://openapi-generator.tech
 */

use crate::models;
use serde::{Deserialize, Serialize};

/// ContinuousServiceUsage : Usage of a continuos service vehicle
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct ContinuousServiceUsage {
    #[serde(rename = "id")]
    pub id: String,
    /// status of the usage of a vehicle
    #[serde(rename = "status")]
    pub status: String,
    #[serde(rename = "geoPosition", skip_serializing_if = "Option::is_none")]
    pub geo_position: Option<Box<models::GeoPosition>>,
    /// start usage procedure description
    #[serde(rename = "startUsageDescription")]
    pub start_usage_description: String,
    /// end usage procedure description
    #[serde(rename = "endUsageDescription")]
    pub end_usage_description: String,
    #[serde(rename = "startUsageCredentials", skip_serializing_if = "Option::is_none")]
    pub start_usage_credentials: Option<Box<models::FulfillmentDocument>>,
    /// time limit to start the usage
    #[serde(rename = "startUsageTimeLimit", skip_serializing_if = "Option::is_none")]
    pub start_usage_time_limit: Option<String>,
    /// id of the fee taken on blocking the vehicle
    #[serde(rename = "blockingFeeRef", skip_serializing_if = "Option::is_none")]
    pub blocking_fee_ref: Option<String>,
    /// id of the tip provided to staff
    #[serde(rename = "tipRef", skip_serializing_if = "Option::is_none")]
    pub tip_ref: Option<String>,
    #[serde(rename = "consumptionForPostPayment", skip_serializing_if = "Option::is_none")]
    pub consumption_for_post_payment: Option<Box<models::IndicatedConsumption>>,
    #[serde(rename = "remainingConsumptionFromPrePayment", skip_serializing_if = "Option::is_none")]
    pub remaining_consumption_from_pre_payment: Option<Box<models::IndicatedConsumption>>,
    #[serde(rename = "estimatedTimeOfArrivalAtPickUpPlace", skip_serializing_if = "Option::is_none")]
    pub estimated_time_of_arrival_at_pick_up_place: Option<String>,
}

impl ContinuousServiceUsage {
    /// Usage of a continuos service vehicle
    pub fn new(id: String, status: String, start_usage_description: String, end_usage_description: String) -> ContinuousServiceUsage {
        ContinuousServiceUsage {
            id,
            status,
            geo_position: None,
            start_usage_description,
            end_usage_description,
            start_usage_credentials: None,
            start_usage_time_limit: None,
            blocking_fee_ref: None,
            tip_ref: None,
            consumption_for_post_payment: None,
            remaining_consumption_from_pre_payment: None,
            estimated_time_of_arrival_at_pick_up_place: None,
        }
    }
}