Skip to main content

mobilitydata_client/models/
gtfs_rt_feed.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 GtfsRtFeed {
16    /// Unique identifier used as a key for the feeds table.
17    #[serde(rename = "id", skip_serializing_if = "Option::is_none")]
18    pub id: Option<String>,
19    #[serde(rename = "data_type", skip_serializing_if = "Option::is_none")]
20    pub data_type: Option<DataType>,
21    /// The date and time the feed was added to the database, in ISO 8601 date-time format.
22    #[serde(rename = "created_at", skip_serializing_if = "Option::is_none")]
23    pub created_at: Option<String>,
24    /// The ID that can be use to find the feed data in an external or legacy database. <ul>   <li><b>JBDA</b>: Automatically imported from http://docs.gtfs-data.jp/api.v2.html. Pattern is jbda-<organisation_id>-<feed_id>.</li>   <li><b>TDG</b>: Automatically imported from https://doc.transport.data.gouv.fr/outils/outils-disponibles-sur-le-pan/api. Pattern is tdg-<resource_id>.</li>   <li><b>NTD</b>: Automatically imported from https://www.transit.dot.gov/ntd/data-product/2023-annual-database-general-transit-feed-specification-gtfs-weblinks. Pattern is ntd-<ntd_id>.</li>   <li><b>TransitFeeds</b>: Automatically imported from old TransitFeeds website. Pattern is tfs-<feed_id>.</li>   <li><b>Transit.land</b>: Imported from https://www.transit.land/documentation/rest-api/feeds. Pattern is tld-<feed_id>.</li> </ul> 
25    #[serde(rename = "external_ids", skip_serializing_if = "Option::is_none")]
26    pub external_ids: Option<Vec<models::ExternalId>>,
27    /// A commonly used name for the transit provider included in the feed.
28    #[serde(rename = "provider", skip_serializing_if = "Option::is_none")]
29    pub provider: Option<String>,
30    /// Use to contact the feed producer.
31    #[serde(rename = "feed_contact_email", skip_serializing_if = "Option::is_none")]
32    pub feed_contact_email: Option<String>,
33    #[serde(rename = "source_info", skip_serializing_if = "Option::is_none")]
34    pub source_info: Option<Box<models::SourceInfo>>,
35    #[serde(rename = "redirects", skip_serializing_if = "Option::is_none")]
36    pub redirects: Option<Vec<models::Redirect>>,
37    /// Describes status of the Feed. Should be one of   * `active` Feed should be used in public trip planners.   * `deprecated` Feed is explicitly deprecated and should not be used in public trip planners.   * `inactive` Feed hasn't been recently updated and should be used at risk of providing outdated information.   * `development` Feed is being used for development purposes and should not be used in public trip planners.   * `future` Feed is not yet active but will be in the future. 
38    #[serde(rename = "status", skip_serializing_if = "Option::is_none")]
39    pub status: Option<Status>,
40    /// A boolean value indicating if the feed is official or not.  Official feeds are provided by the transit agency or a trusted source. 
41    #[serde(rename = "official", skip_serializing_if = "Option::is_none")]
42    pub official: Option<bool>,
43    /// The date and time the official status was last updated, in ISO 8601 date-time format. 
44    #[serde(rename = "official_updated_at", skip_serializing_if = "Option::is_none")]
45    pub official_updated_at: Option<String>,
46    /// An optional description of the data feed, e.g to specify if the data feed is an aggregate of  multiple providers, or which network is represented by the feed. 
47    #[serde(rename = "feed_name", skip_serializing_if = "Option::is_none")]
48    pub feed_name: Option<String>,
49    /// A note to clarify complex use cases for consumers.
50    #[serde(rename = "note", skip_serializing_if = "Option::is_none")]
51    pub note: Option<String>,
52    /// A list of related links for the feed. 
53    #[serde(rename = "related_links", skip_serializing_if = "Option::is_none")]
54    pub related_links: Option<Vec<models::FeedRelatedLink>>,
55    #[serde(rename = "entity_types", skip_serializing_if = "Option::is_none")]
56    pub entity_types: Option<Vec<EntityTypes>>,
57    /// A list of the GTFS feeds that the real time source is associated with, represented by their MDB source IDs.
58    #[serde(rename = "feed_references", skip_serializing_if = "Option::is_none")]
59    pub feed_references: Option<Vec<String>>,
60    #[serde(rename = "locations", skip_serializing_if = "Option::is_none")]
61    pub locations: Option<Vec<models::Location>>,
62}
63
64impl GtfsRtFeed {
65    pub fn new() -> GtfsRtFeed {
66        GtfsRtFeed {
67            id: None,
68            data_type: None,
69            created_at: None,
70            external_ids: None,
71            provider: None,
72            feed_contact_email: None,
73            source_info: None,
74            redirects: None,
75            status: None,
76            official: None,
77            official_updated_at: None,
78            feed_name: None,
79            note: None,
80            related_links: None,
81            entity_types: None,
82            feed_references: None,
83            locations: None,
84        }
85    }
86}
87/// 
88#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
89pub enum DataType {
90    #[serde(rename = "gtfs")]
91    Gtfs,
92    #[serde(rename = "gtfs_rt")]
93    GtfsRt,
94    #[serde(rename = "gbfs")]
95    Gbfs,
96}
97
98impl Default for DataType {
99    fn default() -> DataType {
100        Self::Gtfs
101    }
102}
103/// Describes status of the Feed. Should be one of   * `active` Feed should be used in public trip planners.   * `deprecated` Feed is explicitly deprecated and should not be used in public trip planners.   * `inactive` Feed hasn't been recently updated and should be used at risk of providing outdated information.   * `development` Feed is being used for development purposes and should not be used in public trip planners.   * `future` Feed is not yet active but will be in the future. 
104#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
105pub enum Status {
106    #[serde(rename = "active")]
107    Active,
108    #[serde(rename = "deprecated")]
109    Deprecated,
110    #[serde(rename = "inactive")]
111    Inactive,
112    #[serde(rename = "development")]
113    Development,
114    #[serde(rename = "future")]
115    Future,
116}
117
118impl Default for Status {
119    fn default() -> Status {
120        Self::Active
121    }
122}
123/// 
124#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
125pub enum EntityTypes {
126    #[serde(rename = "vp")]
127    Vp,
128    #[serde(rename = "tu")]
129    Tu,
130    #[serde(rename = "sa")]
131    Sa,
132}
133
134impl Default for EntityTypes {
135    fn default() -> EntityTypes {
136        Self::Vp
137    }
138}
139