osdm_sys/models/supporting_document.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
14use serde_with::serde_as;
15
16/// SupportingDocument : The supporting document helps to supporting the claim. Either downloadLink + downloadExpiry or content must be provided.
17#[serde_as]
18#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
19pub struct SupportingDocument {
20 /// title of the document
21 #[serde(rename = "title")]
22 pub title: String,
23 #[serde(rename = "downloadLink", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24 pub download_link: Option<Option<String>>,
25 #[serde(rename = "downloadExpiry")]
26 pub download_expiry: String,
27 /// base64 encoded binary of the actual document. The length restriction of 4 MBytes applies to the encoded string, so the raw document cannot exceed 3 MBytes in size.
28 #[serde_as(as = "super::DoubleOption<serde_with::base64::Base64>")]
29 #[serde(rename = "content", default, skip_serializing_if = "Option::is_none")]
30 pub content: Option<Option<Vec<u8>>>,
31 #[serde(rename = "format")]
32 pub format: models::DocumentFormat,
33}
34
35impl SupportingDocument {
36 /// The supporting document helps to supporting the claim. Either downloadLink + downloadExpiry or content must be provided.
37 pub fn new(title: String, download_expiry: String, format: models::DocumentFormat) -> SupportingDocument {
38 SupportingDocument {
39 title,
40 download_link: None,
41 download_expiry,
42 content: None,
43 format,
44 }
45 }
46}
47