gistools/readers/gbfs/schema_v3/
gbfs_versions.rs

1use crate::readers::GBFSVersion;
2use alloc::{string::String, vec::Vec};
3use serde::{Deserialize, Serialize};
4
5/// # GBFS Versions Schema V3.1-RC & V3.0
6/// Lists all feed endpoints published according to versions of the GBFS documentation. (added in v1.1)
7///
8/// ## Links
9/// - [GBFS Specification V3.1-RC](https://github.com/MobilityData/gbfs/blob/v3.1-RC/gbfs.md#gbfs_versionsjson)
10/// - [GBFS Specification V3.0](https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#gbfs_versionsjson)
11pub type GBFSVersionsV3 = GBFSVersionsV30;
12
13/// Response data in the form of name:value pairs.
14#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
15pub struct GBFSVersionsDataV30 {
16    /// Contains one object for each of the available versions of a feed.
17    /// The array must be sorted by increasing MAJOR and MINOR version number.
18    pub versions: Vec<GBFSVersion>,
19}
20
21/// # GBFS Versions Schema V3.0
22/// Lists all feed endpoints published according to versions of the GBFS documentation. (added in v1.1)
23///
24/// ## Links
25/// - [GBFS Specification](https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#gbfs_versionsjson)
26#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
27pub struct GBFSVersionsV30 {
28    /// Last time the data in the feed was updated in RFC3339 format.
29    /// **Format**: date-time
30    pub last_updated: String,
31    /// Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).
32    /// **Minimum**: 0
33    pub ttl: u64,
34    /// GBFS version number to which the feed conforms, according to the versioning framework.
35    /// **Const**: 3.0
36    pub version: String,
37    /// Response data in the form of name:value pairs.
38    pub data: GBFSVersionsDataV30,
39}