mobilitydata_client/models/gtfs_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 GtfsFeed {
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 = "locations", skip_serializing_if = "Option::is_none")]
56 pub locations: Option<Vec<models::Location>>,
57 #[serde(rename = "latest_dataset", skip_serializing_if = "Option::is_none")]
58 pub latest_dataset: Option<Box<models::LatestDataset>>,
59 #[serde(rename = "bounding_box", skip_serializing_if = "Option::is_none")]
60 pub bounding_box: Option<Box<models::BoundingBox>>,
61 /// The dataset ID of the dataset used to compute the visualization files.
62 #[serde(rename = "visualization_dataset_id", skip_serializing_if = "Option::is_none")]
63 pub visualization_dataset_id: Option<String>,
64}
65
66impl GtfsFeed {
67 pub fn new() -> GtfsFeed {
68 GtfsFeed {
69 id: None,
70 data_type: None,
71 created_at: None,
72 external_ids: None,
73 provider: None,
74 feed_contact_email: None,
75 source_info: None,
76 redirects: None,
77 status: None,
78 official: None,
79 official_updated_at: None,
80 feed_name: None,
81 note: None,
82 related_links: None,
83 locations: None,
84 latest_dataset: None,
85 bounding_box: None,
86 visualization_dataset_id: None,
87 }
88 }
89}
90///
91#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
92pub enum DataType {
93 #[serde(rename = "gtfs")]
94 Gtfs,
95 #[serde(rename = "gtfs_rt")]
96 GtfsRt,
97 #[serde(rename = "gbfs")]
98 Gbfs,
99}
100
101impl Default for DataType {
102 fn default() -> DataType {
103 Self::Gtfs
104 }
105}
106/// 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.
107#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash, Serialize, Deserialize)]
108pub enum Status {
109 #[serde(rename = "active")]
110 Active,
111 #[serde(rename = "deprecated")]
112 Deprecated,
113 #[serde(rename = "inactive")]
114 Inactive,
115 #[serde(rename = "development")]
116 Development,
117 #[serde(rename = "future")]
118 Future,
119}
120
121impl Default for Status {
122 fn default() -> Status {
123 Self::Active
124 }
125}
126