gistools/readers/gbfs/schema_v3/
manifest.rs

1use crate::readers::GBFSVersion;
2use alloc::{string::String, vec::Vec};
3use serde::{Deserialize, Serialize};
4
5/// # GBFS Manifest Schema V3.1-RC & V3.0
6/// An index of gbfs.json URLs for each GBFS data set produced by a publisher. A single instance of
7/// this file should be published at a single stable URL, for example: https://example.com/gbfs/manifest.json.
8///
9/// ## Links
10/// - [GBFS Specification V3.1-RC](https://github.com/MobilityData/gbfs/blob/v3.1-RC/gbfs.md#manifestjson)
11/// - [GBFS Specification V3.0](https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#manifestjson)
12pub type GBFSManifestV3 = GBFSManifestV30;
13
14/// GBFS Manifest Data
15#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
16pub struct GBFSManifestV30Data {
17    /// Array of datasets containing system IDs and versions.
18    pub datasets: Vec<GBFSVersion>,
19}
20
21/// # GBFS Manifest Schema V3.0
22/// An index of gbfs.json URLs for each GBFS data set produced by a publisher. A single instance of
23/// this file should be published at a single stable URL, for example: https://example.com/gbfs/manifest.json.
24///
25/// ## Links
26/// - [GBFS Specification](https://github.com/MobilityData/gbfs/blob/v3.0/gbfs.md#manifestjson)
27#[derive(Debug, Default, Clone, Serialize, Deserialize, PartialEq)]
28pub struct GBFSManifestV30 {
29    /// Last time the data in the feed was updated in RFC3339 format.
30    /// **Format**: date-time
31    pub last_updated: String,
32    /// Number of seconds before the data in the feed will be updated again (0 if the data should always be refreshed).
33    /// **Minimum**: 0
34    pub ttl: u64,
35    /// GBFS version number to which the feed conforms, according to the versioning framework.
36    /// **Const**: '3.0'
37    pub version: String,
38    /// Data object containing the list of datasets.
39    pub data: GBFSManifestV30Data,
40}