osdm_sys/models/
document_format.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/// DocumentFormat : Physical format of the document provided in the content field in Mime-Type format, e.g. application/pdf, image/jpeg, etc. Must be filled if the 'content' field is present. 
15/// Physical format of the document provided in the content field in Mime-Type format, e.g. application/pdf, image/jpeg, etc. Must be filled if the 'content' field is present. 
16#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
17pub enum DocumentFormat {
18    #[serde(rename = "application/pdf")]
19    ApplicationSlashPdf,
20    #[serde(rename = "application/vnd.apple.pkpass")]
21    ApplicationSlashVndApplePkpass,
22    #[serde(rename = "image/jpeg")]
23    ImageSlashJpeg,
24    #[serde(rename = "image/png")]
25    ImageSlashPng,
26    #[serde(rename = "text/calendar")]
27    TextSlashCalendar,
28    #[serde(rename = "text/html")]
29    TextSlashHtml,
30
31}
32
33impl std::fmt::Display for DocumentFormat {
34    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
35        match self {
36            Self::ApplicationSlashPdf => write!(f, "application/pdf"),
37            Self::ApplicationSlashVndApplePkpass => write!(f, "application/vnd.apple.pkpass"),
38            Self::ImageSlashJpeg => write!(f, "image/jpeg"),
39            Self::ImageSlashPng => write!(f, "image/png"),
40            Self::TextSlashCalendar => write!(f, "text/calendar"),
41            Self::TextSlashHtml => write!(f, "text/html"),
42        }
43    }
44}
45
46impl Default for DocumentFormat {
47    fn default() -> DocumentFormat {
48        Self::ApplicationSlashPdf
49    }
50}
51