osdm_sys/models/problem.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/// Problem : Problem Details for HTTP APIs (RFC 9457) defines a 'problem detail' as a way to carry machine-readable details of errors in a HTTP response to avoid the need to define new error response formats for HTTP APIs. See: https://tools.ietf.org/html/rfc9457
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Problem {
17 /// optional in version 3.1, will be made mandatory in upcoming releases
18 #[serde(rename = "code", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
19 pub code: Option<Option<String>>,
20 /// An absolute URI that identifies the problem type. When dereferenced, it SHOULD provide human-readable documentation for the problem type (e.g., using HTML).
21 #[serde(rename = "type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
22 pub r#type: Option<Option<String>>,
23 /// A short, summary of the problem type. Written in English and readable for engineers (usually not suited for non technical stakeholders and not localized);
24 #[serde(rename = "title", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25 pub title: Option<Option<String>>,
26 /// The HTTP status code generated by the origin server for this occurrence of the problem.
27 #[serde(rename = "status", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28 pub status: Option<Option<i32>>,
29 /// A human readable explanation specific to this occurrence of the problem.
30 #[serde(rename = "detail", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
31 pub detail: Option<Option<String>>,
32 /// An absolute URI that identifies the specific occurrence of the problem.
33 #[serde(rename = "instance", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
34 pub instance: Option<Option<String>>,
35 #[serde(rename = "pointers", skip_serializing_if = "Option::is_none")]
36 pub pointers: Option<Vec<models::ProblemPointer>>,
37}
38
39impl Problem {
40 /// Problem Details for HTTP APIs (RFC 9457) defines a 'problem detail' as a way to carry machine-readable details of errors in a HTTP response to avoid the need to define new error response formats for HTTP APIs. See: https://tools.ietf.org/html/rfc9457
41 pub fn new() -> Problem {
42 Problem {
43 code: None,
44 r#type: None,
45 title: None,
46 status: None,
47 detail: None,
48 instance: None,
49 pointers: None,
50 }
51 }
52}
53