Package com.citymapper.sdk.core.transit

Types

Link copied to clipboard
class AncestorResultIdentifier constructor(signature: Signature, token: String)

Identifies the ancestor result for a Route. Two Routes have the same identifier if they are descendants from the same original routing result, even if they now have different signatures. This allows treating updates to a Route (for example, due to re-routing events) as the "same" route from a user-facing point of view

Link copied to clipboard
enum BoardingSection : Enum<BoardingSection>
Link copied to clipboard
data class Brand(id: String, images: ImageResources<BrandImageResource>, name: String?)
Link copied to clipboard
data class BrandImageResource(uiRole: BrandUiRole, dimensions: ImageResource.Dimensions, @Size(min = 1) pixelRatioVariants: List<ImageResource.PixelRatioVariant>, hasSpaceForText: Boolean, isGeneric: Boolean, isDropoff: Boolean, lowCapacity: Boolean) : ImageResource<BrandUiRole>
Link copied to clipboard
enum BrandUiRole : Enum<BrandUiRole>
Link copied to clipboard
sealed class Departure
Link copied to clipboard
enum DepartureAvailability : Enum<DepartureAvailability>
Link copied to clipboard
data class DirectionsResults(routes: List<Route>)
Link copied to clipboard
enum DurationAccuracy : Enum<DurationAccuracy>
Link copied to clipboard
data class Frequency(min: Duration, max: Duration, startTime: Date?, endTime: Date?)
Link copied to clipboard
data class FrequencyDeparture(serviceId: ServiceId?, headsign: String?, shortName: String?, platformShortName: String?, frequency: Frequency) : Departure
Link copied to clipboard
interface HasInstructions
Link copied to clipboard
interface HasPathAnnotations
Link copied to clipboard
interface HasService
Link copied to clipboard
data class HiredVehicleLeg(distance: Distance, travelDuration: Duration?, vehicleType: VehicleType, service: Service, instructionSegments: List<InstructionSegment>?, pathAnnotations: List<PathAnnotation>?, path: PathGeometry, vehiclePickupOptions: List<VehiclePickupOption>, vehicleDropoffOptions: List<VehicleDropoffOption>) : SelfPilotedLeg, HasService

A leg where the user drives or rides a vehicle which they hire at the start of the leg, represented by the service.

Link copied to clipboard
data class HireVehicle(coords: Coords, name: String?, serviceId: String, propulsionType: PropulsionType?, currentRangeMeters: Int?, currentFuelPercent: Float?)
Link copied to clipboard
data class HireVehicleStation(coords: Coords, name: String?, serviceId: String?, numberOfVehiclesAvailable: Int?, numberOfDocksAvailable: Int?)
Link copied to clipboard
interface ImageResource<UiRole : Enum<*>>
Link copied to clipboard
data class ImageResources<T : ImageResource<*>>(allImages: List<T>)
Link copied to clipboard
data class Instruction(pathIndex: Int, location: Coords, descriptionText: String, descriptionFormat: String?, descriptionFormatReplacements: List<InstructionDescriptionFormatReplacement>?, type: InstructionType?, typeDirection: InstructionDirection?, bearingBefore: Float, bearingAfter: Float)
Link copied to clipboard
Link copied to clipboard
sealed class InstructionDirection
Link copied to clipboard
data class InstructionSegment(distance: Distance, duration: Duration?, endInstruction: Instruction, startPathIndex: Int, containingLegPath: PathGeometry)
Link copied to clipboard
sealed class InstructionType
Link copied to clipboard
sealed class Leg

A Leg represents a section of a Route traversed using a single mode of travel

Link copied to clipboard
data class LegStop(id: StopId, name: String, coordinates: Coords, indicatorText: String?, serviceChange: ServiceChange?)
Link copied to clipboard
object NoDeparture : Departure
Link copied to clipboard
data class OwnVehicleLeg(distance: Distance, travelDuration: Duration?, vehicleType: VehicleType, instructionSegments: List<InstructionSegment>?, pathAnnotations: List<PathAnnotation>?, path: PathGeometry) : SelfPilotedLeg

A leg where the user drives or rides a vehicle of their own

Link copied to clipboard
data class PathAnnotation(startIndex: Int, endIndex: Int, shouldWalk: Boolean?)
Link copied to clipboard
data class Price(formatted: String, amount: String?, currency: String?)
Link copied to clipboard
data class Profile(id: String)
Link copied to clipboard
data class ProfileDetail(profile: Profile, localizedName: String)
Link copied to clipboard
enum PropulsionType : Enum<PropulsionType>
Link copied to clipboard
data class Route(signature: Signature, ancestorResult: AncestorResultIdentifier, legs: List<Leg>, start: Waypoint, end: Waypoint, profileDetail: ProfileDetail?, duration: Duration?, durationAccuracy: DurationAccuracy, price: Price?, departureTime: Date?, arrivalTime: Date?)
Link copied to clipboard
sealed class SelfPilotedLeg : VehicleLeg, HasInstructions, HasPathAnnotations

