pub const TransportationProductClass = enum(u32) {
    zug = 0,
    s_bahn = 1,
    u_bahn = 2,
    stadtbahn = 3,
    strassen_trambahn = 4,
    stadtbus = 5,
    regionalbus = 6,
    schnellbus = 7,
    seil_zahnradbahn = 8,
    schiff = 9,
    anruf_sammel_taxi = 10,
    sonstige = 11,
    flugzeug = 12,
    zug_nv = 13,
    zug_fv = 14,
    zug_fv_m_zuschlag = 15,
    zug_fv_m_spez_fpr = 16,
    sev = 17,
    zug_shuttle = 18,
    buergerbus = 19,
    rufbus_liniengebunden = 20,
    rufbus = 21,
    _,

    pub fn toString(self: TransportationProductClass) ?[]const u8 {
        return switch (self) {
            .zug => "Zug",
            .s_bahn => "S-Bahn",
            .u_bahn => "U-Bahn",
            .stadtbahn => "Stadtbahn",
            .strassen_trambahn => "Straßen-/Trambahn",
            .stadtbus => "Stadtbus",
            .regionalbus => "Regionalbus",
            .schnellbus => "Schnellbus",
            .seil_zahnradbahn => "Seil-/Zahnradbahn",
            .schiff => "Schiff",
            .anruf_sammel_taxi => "Anruf-Sammel-Taxi",
            .sonstige => "Sonstige",
            .flugzeug => "Flugzeug",
            .zug_nv => "Zug (Nahverkehr)",
            .zug_fv => "Zug (Fernverkehr)",
            .zug_fv_m_zuschlag => "Zug (Fernverkehr) mit Zuschlag",
            .zug_fv_m_spez_fpr => "Zug (Fernverkehr) mit spezifischer Fpr",
            .sev => "SEV Schnienenersatzverkehr",
            .zug_shuttle => "Zug Shuttle",
            .buergerbus => "Bürgerbus",
            .rufbus_liniengebunden => "Rufbus (liniengebunden)",
            .rufbus => "Rufbus",
            _ => null,
        };
    }
};

pub const Location = struct {
    id: []const u8,
    name: []const u8,
    properties: struct {
        platform: ?[]const u8 = null,
    },
};

pub const StopEvent = struct {
    location: Location,
    departureTimePlanned: []const u8,
    departureTimeBaseTimetable: []const u8,
    departureTimeEstimated: ?[]const u8 = null,
    transportation: struct {
        name: []const u8,
        product: struct {
            class: TransportationProductClass,
        },
        operator: ?struct {
            name: []const u8,
        } = null,
        destination: struct {
            name: []const u8,
        },
    },
    hints: ?[]const struct {
        content: []const u8,
        type: []const u8,
    } = null,
    isCancelled: bool = false,
};

pub const DmResponse = struct {
    locations: []const Location,
    stopEvents: []const StopEvent,
};
