osdm_sys/models/
warning.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/// Warning : This element can be used to pass non-blocking information or events, such as a price difference with the initially offered price at booking time. It is inspired on the JSon problem structure.  This structure has been deprecated and is replaced by the Problem structure. 
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Warning {
17    #[serde(rename = "code")]
18    pub code: String,
19    /// An absolute URI that identifies the warning type. When dereferenced, it SHOULD provide human-readable documentation for the problem type (e.g., using HTML). 
20    #[serde(rename = "type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
21    pub r#type: Option<Option<String>>,
22    /// A human readable explanation specific to this occurrence of the warning. 
23    #[serde(rename = "detail", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
24    pub detail: Option<Option<String>>,
25    /// An absolute URI that identifies the specific occurrence of the warning. 
26    #[serde(rename = "instance", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
27    pub instance: Option<Option<String>>,
28}
29
30impl Warning {
31    /// This element can be used to pass non-blocking information or events, such as a price difference with the initially offered price at booking time. It is inspired on the JSon problem structure.  This structure has been deprecated and is replaced by the Problem structure. 
32    pub fn new(code: String) -> Warning {
33        Warning {
34            code,
35            r#type: None,
36            detail: None,
37            instance: None,
38        }
39    }
40}
41