Skip to main content

mobilitydata_client/models/
gbfs_version.rs

1/*
2 * Mobility Database Catalog
3 *
4 * API for the Mobility Database Catalog. See [https://mobilitydatabase.org/](https://mobilitydatabase.org/).  The Mobility Database API uses OAuth2 authentication. To initiate a successful API request, an access token must be included as a bearer token in the HTTP header. Access tokens are valid for one hour. To obtain an access token, you'll first need a refresh token, which is long-lived and does not expire. 
5 *
6 * The version of the OpenAPI document: 1.0.0
7 * Contact: api@mobilitydata.org
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12use serde::{Deserialize, Serialize};
13
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15pub struct GbfsVersion {
16    /// The version of the GBFS specification that the feed is using.  This is a string that follows the semantic versioning format. 
17    #[serde(rename = "version", skip_serializing_if = "Option::is_none")]
18    pub version: Option<String>,
19    /// The date when the GBFS version was saved to the database. 
20    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
21    pub created_at: Option<String>,
22    /// The date when the GBFS version was last updated in the database. 
23    #[serde(rename = "last_updated_at", skip_serializing_if = "Option::is_none")]
24    pub last_updated_at: Option<String>,
25    /// Indicates the origin of the version information. Possible values are:   * `autodiscovery`: Retrieved directly from the main GBFS autodiscovery URL.   * `gbfs_versions`: Retrieved from the `gbfs_versions` endpoint. 
26    #[serde(rename = "source", skip_serializing_if = "Option::is_none")]
27    pub source: Option<Source>,
28    /// A list of endpoints that are available in the version. 
29    #[serde(rename = "endpoints", skip_serializing_if = "Option::is_none")]
30    pub endpoints: Option<Vec<models::GbfsEndpoint>>,
31    #[serde(rename = "latest_validation_report", skip_serializing_if = "Option::is_none")]
32    pub latest_validation_report: Option<Box<models::GbfsValidationReport>>,
33}
34
35impl GbfsVersion {
36    pub fn new() -> GbfsVersion {
37        GbfsVersion {
38            version: None,
39            created_at: None,
40            last_updated_at: None,
41            source: None,
42            endpoints: None,
43            latest_validation_report: None,
44        }
45    }
46}
47/// Indicates the origin of the version information. Possible values are:   * `autodiscovery`: Retrieved directly from the main GBFS autodiscovery URL.   * `gbfs_versions`: Retrieved from the `gbfs_versions` endpoint. 
48#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
49pub enum Source {
50    #[serde(rename = "autodiscovery")]
51    Autodiscovery,
52    #[serde(rename = "gbfs_versions")]
53    GbfsVersions,
54}
55
56impl Default for Source {
57    fn default() -> Source {
58        Self::Autodiscovery
59    }
60}
61