gistools/readers/gbfs/schema_v3/
system_information.rs

1use crate::readers::GBFSName;
2use alloc::{string::String, vec::Vec};
3use serde::{Deserialize, Serialize};
4
5/// # GBFS System Information Schema V3.1-RC & V3.0
6/// Details including system operator, system location, year implemented, URL, contact info, time zone.
7///
8/// ## Links
9/// - [GBFS Specification V3.1-RC](https://github.com/MobilityData/gbfs/blob/v3.1-RC/gbfs.md#system_informationjson)
10/// - [GBFS Specification V3.0](https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#system_informationjson)
11pub type GBFSSystemInformationV3 = GBFSSystemInformationV30;
12
13/// GBFS System Information Rental Apps
14#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
15pub struct GBFSSystemInformationRentalAppsV30 {
16    /// Rental app URL
17    pub store_uri: String,
18    /// Rental app discovery URL
19    pub discovery_uri: String,
20}
21
22/// GBFS System Information Rental App Container
23#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
24pub struct GBFSSystemInformationRentalAppV30 {
25    /// Android Rental App
26    pub android: Option<GBFSSystemInformationRentalAppsV30>,
27    /// iOS Rental App
28    pub ios: Option<GBFSSystemInformationRentalAppsV30>,
29}
30
31/// GBFS System Information Brand Assets
32#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
33pub struct GBFSSystemInformationBrandAssetsV30 {
34    /// Last modified date of the brand assets
35    pub brand_last_modified: String,
36    /// URL to the brand terms
37    pub brand_terms_url: Option<String>,
38    /// URL to the brand image
39    pub brand_image_url: String,
40    /// URL to the dark mode brand image
41    pub brand_image_url_dark: Option<String>,
42    /// Color used to represent the brand
43    pub color: Option<String>,
44}
45
46/// GBFS System Information Data
47#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
48pub struct GBFSSystemInformationDataV30 {
49    /// Globally unique identifier for the system.
50    pub system_id: String,
51    /// List of languages used in translated strings.
52    pub languages: Vec<String>,
53    /// Name of the system to be displayed to customers.
54    pub name: Vec<GBFSName>,
55    /// Hours and dates of operation in OSM opening_hours format.
56    pub opening_hours: String,
57    /// Abbreviation for the system.
58    pub short_name: Option<Vec<GBFSName>>,
59    /// Name of the system operator.
60    pub operator: Option<Vec<GBFSName>>,
61    /// URL of the vehicle share system.
62    pub url: Option<String>,
63    /// URL to purchase a membership.
64    pub purchase_url: Option<String>,
65    /// Date the system began operations.
66    pub start_date: Option<String>,
67    /// Date after which the data source will no longer be available.
68    pub termination_date: Option<String>,
69    /// Customer service phone number in E.164 format.
70    pub phone_number: Option<String>,
71    /// Email address actively monitored by customer service.
72    pub email: Option<String>,
73    /// Contact email for feed consumers to report technical issues.
74    pub feed_contact_email: String,
75    /// URL to the manifest.json file for the publisher.
76    pub manifest_url: Option<String>,
77    /// Time zone of the system.
78    pub timezone: String,
79    /// Standard license identifier for the dataset.
80    pub license_id: Option<String>,
81    /// URL defining the license terms.
82    pub license_url: Option<String>,
83    /// Name of the organization to which attribution should be provided.
84    pub attribution_organization_name: Option<Vec<GBFSName>>,
85    /// URL of the organization for attribution.
86    pub attribution_url: Option<String>,
87    /// Brand assets and related information.
88    pub brand_assets: Option<GBFSSystemInformationBrandAssetsV30>,
89    /// Terms of service URL.
90    pub terms_url: Option<Vec<GBFSName>>,
91    /// Date terms of service were last updated.
92    pub terms_last_updated: Option<String>,
93    /// Privacy policy URL.
94    pub privacy_url: Option<Vec<GBFSName>>,
95    /// Date the privacy policy was last updated.
96    pub privacy_last_updated: Option<String>,
97    /// Rental app information for Android and iOS platforms.
98    pub rental_apps: Option<GBFSSystemInformationRentalAppV30>,
99}
100
101/// # GBFS System Information Schema V3.0
102/// Details including system operator, system location, year implemented, URL, contact info, time zone.
103///
104/// ## Links
105/// - [GBFS Specification](https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#system_informationjson)
106#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
107pub struct GBFSSystemInformationV30 {
108    /// Last time the data in the feed was updated in RFC3339 format.
109    pub last_updated: String,
110    /// Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).
111    pub ttl: u64,
112    /// GBFS version number to which the feed conforms.
113    pub version: String,
114    /// System information data object.
115    pub data: GBFSSystemInformationDataV30,
116}