gistools/readers/gbfs/schema_v1/
system_information.rs

1use alloc::string::String;
2use serde::{Deserialize, Serialize};
3
4/// # GBFS System Information Schema V1.1 OR GBFS System Information Schema V1.0
5/// Details including system operator, system location, year implemented, URL, contact info, and time zone.
6///
7/// ## Links
8/// - [GBFS Specification V1.1](https://github.com/MobilityData/gbfs/blob/v1.1/gbfs.md#system_informationjson)
9/// - [GBFS Specification V1.0](https://github.com/MobilityData/gbfs/blob/v1.0/gbfs.md#system_informationjson)
10pub type GBFSSystemInformationV1 = GBFSSystemInformationV11;
11
12/// GBFS System Information Rental App Container
13#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
14pub struct GBFSSystemInformationRentalAppV11 {
15    /// Store URI
16    pub store_uri: String,
17    /// Discovery URI
18    pub discovery_uri: String,
19}
20
21/// GBFS System Information Rental Apps
22#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
23pub struct GBFSSystemInformationRentalAppsV11 {
24    /// Android
25    pub android: Option<GBFSSystemInformationRentalAppV11>,
26    /// iOS
27    pub ios: Option<GBFSSystemInformationRentalAppV11>,
28}
29
30/// GBFS System Information Data
31#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
32pub struct GBFSSystemInformationDataV11 {
33    /// System ID
34    pub system_id: String,
35    /// Language
36    pub language: String,
37    /// System name
38    pub name: String,
39    /// Short name
40    pub short_name: Option<String>,
41    /// Operator
42    pub operator: Option<String>,
43    /// URL
44    pub url: Option<String>,
45    /// Purchase URL
46    pub purchase_url: Option<String>,
47    /// Start date
48    pub start_date: Option<String>,
49    /// Phone number
50    pub phone_number: Option<String>,
51    /// Email
52    pub email: Option<String>,
53    /// Feed contact email
54    pub feed_contact_email: Option<String>,
55    /// Timezone
56    pub timezone: String,
57    /// License URL
58    pub license_url: Option<String>,
59    /// Rental Apps
60    pub rental_apps: Option<GBFSSystemInformationRentalAppsV11>,
61}
62
63/// GBFS System Information Schema V1.1 Interface
64#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
65pub struct GBFSSystemInformationV11 {
66    /// Last time the data in the feed was updated in POSIX time.
67    pub last_updated: u64,
68    /// Number of seconds before the data in the feed will be updated again.
69    pub ttl: u64,
70    /// GBFS version number (1.1).
71    pub version: String,
72    /// Data containing system information.
73    pub data: GBFSSystemInformationDataV11,
74}
75
76/// GBFS System Information Data
77#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
78pub struct GBFSSystemInformationDataV10 {
79    /// System ID
80    pub system_id: String,
81    /// Language
82    pub language: String,
83    /// Name
84    pub name: String,
85    /// Short name
86    pub short_name: Option<String>,
87    /// Operator
88    pub operator: Option<String>,
89    /// URL
90    pub url: Option<String>,
91    /// Purchase URL
92    pub purchase_url: Option<String>,
93    /// Start date
94    pub start_date: Option<String>,
95    /// Phone number
96    pub phone_number: Option<String>,
97    /// Email
98    pub email: Option<String>,
99    /// Timezone
100    pub timezone: String,
101    /// License URL
102    pub license_url: Option<String>,
103}
104
105/// GBFS System Information Schema V1.0 Interface
106#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
107pub struct GBFSSystemInformationV10 {
108    /// Last time the data in the feed was updated in POSIX time.
109    pub last_updated: u64,
110    /// Number of seconds before the data in the feed will be updated again.
111    pub ttl: u64,
112    /// Data containing system information.
113    pub data: GBFSSystemInformationDataV10,
114}