153 lines
5.9 KiB
C#
153 lines
5.9 KiB
C#
// <auto-generated />
|
|
//
|
|
// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
|
|
//
|
|
// using ZTravel.API.Marudor.HAFAS.Details;
|
|
//
|
|
// var marudorHafasDetailsResponse = MarudorHafasDetailsResponse.FromJson(jsonString);
|
|
|
|
namespace ZTravel.API.Marudor.HAFAS.Details
|
|
{
|
|
using System;
|
|
using System.Collections.Generic;
|
|
|
|
using System.Globalization;
|
|
using Newtonsoft.Json;
|
|
using Newtonsoft.Json.Converters;
|
|
using J = Newtonsoft.Json.JsonPropertyAttribute;
|
|
using R = Newtonsoft.Json.Required;
|
|
using N = Newtonsoft.Json.NullValueHandling;
|
|
|
|
public partial class MarudorHafasDetailsResponse
|
|
{
|
|
[J("arrival")] public Arrival Arrival { get; set; }
|
|
[J("departure")] public Arrival Departure { get; set; }
|
|
[J("duration")] public long Duration { get; set; }
|
|
[J("plannedSequence")] public PlannedSequence PlannedSequence { get; set; }
|
|
[J("train")] public Train Train { get; set; }
|
|
[J("segmentStart")] public Segment SegmentStart { get; set; }
|
|
[J("segmentDestination")] public Segment SegmentDestination { get; set; }
|
|
[J("stops")] public List<Stop> Stops { get; set; }
|
|
[J("finalDestination")] public string FinalDestination { get; set; }
|
|
[J("jid")] public string Jid { get; set; }
|
|
[J("auslastung")] public Auslastung Auslastung { get; set; }
|
|
[J("messages")] public List<Message> Messages { get; set; }
|
|
[J("type")] public string Type { get; set; }
|
|
}
|
|
|
|
public partial class Arrival
|
|
{
|
|
[J("platform")] public string Platform { get; set; }
|
|
[J("scheduledTime")] public long ScheduledTime { get; set; }
|
|
[J("time")] public long Time { get; set; }
|
|
[J("reihung")] public bool Reihung { get; set; }
|
|
}
|
|
|
|
public partial class Auslastung
|
|
{
|
|
[J("first")] public long First { get; set; }
|
|
[J("second")] public long Second { get; set; }
|
|
}
|
|
|
|
public partial class Message
|
|
{
|
|
[J("type")] public string Type { get; set; }
|
|
[J("code")] public string Code { get; set; }
|
|
[J("prio")] public long Prio { get; set; }
|
|
[J("icoX")] public long IcoX { get; set; }
|
|
[J("txtN")] public string TxtN { get; set; }
|
|
}
|
|
|
|
public partial class PlannedSequence
|
|
{
|
|
[J("raw")] public string Raw { get; set; }
|
|
[J("short")] public string Short { get; set; }
|
|
[J("type")] public string Type { get; set; }
|
|
[J("wagons")] public Wagons Wagons { get; set; }
|
|
}
|
|
|
|
public partial class Wagons
|
|
{
|
|
[J("Apmzf")] public bool Apmzf { get; set; }
|
|
[J("Avmz")] public bool Avmz { get; set; }
|
|
[J("BRmz")] public bool BRmz { get; set; }
|
|
[J("Bpmbz")] public bool Bpmbz { get; set; }
|
|
[J("Bpmz")] public bool Bpmz { get; set; }
|
|
[J("Bpmzf")] public bool Bpmzf { get; set; }
|
|
[J("Bvmz")] public bool Bvmz { get; set; }
|
|
[J("WRmz")] public bool WRmz { get; set; }
|
|
}
|
|
|
|
public partial class Segment
|
|
{
|
|
[J("title")] public string Title { get; set; }
|
|
[J("id")] public string Id { get; set; }
|
|
}
|
|
|
|
public partial class Stop
|
|
{
|
|
[J("station")] public Station Station { get; set; }
|
|
[J("departure", NullValueHandling = N.Ignore)] public Arrival Departure { get; set; }
|
|
[J("auslastung", NullValueHandling = N.Ignore)] public Auslastung Auslastung { get; set; }
|
|
[J("arrival", NullValueHandling = N.Ignore)] public Arrival Arrival { get; set; }
|
|
[J("irisMessages", NullValueHandling = N.Ignore)] public List<IrisMessage> IrisMessages { get; set; }
|
|
}
|
|
|
|
public partial class IrisMessage
|
|
{
|
|
[J("text")] public string Text { get; set; }
|
|
[J("timestamp")] public long Timestamp { get; set; }
|
|
}
|
|
|
|
public partial class Station
|
|
{
|
|
[J("id")] public string Id { get; set; }
|
|
[J("title")] public string Title { get; set; }
|
|
[J("coordinates")] public Coordinates Coordinates { get; set; }
|
|
}
|
|
|
|
public partial class Coordinates
|
|
{
|
|
[J("lng")] public double Lng { get; set; }
|
|
[J("lat")] public double Lat { get; set; }
|
|
}
|
|
|
|
public partial class Train
|
|
{
|
|
[J("name")] public string Name { get; set; }
|
|
[J("admin")] public string Admin { get; set; }
|
|
[J("number")] public string Number { get; set; }
|
|
[J("type")] public string Type { get; set; }
|
|
[J("operator")] public Operator Operator { get; set; }
|
|
}
|
|
|
|
public partial class Operator
|
|
{
|
|
[J("name")] public string Name { get; set; }
|
|
[J("icoX")] public long IcoX { get; set; }
|
|
}
|
|
|
|
public partial class MarudorHafasDetailsResponse
|
|
{
|
|
public static MarudorHafasDetailsResponse FromJson(string json) => JsonConvert.DeserializeObject<MarudorHafasDetailsResponse>(json, ZTravel.API.Marudor.HAFAS.Details.Converter.Settings);
|
|
}
|
|
|
|
public static class Serialize
|
|
{
|
|
public static string ToJson(this MarudorHafasDetailsResponse self) => JsonConvert.SerializeObject(self, ZTravel.API.Marudor.HAFAS.Details.Converter.Settings);
|
|
}
|
|
|
|
internal static class Converter
|
|
{
|
|
public static readonly JsonSerializerSettings Settings = new JsonSerializerSettings
|
|
{
|
|
MetadataPropertyHandling = MetadataPropertyHandling.Ignore,
|
|
DateParseHandling = DateParseHandling.None,
|
|
Converters =
|
|
{
|
|
new IsoDateTimeConverter { DateTimeStyles = DateTimeStyles.AssumeUniversal }
|
|
},
|
|
};
|
|
}
|
|
}
|