gistools/readers/gbfs/schema_v3/
system_regions.rs

1use crate::readers::GBFSName;
2use alloc::{string::String, vec::Vec};
3use serde::{Deserialize, Serialize};
4
5/// # GBFS System Regions Schema V3.1-RC & V3.0
6/// Describes regions for a system that is broken up by geographic or political region.
7///
8/// ## Links
9/// - [GBFS Specification V3.1-RC](https://github.com/MobilityData/gbfs/blob/v3.1-RC/gbfs.md#system_regionsjson)
10/// - [GBFS Specification V3.0](https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#system_regionsjson)
11pub type GBFSSystemRegionsV3 = GBFSSystemRegionsV30;
12
13/// GBFS Station Information Region
14#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
15pub struct GBFSSystemRegionsRegionV30 {
16    /// Identifier of the region.
17    pub region_id: String,
18    /// Public name for this region.
19    pub name: Vec<GBFSName>,
20}
21
22/// GBFS Station Information Data
23#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
24pub struct GBFSSystemRegionsDataV30 {
25    /// Stations
26    pub regions: Vec<GBFSSystemRegionsRegionV30>,
27}
28
29/// # GBFS System Regions Schema V3.0
30/// Describes regions for a system that is broken up by geographic or political region.
31///
32/// ## Links
33/// - [GBFS Specification](https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#system_regionsjson)
34#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
35pub struct GBFSSystemRegionsV30 {
36    /// Last time the data in the feed was updated in RFC3339 format.
37    pub last_updated: String,
38    /// Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).
39    pub ttl: u64,
40    /// GBFS version number to which the feed conforms.
41    pub version: String,
42    /// Data describing regions for a system.
43    pub data: GBFSSystemRegionsDataV30,
44}