blob: d735a8151c035a3ff2820d1ef47e401b734ef731 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
using System.Text.Json.Serialization;
namespace Enmarcha.Backend.Types.Otp;
public class OtpResponse
{
[JsonPropertyName("plan")]
public OtpPlan? Plan { get; set; }
[JsonPropertyName("error")]
public OtpError? Error { get; set; }
}
public class OtpError
{
[JsonPropertyName("id")]
public int Id { get; set; }
[JsonPropertyName("msg")]
public string? Msg { get; set; }
[JsonPropertyName("message")]
public string? Message { get; set; }
}
public class OtpPlan
{
[JsonPropertyName("date")]
public long Date { get; set; }
[JsonPropertyName("from")]
public OtpPlace? From { get; set; }
[JsonPropertyName("to")]
public OtpPlace? To { get; set; }
[JsonPropertyName("itineraries")]
public List<OtpItinerary> Itineraries { get; set; } = new();
}
public class OtpItinerary
{
[JsonPropertyName("duration")]
public long Duration { get; set; }
[JsonPropertyName("startTime")]
public long StartTime { get; set; }
[JsonPropertyName("endTime")]
public long EndTime { get; set; }
[JsonPropertyName("walkTime")]
public long WalkTime { get; set; }
[JsonPropertyName("transitTime")]
public long TransitTime { get; set; }
[JsonPropertyName("waitingTime")]
public long WaitingTime { get; set; }
[JsonPropertyName("walkDistance")]
public double WalkDistance { get; set; }
[JsonPropertyName("legs")]
public List<OtpLeg> Legs { get; set; } = new();
}
public class OtpLeg
{
[JsonPropertyName("startTime")]
public long StartTime { get; set; }
[JsonPropertyName("endTime")]
public long EndTime { get; set; }
[JsonPropertyName("mode")]
public string? Mode { get; set; }
[JsonPropertyName("route")]
public string? Route { get; set; }
[JsonPropertyName("routeShortName")]
public string? RouteShortName { get; set; }
[JsonPropertyName("routeLongName")]
public string? RouteLongName { get; set; }
[JsonPropertyName("agencyName")]
public string? AgencyName { get; set; }
[JsonPropertyName("from")]
public OtpPlace? From { get; set; }
[JsonPropertyName("to")]
public OtpPlace? To { get; set; }
[JsonPropertyName("legGeometry")]
public OtpGeometry? LegGeometry { get; set; }
[JsonPropertyName("steps")]
public List<OtpWalkStep> Steps { get; set; } = [];
[JsonPropertyName("headsign")]
public string? Headsign { get; set; }
[JsonPropertyName("distance")]
public double Distance { get; set; }
[JsonPropertyName("routeColor")]
public string? RouteColor { get; set; }
[JsonPropertyName("routeTextColor")]
public string? RouteTextColor { get; set; }
[JsonPropertyName("intermediateStops")]
public List<OtpPlace> IntermediateStops { get; set; } = [];
}
public class OtpPlace
{
[JsonPropertyName("name")]
public string? Name { get; set; }
[JsonPropertyName("lat")]
public double Lat { get; set; }
[JsonPropertyName("lon")]
public double Lon { get; set; }
[JsonPropertyName("stopId")]
public string? StopId { get; set; }
[JsonPropertyName("stopCode")]
public string? StopCode { get; set; }
}
public class OtpGeometry
{
[JsonPropertyName("points")]
public string? Points { get; set; }
[JsonPropertyName("length")]
public int Length { get; set; }
}
public class OtpWalkStep
{
[JsonPropertyName("distance")]
public double Distance { get; set; }
[JsonPropertyName("relativeDirection")]
public string? RelativeDirection { get; set; }
[JsonPropertyName("streetName")]
public string? StreetName { get; set; }
[JsonPropertyName("absoluteDirection")]
public string? AbsoluteDirection { get; set; }
[JsonPropertyName("lat")]
public double Lat { get; set; }
[JsonPropertyName("lon")]
public double Lon { get; set; }
}
|