start working on bar pinger and traewelling client

This commit is contained in:
Schrottkatze 2024-09-07 18:31:04 +02:00
parent 867514362a
commit 718fe00b46
Signed by: schrottkatze
SSH key fingerprint: SHA256:hXb3t1vINBFCiDCmhRABHX5ocdbLiKyCdKI4HK2Rbbc
13 changed files with 1062 additions and 48 deletions

View file

@ -0,0 +1,47 @@
use chrono::{DateTime, FixedOffset};
use serde::Deserialize;
#[derive(Deserialize, Debug)]
pub struct Container<D> {
pub data: D,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct Status {
train: TransportResource,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct TransportResource {
category: String,
line_name: String,
distance: u32,
duration: u32,
operator: OperatorResource,
origin: StopOverResource,
destination: StopOverResource,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct StopOverResource {
name: String,
ril_identifier: Option<String>,
arrival: Option<DateTime<FixedOffset>>,
arrival_planned: Option<DateTime<FixedOffset>>,
arrival_real: Option<DateTime<FixedOffset>>,
departure: Option<DateTime<FixedOffset>>,
departure_planned: Option<DateTime<FixedOffset>>,
departure_real: Option<DateTime<FixedOffset>>,
platform: Option<String>,
departure_platform_planned: Option<String>,
departure_platform_real: Option<String>,
}
#[derive(Deserialize, Debug)]
#[serde(rename_all = "camelCase")]
pub struct OperatorResource {
name: String,
}