1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/*
* UIC 90918-10 - OSDM
*
* 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/)
*
* The version of the OpenAPI document: 3.7.0
* Contact: osdm@uic.org
* Generated by: https://openapi-generator.tech
*/
use crate::models;
use serde::{Deserialize, Serialize};
use serde_with::serde_as;
/// SupportingDocument : The supporting document helps to supporting the claim. Either downloadLink + downloadExpiry or content must be provided.
#[serde_as]
#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
#[cfg_attr(feature = "utoipa", derive(utoipa::ToSchema))]
pub struct SupportingDocument {
/// title of the document
#[serde(rename = "title")]
pub title: String,
#[serde(rename = "downloadLink", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
pub download_link: Option<Option<String>>,
#[serde(rename = "downloadExpiry")]
pub download_expiry: String,
/// 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.
#[serde_as(as = "super::DoubleOption<serde_with::base64::Base64>")]
#[serde(rename = "content", default, skip_serializing_if = "Option::is_none")]
pub content: Option<Option<Vec<u8>>>,
#[serde(rename = "format")]
pub format: models::DocumentFormat,
}
impl SupportingDocument {
/// The supporting document helps to supporting the claim. Either downloadLink + downloadExpiry or content must be provided.
pub fn new(title: String, download_expiry: String, format: models::DocumentFormat) -> SupportingDocument {
SupportingDocument {
title,
download_link: None,
download_expiry,
content: None,
format,
}
}
}