osdm_sys/models/
exchange_operation.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#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct ExchangeOperation {
16    #[serde(rename = "id")]
17    pub id: String,
18    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
19    pub status: Option<models::ExchangeStatus>,
20    #[serde(rename = "exchangeOffers", skip_serializing_if = "Option::is_none")]
21    pub exchange_offers: Option<Vec<models::ExchangeOffer>>,
22    #[serde(rename = "ticketTimeLimit", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
23    pub ticket_time_limit: Option<Option<String>>,
24    /// Values from the [Fulfillment Type Code List](https://osdm.io/spec/catalog-of-code-lists/#FulfillmentType) Listed values here are examples. 
25    #[serde(rename = "fulfillmentType", skip_serializing_if = "Option::is_none")]
26    pub fulfillment_type: Option<String>,
27    #[serde(rename = "fulfillments", skip_serializing_if = "Option::is_none")]
28    pub fulfillments: Option<Vec<models::Fulfillment>>,
29    #[serde(rename = "issuedVouchers", skip_serializing_if = "Option::is_none")]
30    pub issued_vouchers: Option<Vec<models::VoucherInformation>>,
31    #[serde(rename = "trips", skip_serializing_if = "Option::is_none")]
32    pub trips: Option<Vec<models::Trip>>,
33}
34
35impl ExchangeOperation {
36    pub fn new(id: String) -> ExchangeOperation {
37        ExchangeOperation {
38            id,
39            status: None,
40            exchange_offers: None,
41            ticket_time_limit: None,
42            fulfillment_type: None,
43            fulfillments: None,
44            issued_vouchers: None,
45            trips: None,
46        }
47    }
48}
49