osdm_sys/models/exchangeable_type.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/// ExchangeableType : If set to YES the offerpart is exchangeable without a fee before the day of departure. NO when not exchangeable or exchangeable with 100% fee, WITH_CONDITIONS in all other cases.
15/// If set to YES the offerpart is exchangeable without a fee before the day of departure. NO when not exchangeable or exchangeable with 100% fee, WITH_CONDITIONS in all other cases.
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum ExchangeableType {
18 #[serde(rename = "YES")]
19 Yes,
20 #[serde(rename = "NO")]
21 No,
22 #[serde(rename = "WITH_CONDITION")]
23 WithCondition,
24
25}
26
27impl std::fmt::Display for ExchangeableType {
28 fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
29 match self {
30 Self::Yes => write!(f, "YES"),
31 Self::No => write!(f, "NO"),
32 Self::WithCondition => write!(f, "WITH_CONDITION"),
33 }
34 }
35}
36
37impl Default for ExchangeableType {
38 fn default() -> ExchangeableType {
39 Self::Yes
40 }
41}
42