// <auto-generated />
//
// To parse this JSON data, add NuGet 'Newtonsoft.Json' then do:
//
//    using bahnplan.web.JSON;
//
//    var oeapiResponse = OeapiResponse.FromJson(jsonString);

using System.Collections.Generic;
using Newtonsoft.Json;

namespace bahnplan.web.JSON {
	using J = JsonPropertyAttribute;
	using R = Required;
	using N = NullValueHandling;

	public partial class OeapiResponse {
		[J("status", NullValueHandling = N.Ignore)]
		public string Status { get; set; }

		[J("msg", NullValueHandling = N.Ignore)]
		public string Msg { get; set; }

		[J("data", NullValueHandling = N.Ignore)]
		public Data Data { get; set; }
	}

	public class Data {
		[J("reqId", NullValueHandling = N.Ignore)]
		public string ReqId { get; set; }

		[J("lastUpdated", NullValueHandling = N.Ignore)]
		public long? LastUpdated { get; set; }

		[J("params", NullValueHandling = N.Ignore)]
		public Params Params { get; set; }

		[J("journeys", NullValueHandling = N.Ignore)]
		public Dictionary<string, OJourney> Journeys { get; set; }
	}

	public class OJourney {
		[J("lastUpdated", NullValueHandling = N.Ignore)]
		public long? LastUpdated { get; set; }

		[J("legs", NullValueHandling = N.Ignore)]
		public List<Leg> Legs { get; set; }

		[J("price")] public object Price { get; set; }
	}

	public class Leg {
		[J("isWalking", NullValueHandling = N.Ignore)]
		public bool? IsWalking { get; set; }

		[J("isTransfer", NullValueHandling = N.Ignore)]
		public bool? IsTransfer { get; set; }

		[J("cancelled", NullValueHandling = N.Ignore)]
		public bool? Cancelled { get; set; }

		[J("departure", NullValueHandling = N.Ignore)]
		public Arrival Departure { get; set; }

		[J("arrival", NullValueHandling = N.Ignore)]
		public Arrival Arrival { get; set; }

		[J("polyline")] public object Polyline { get; set; }
		[J("distance")] public object Distance { get; set; }

		[J("line", NullValueHandling = N.Ignore)]
		public Line Line { get; set; }

		[J("direction", NullValueHandling = N.Ignore)]
		public string Direction { get; set; }

		[J("stopovers", NullValueHandling = N.Ignore)]
		public List<Stopover> Stopovers { get; set; }

		[J("remarks", NullValueHandling = N.Ignore)]
		public List<Remark> Remarks { get; set; }
	}

	public class Arrival {
		[J("point", NullValueHandling = N.Ignore)]
		public Point Point { get; set; }

		[J("plannedTime")]       public long?  PlannedTime       { get; set; }
		[J("prognosedTime")]     public long?  PrognosedTime     { get; set; }
		[J("plannedPlatform")]   public string PlannedPlatform   { get; set; }
		[J("prognosedPlatform")] public object PrognosedPlatform { get; set; }
	}

	public class Point {
		[J("stop", NullValueHandling = N.Ignore)]
		public Stop Stop { get; set; }

		[J("location")] public object Location { get; set; }
	}

	public class Stop {
		[J("id", NullValueHandling = N.Ignore)]
		public string Id { get; set; }

		[J("name", NullValueHandling = N.Ignore)]
		public string Name { get; set; }

		[J("location", NullValueHandling = N.Ignore)]
		public Location Location { get; set; }

		[J("products", NullValueHandling = N.Ignore)]
		public Products Products { get; set; }

		[J("station")] public object Station { get; set; }
	}

	public class Location {
		[J("latitude", NullValueHandling = N.Ignore)]
		public double? Latitude { get; set; }

		[J("longitude", NullValueHandling = N.Ignore)]
		public double? Longitude { get; set; }

		[J("name")]    public object Name    { get; set; }
		[J("address")] public object Address { get; set; }
		[J("id")]      public object Id      { get; set; }
	}

	public class Products {
		[J("nationalExp", NullValueHandling = N.Ignore)]
		public bool? NationalExp { get; set; }

		[J("national", NullValueHandling = N.Ignore)]
		public bool? National { get; set; }

