osdm_sys/models/
event.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/// Event : Record of an action that occurred in the life cycle of the booking. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Event {
17    /// id of the event 
18    #[serde(rename = "id")]
19    pub id: String,
20    /// timestamp of the event 
21    #[serde(rename = "timestamp")]
22    pub timestamp: String,
23    #[serde(rename = "type")]
24    pub r#type: models::EventType,
25    #[serde(rename = "details")]
26    pub details: Box<models::EventDetail>,
27}
28
29impl Event {
30    /// Record of an action that occurred in the life cycle of the booking. 
31    pub fn new(id: String, timestamp: String, r#type: models::EventType, details: models::EventDetail) -> Event {
32        Event {
33            id,
34            timestamp,
35            r#type,
36            details: Box::new(details),
37        }
38    }
39}
40