// // // To parse this JSON data, add NuGet 'Newtonsoft.Json' then do: // // using ZTravel.API.VRRF; // // var vrrfResponse = VrrfResponse.FromJson(jsonString); namespace ZTravel.API.VRRF { 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 VrrfResponse { [J("error")] public object Error { get; set; } [J("preformatted")] public List> Preformatted { get; set; } [J("raw")] public List Raw { get; set; } [J("version")] public string Version { get; set; } } public partial class Raw { [J("countdown")] public string Countdown { get; set; } [J("date")] public string Date { get; set; } [J("delay")] public string Delay { get; set; } [J("destination")] public string Destination { get; set; } [J("info")] public string Info { get; set; } [J("is_cancelled")] public long IsCancelled { get; set; } [J("key")] public string Key { get; set; } [J("line")] public string Line { get; set; } [J("lineref")] public Lineref Lineref { get; set; } [J("mot")] public string Mot { get; set; } [J("next_route")] public List NextRoute { get; set; } [J("platform")] public string Platform { get; set; } [J("platform_db")] public long PlatformDb { get; set; } [J("platform_name")] public string PlatformName { get; set; } [J("prev_route")] public List PrevRoute { get; set; } [J("sched_date")] public string SchedDate { get; set; } [J("sched_time")] public string SchedTime { get; set; } [J("time")] public string Time { get; set; } [J("type")] public string Type { get; set; } } public partial class Lineref { [J("direction")] public string Direction { get; set; } [J("identifier")] public string Identifier { get; set; } [J("mot")] public string Mot { get; set; } [J("name")] public string Name { get; set; } [J("operator")] public string Operator { get; set; } [J("route")] public string Route { get; set; } [J("type")] public string Type { get; set; } [J("valid")] public string Valid { get; set; } } public partial class VrrfResponse { public static VrrfResponse FromJson(string json) => JsonConvert.DeserializeObject(json, ZTravel.API.VRRF.Converter.Settings); } public static class Serialize { public static string ToJson(this VrrfResponse self) => JsonConvert.SerializeObject(self, ZTravel.API.VRRF.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 } }, }; } }