		[J("regionalExp", NullValueHandling = N.Ignore)]
		public bool? RegionalExp { get; set; }

		[J("regional", NullValueHandling = N.Ignore)]
		public bool? Regional { get; set; }

		[J("suburban", NullValueHandling = N.Ignore)]
		public bool? Suburban { get; set; }

		[J("bus", NullValueHandling = N.Ignore)]
		public bool? Bus { get; set; }

		[J("ferry", NullValueHandling = N.Ignore)]
		public bool? Ferry { get; set; }

		[J("subway", NullValueHandling = N.Ignore)]
		public bool? Subway { get; set; }

		[J("tram", NullValueHandling = N.Ignore)]
		public bool? Tram { get; set; }

		[J("taxi", NullValueHandling = N.Ignore)]
		public bool? Taxi { get; set; }
	}

	public class Line {
		[J("id", NullValueHandling = N.Ignore)]
		public string Id { get; set; }

		[J("name", NullValueHandling = N.Ignore)]
		public string Name { get; set; }

		[J("mode", NullValueHandling = N.Ignore)]
		public string Mode { get; set; }

		[J("product", NullValueHandling = N.Ignore)]
		public string Product { get; set; }

		[J("tripNum", NullValueHandling = N.Ignore)]
		public string TripNum { get; set; }

		[J("productName", NullValueHandling = N.Ignore)]
		public string ProductName { get; set; }

		[J("fullProductName", NullValueHandling = N.Ignore)]
		public string FullProductName { get; set; }

		[J("operator")]       public object Operator       { get; set; }
		[J("additionalName")] public string AdditionalName { get; set; }
	}

	public class Remark {
		[J("type", NullValueHandling = N.Ignore)]
		public string Type { get; set; }

		[J("code", NullValueHandling = N.Ignore)]
		public string Code { get; set; }

		[J("summary")] public string Summary { get; set; }

		[J("text", NullValueHandling = N.Ignore)]
		public string Text { get; set; }

		[J("tripId")] public object TripId { get; set; }
	}

	public class Stopover {
		[J("stop", NullValueHandling = N.Ignore)]
		public Stop Stop { get; set; }

		[J("cancelled", NullValueHandling = N.Ignore)]
		public bool? Cancelled { get; set; }

		[J("departure", NullValueHandling = N.Ignore)]
		public Arrival Departure { get; set; }

		[J("arrival", NullValueHandling = N.Ignore)]
		public Arrival Arrival { get; set; }
	}

	public class Params {
		[J("fromPoint", NullValueHandling = N.Ignore)]
		public Point FromPoint { get; set; }

		[J("toPoint", NullValueHandling = N.Ignore)]
		public Point ToPoint { get; set; }

		[J("viaPoint")]   public object ViaPoint   { get; set; }
		[J("earlierRef")] public object EarlierRef { get; set; }
		[J("laterRef")]   public object LaterRef   { get; set; }
		[J("results")]    public object Results    { get; set; }

		[J("stopovers", NullValueHandling = N.Ignore)]
		public bool? Stopovers { get; set; }

		[J("polylines", NullValueHandling = N.Ignore)]
		public bool? Polylines { get; set; }

		[J("remarks", NullValueHandling = N.Ignore)]
		public bool? Remarks { get; set; }

		[J("bikeFriendly")] public object BikeFriendly { get; set; }

		[J("tickets", NullValueHandling = N.Ignore)]
		public bool? Tickets { get; set; }

		[J("startWithWalking")] public object StartWithWalking { get; set; }
		[J("scheduledDays")]    public object ScheduledDays    { get; set; }

		[J("accessibility", NullValueHandling = N.Ignore)]
		public string Accessibility { get; set; }

		[J("transfers")]    public object Transfers    { get; set; }
		[J("transferTime")] public object TransferTime { get; set; }
		[J("arrival")]      public object Arrival      { get; set; }

		[J("departure", NullValueHandling = N.Ignore)]
		public long? Departure { get; set; }

		[J("products", NullValueHandling = N.Ignore)]
		public Products Products { get; set; }
	}

	public partial class OeapiResponse {
		public static OeapiResponse FromJson(string json) => JsonConvert.DeserializeObject<OeapiResponse>(json, Converter.Settings);
	}
}