osdm_sys/models/
offer_mode.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/// OfferMode : Offer mode applied to provide offers for given criteria.   Individual offer mode means that each passenger is given individual admissions and reservations  to allow to refund individual passengers booked in a single booking.  If collective mode is not supported,  reverts back to the other mode and provides warning instead. 
15/// Offer mode applied to provide offers for given criteria.   Individual offer mode means that each passenger is given individual admissions and reservations  to allow to refund individual passengers booked in a single booking.  If collective mode is not supported,  reverts back to the other mode and provides warning instead. 
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum OfferMode {
18    #[serde(rename = "COLLECTIVE")]
19    Collective,
20    #[serde(rename = "INDIVIDUAL")]
21    Individual,
22
23}
24
25impl std::fmt::Display for OfferMode {
26    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
27        match self {
28            Self::Collective => write!(f, "COLLECTIVE"),
29            Self::Individual => write!(f, "INDIVIDUAL"),
30        }
31    }
32}
33
34impl Default for OfferMode {
35    fn default() -> OfferMode {
36        Self::Collective
37    }
38}
39