aboutsummaryrefslogtreecommitdiff
path: root/src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/Queries/RouteDetailsContent.cs
diff options
context:
space:
mode:
authorAriel Costas Guerrero <ariel@costas.dev>2025-12-29 00:41:52 +0100
committerAriel Costas Guerrero <ariel@costas.dev>2025-12-29 00:41:52 +0100
commita304c24b32c0327436bbd8c2853e60668e161b42 (patch)
tree08f65c05daca134cf4d2e4f779bd15d98fd66370 /src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/Queries/RouteDetailsContent.cs
parent120a3c6bddd0fb8d9fa05df4763596956554c025 (diff)
Rename a lot of stuff, add Santiago real time
Diffstat (limited to 'src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/Queries/RouteDetailsContent.cs')
-rw-r--r--src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/Queries/RouteDetailsContent.cs112
1 files changed, 0 insertions, 112 deletions
diff --git a/src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/Queries/RouteDetailsContent.cs b/src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/Queries/RouteDetailsContent.cs
deleted file mode 100644
index 1ba85fa..0000000
--- a/src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/Queries/RouteDetailsContent.cs
+++ /dev/null
@@ -1,112 +0,0 @@
-using System.Globalization;
-using System.Text.Json.Serialization;
-
-namespace Costasdev.Busurbano.Sources.OpenTripPlannerGql.Queries;
-
-public class RouteDetailsContent : IGraphRequest<RouteDetailsContent.Args>
-{
- public record Args(string Id, string ServiceDate);
-
- public static string Query(Args args)
- {
- return string.Create(CultureInfo.InvariantCulture, $$"""
- query Query {
- route(id: "{{args.Id}}") {
- gtfsId
- shortName
- longName
- color
- textColor
- agency {
- name
- }
-
- patterns {
- id
- name
- headsign
- directionId
- code
- semanticHash
-
- patternGeometry {
- points
- }
-
- stops {
- gtfsId
- code
- name
- lat
- lon
- }
-
- tripsForDate(serviceDate: "{{args.ServiceDate}}") {
- stoptimes {
- scheduledDeparture
- }
- }
- }
- }
- }
- """);
- }
-}
-
-public class RouteDetailsResponse : AbstractGraphResponse
-{
- [JsonPropertyName("route")] public RouteItem? Route { get; set; }
-
- public class RouteItem
- {
- [JsonPropertyName("gtfsId")] public string? GtfsId { get; set; }
- [JsonPropertyName("shortName")] public string? ShortName { get; set; }
- [JsonPropertyName("longName")] public string? LongName { get; set; }
- [JsonPropertyName("color")] public string? Color { get; set; }
- [JsonPropertyName("textColor")] public string? TextColor { get; set; }
- [JsonPropertyName("agency")] public AgencyItem? Agency { get; set; }
- [JsonPropertyName("patterns")] public List<PatternItem> Patterns { get; set; } = [];
- }
-
- public class AgencyItem
- {
- [JsonPropertyName("name")] public string? Name { get; set; }
- }
-
- public class PatternItem
- {
- [JsonPropertyName("id")] public required string Id { get; set; }
- [JsonPropertyName("name")] public string? Name { get; set; }
- [JsonPropertyName("headsign")] public string? Headsign { get; set; }
- [JsonPropertyName("directionId")] public int DirectionId { get; set; }
- [JsonPropertyName("code")] public string? Code { get; set; }
- [JsonPropertyName("semanticHash")] public string? SemanticHash { get; set; }
- [JsonPropertyName("patternGeometry")] public GeometryItem? PatternGeometry { get; set; }
- [JsonPropertyName("stops")] public List<StopItem> Stops { get; set; } = [];
- [JsonPropertyName("tripsForDate")] public List<TripItem> TripsForDate { get; set; } = [];
- }
-
- public class GeometryItem
- {
- [JsonPropertyName("points")] public string? Points { get; set; }
- }
-
- public class StopItem
- {
- [JsonPropertyName("gtfsId")] public required string GtfsId { get; set; }
- [JsonPropertyName("code")] public string? Code { get; set; }
- [JsonPropertyName("name")] public required string Name { get; set; }
- [JsonPropertyName("lat")] public double Lat { get; set; }
- [JsonPropertyName("lon")] public double Lon { get; set; }
- }
-
- public class TripItem
- {
- [JsonPropertyName("stoptimes")] public List<StoptimeItem> Stoptimes { get; set; } = [];
- }
-
- public class StoptimeItem
- {
- [JsonPropertyName("scheduledDeparture")] public int ScheduledDeparture { get; set; }
- }
-}