A leg where the user drives or rides a vehicle themselves e.g. e-scooters, bicycles, motor scooters, private automobiles

Link copied to clipboard
data class Service(id: ServiceId, name: String, vehicleType: VehicleType, brand: Brand?, images: ImageResources<ServiceImageResource>, @ColorInt color: Int?, @ColorInt backgroundColor: Int?, textColor: String?)
Link copied to clipboard
data class ServiceChange(service: Service, headsign: String?)
Link copied to clipboard
typealias ServiceId = String
Link copied to clipboard
data class ServiceImageResource(uiRole: ServiceUiRole, dimensions: ImageResource.Dimensions, @Size(min = 1) pixelRatioVariants: List<ImageResource.PixelRatioVariant>, replacesName: Boolean) : ImageResource<ServiceUiRole>
Link copied to clipboard
data class ServiceStatus(severity: Severity, title: String, description: String?, stopRanges: List<StopRange>?, serviceIds: List<ServiceId>) : Status
Link copied to clipboard
enum ServiceUiRole : Enum<ServiceUiRole>
Link copied to clipboard
enum Severity : Enum<Severity>
Link copied to clipboard
interface Signature
Link copied to clipboard
data class StationWalkDetails(duration: Duration, recommendedExitName: String?)
Link copied to clipboard
enum StationWalkType : Enum<StationWalkType>
Link copied to clipboard
sealed class Status
Link copied to clipboard
typealias StopId = String
Link copied to clipboard
data class StopRange(startId: StopId, endId: StopId)
Link copied to clipboard
data class StopStatus(severity: Severity, title: String, description: String?, stopIds: List<StopId>) : Status
Link copied to clipboard
enum TimeStatus : Enum<TimeStatus>
Link copied to clipboard
data class TransitLeg(distance: Distance, path: PathGeometry, fallbackDuration: Duration?, stops: List<LegStop>, departure: Departure, allServiceOptions: List<Service>, allDepartureOptions: List<Departure>, statuses: List<Status>?, legDepartureTime: Date?, legArrivalTime: Date?, directionDescription: String?, bestBoardingSections: List<BoardingSection>?) : VehicleLeg, HasService

A leg of a Journey involving taking transit. This leg usually represents a specific departure, but may include some information about alternative routes which may be taken.

Link copied to clipboard
data class VehicleDeparture(serviceId: ServiceId, headsign: String?, shortName: String?, timeName: String?, platformShortName: String?, scheduledTime: Date?, liveTime: Date?, isLive: Boolean, timeStatus: TimeStatus?) : Departure
Link copied to clipboard
sealed class VehicleDropoffOption
Link copied to clipboard
sealed class VehicleLeg : Leg

A leg which involves using a vehicle to travel

Link copied to clipboard
sealed class VehiclePickupOption
Link copied to clipboard
enum VehicleType : Enum<VehicleType>
Link copied to clipboard
data class WalkLeg(distance: Distance, travelDuration: Duration?, instructionSegments: List<InstructionSegment>?, pathAnnotations: List<PathAnnotation>?, path: PathGeometry, stationWalkType: StationWalkType, walkDetailsEnterStation: StationWalkDetails?, walkDetailsExitStation: StationWalkDetails?) : Leg, HasInstructions, HasPathAnnotations

A walking leg

Link copied to clipboard
data class Waypoint(coordinates: Coords)

Functions

Link copied to clipboard
Link copied to clipboard
fun Route.firstLegWithService(): Leg?
Link copied to clipboard
fun Route.firstVehicleLeg(): Leg?
Link copied to clipboard
fun <UiRole : Enum<*>, T : ImageResource<UiRole>> ImageResources<T>.forRole(uiRole: UiRole, desiredDimensions: ImageResource.Dimensions? = null, filterBy: (T) -> Boolean? = null, preferBy: (T) -> Boolean? = null): T?

Retrieve an image asset for the specified criteria

fun ImageResources<BrandImageResource>.forRole(uiRole: BrandUiRole, needsSpaceForText: Boolean? = null, desiredDimensions: ImageResource.Dimensions? = null, isDropoffPlace: Boolean = false, lowCapacity: Boolean = false): BrandImageResource?

Retrieve a brand image asset for the specified criteria

Link copied to clipboard
inline fun <T : Leg> Route.getFirstLegOfType(): T?
Link copied to clipboard
fun Route.hasUnlockableVehicle(): Boolean
Link copied to clipboard
fun Leg.isSelfPiloted(): Boolean
Link copied to clipboard
fun Severity.isTravelAffectedOrPrevented(): Boolean
Link copied to clipboard
fun Leg.isWalk(): Boolean
Link copied to clipboard
fun ImageResources<ServiceImageResource>.serviceImage(desiredDimensions: ImageResource.Dimensions? = null): ServiceImageResource?

Retrieve a service image asset for the specified criteria

Properties

Link copied to clipboard
val Instruction.isArrive: Boolean
Link copied to clipboard
val Instruction.isDepart: Boolean