osdm_sys/models/link.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/// Link : The underlying system may provide links for pagination of links pointing on further information (such as HTML download links, web sites or extended APIs). Mechanism to add flexible extensions specific to an underlying system. Implemented the JSON-HAL specification.
15#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
16pub struct Link {
17 /// the 'rel' field in HATEOAS navigation.
18 #[serde(rename = "rel")]
19 pub rel: String,
20 /// Allows to provide a value to the link, for example id of the targeted resource or displayable representation for the link.
21 #[serde(rename = "href")]
22 pub href: String,
23 /// Hint to indicate the media type expected when dereferencing the target resource.
24 #[serde(rename = "type", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
25 pub r#type: Option<Option<String>>,
26 /// Allows to provide a value to the link, for example id of the targeted resource or displayable representation for the link.
27 #[serde(rename = "value", default, with = "::serde_with::rust::double_option", skip_serializing_if = "Option::is_none")]
28 pub value: Option<Option<String>>,
29}
30
31impl Link {
32 /// The underlying system may provide links for pagination of links pointing on further information (such as HTML download links, web sites or extended APIs). Mechanism to add flexible extensions specific to an underlying system. Implemented the JSON-HAL specification.
33 pub fn new(rel: String, href: String) -> Link {
34 Link {
35 rel,
36 href,
37 r#type: None,
38 value: None,
39 }
40 }
41}
42