Skip to main content

mobilitydata_client/models/
basic_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 BasicFeed {
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}
38
39impl BasicFeed {
40    pub fn new() -> BasicFeed {
41        BasicFeed {
42            id: None,
43            data_type: None,
44            created_at: None,
45            external_ids: None,
46            provider: None,
47            feed_contact_email: None,
48            source_info: None,
49            redirects: None,
50        }
51    }
52}
53/// 
54#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
55pub enum DataType {
56    #[serde(rename = "gtfs")]
57    Gtfs,
58    #[serde(rename = "gtfs_rt")]
59    GtfsRt,
60    #[serde(rename = "gbfs")]
61    Gbfs,
62}
63
64impl Default for DataType {
65    fn default() -> DataType {
66        Self::Gtfs
67    }
68}
69