From a304c24b32c0327436bbd8c2853e60668e161b42 Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Mon, 29 Dec 2025 00:41:52 +0100 Subject: Rename a lot of stuff, add Santiago real time --- .../Queries/RoutesListContent.cs | 66 ---------------------- 1 file changed, 66 deletions(-) delete mode 100644 src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/Queries/RoutesListContent.cs (limited to 'src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/Queries/RoutesListContent.cs') diff --git a/src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/Queries/RoutesListContent.cs b/src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/Queries/RoutesListContent.cs deleted file mode 100644 index fc69452..0000000 --- a/src/Costasdev.Busurbano.Sources.OpenTripPlannerGql/Queries/RoutesListContent.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.Globalization; -using System.Text.Json.Serialization; - -namespace Costasdev.Busurbano.Sources.OpenTripPlannerGql.Queries; - -public class RoutesListContent : IGraphRequest -{ - public record Args(string[] Feeds, string ServiceDate); - - public static string Query(Args args) - { - var feedsStr = string.Join(", ", args.Feeds.Select(f => $"\"{f}\"")); - return string.Create(CultureInfo.InvariantCulture, $$""" - query Query { - routes(feeds: [{{feedsStr}}]) { - gtfsId - shortName - longName - color - textColor - sortOrder - agency { - name - } - patterns { - tripsForDate(serviceDate: "{{args.ServiceDate}}") { - id - } - } - } - } - """); - } -} - -public class RoutesListResponse : AbstractGraphResponse -{ - [JsonPropertyName("routes")] public List Routes { get; set; } = []; - - public class RouteItem - { - [JsonPropertyName("gtfsId")] public required 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("sortOrder")] public int? SortOrder { get; set; } - [JsonPropertyName("agency")] public AgencyItem? Agency { get; set; } - [JsonPropertyName("patterns")] public List Patterns { get; set; } = []; - } - - public class AgencyItem - { - [JsonPropertyName("name")] public string? Name { get; set; } - } - - public class PatternItem - { - [JsonPropertyName("tripsForDate")] public List TripsForDate { get; set; } = []; - } - - public class TripItem - { - [JsonPropertyName("id")] public string? Id { get; set; } - } -} -- cgit v1.3