Oseth

class Oseth

OpenData & API Client Wrapper The methods starting with api* call directly to OSETH, avoid them when possible

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
fun addRoute(route: Route)

Adds an "unofficial" route to the database

Link copied to clipboard
fun addServiceForDate(id: ServiceId, date: LocalDate)

Adds a service to the database

Link copied to clipboard
fun addShape(id: ShapeId, coordinates: List<Coordinates>)

Adds a shape to the database

Link copied to clipboard
fun addStop(stop: Stop)

Adds a stop in the database

Link copied to clipboard
fun addTimetable(timetable: Timetable, offset: Long)

Adds a timetable to the database

Link copied to clipboard
fun addTrip(trip: Trip)

Adds an "unofficial" trip to the database

Link copied to clipboard
suspend fun apiRouteInfo(routeId: RouteId, shapeId: ShapeId, language: Language = Language.GREEK): Result<DetailedRoute>

API CALL NEEDED

Link copied to clipboard
suspend fun apiTimetable(routeId: RouteId, shapeId: ShapeId, from: Instant, language: Language = Language.GREEK): Result<Timetable>

API CALL NEEDED

Link copied to clipboard
suspend fun apiTimetableForToday(routeId: RouteId, shapeId: ShapeId, language: Language = Language.GREEK, timezone: TimeZone = TimeZone.currentSystemDefault()): Result<Timetable>

API CALL NEEDED

Link copied to clipboard

Deletes a route from the database

Link copied to clipboard

Deletes a shape from the database

Link copied to clipboard

Deletes a stop from the database

Link copied to clipboard
fun deleteTimetable(timetable: Timetable)
fun deleteTimetable(trip: TripId, stop: StopId, sequence: Long)

Deletes a timetable from the database

Link copied to clipboard

Deletes a trip from the database

Link copied to clipboard

Deletes all the "unofficial" routes from the database

Link copied to clipboard

Deletes all the unofficial services

Link copied to clipboard

Delete all the "unofficial" shapes from the database

Link copied to clipboard

Deletes all the "unofficial" stops from the database

Link copied to clipboard

Delete all the "unofficial" timetables from the database

Link copied to clipboard

Deletes all the "unofficial" trips from the database

Link copied to clipboard
fun getDatesRunning(): List<LocalDate>

Gets the dates that a service is running

Link copied to clipboard

Gets the first stop times of a route and the starting station

Link copied to clipboard

Gets a route from the database

Link copied to clipboard

Gets all the internal database routes

Link copied to clipboard
fun getServicesForDate(date: LocalDate): List<ServiceId>

Gets the services that are running for a date

Link copied to clipboard

Gets a specific shape

Link copied to clipboard
fun getStop(id: StopId): Stop?

Gets a specific stop in the database

Link copied to clipboard

Gets all the stops in the database

Link copied to clipboard

Gets the stops of a route

Link copied to clipboard

Gets the stops of a trip

Link copied to clipboard
fun getStopTimesAfterTimeFromRoute(date: LocalDate, route: RouteId, stop: StopId, after: LocalTime, afterOffset: Long = 0): List<TimetableStopTime>

Gets the following times that a route stops at a specific stop after the specified time

Link copied to clipboard
fun getTimetable(id: TripId, stopId: StopId, sequence: Long): Timetable?

Gets the timetable from the database

Link copied to clipboard

Gets all the timetables for the current stop and trip combo

Link copied to clipboard
fun getTrip(id: TripId): Trip?

Gets a specific trip

Link copied to clipboard

Gets all the trips from a specific route

Link copied to clipboard
suspend fun sync(ignoreHash: Boolean = false): Boolean

Sync's the current local sqlite database to the OpenData remote