Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions android/src/test/kotlin/TestModel.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ModelTest {

@Test
fun testWaypoint() {
val waypoint = Waypoint("name", listOf(1.0, 2.0))
val waypoint = Waypoint(listOf(1.0, 2.0), 42.0,"name")
assertEquals("name", waypoint.name)
assertEquals(listOf(1.0, 2.0), waypoint.location)
}
Expand All @@ -28,10 +28,10 @@ class ModelTest {

val route = response?.routes?.first() ?: fail("response must have at least one route")

assertEquals(1, route.legs?.size)
assertEquals(4, route.legs?.first()?.steps?.size)
assertEquals(1, route.legs.size)
assertEquals(4, route.legs.first().steps.size)

val step = route.legs?.first()?.steps?.first() ?: fail("route leg must have at least one step")
val step = route.legs.first().steps.first()

assertEquals("State Highway 65", step.name)
assertEquals("tezuoAezllgIfhAdStpAzV`hAxQlxA|X|i@vIdQpCnxClh@laCjd@dRdDr}@zOxgApR`pBf^jk@hKvmAnUfJ|AdDj@tCR", step.geometry)
Expand Down
36 changes: 36 additions & 0 deletions apple/Sources/OSRM/Models/Admin.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
//
// Admin.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//

import Foundation
#if canImport(AnyCodable)
import AnyCodable
#endif

public struct Admin: Codable, Hashable {
/** The ISO 3166-1 two-character code for the admin region. */
public var iso31661: String?
/** The ISO 3166-1 three-character code for the admin region. */
public var iso31661Alpha3: String?

public init(iso31661: String? = nil, iso31661Alpha3: String? = nil) {
self.iso31661 = iso31661
self.iso31661Alpha3 = iso31661Alpha3
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case iso31661 = "iso_3166_1"
case iso31661Alpha3 = "iso_3166_1_alpha3"
}

// Encodable protocol methods

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(iso31661, forKey: .iso31661)
try container.encodeIfPresent(iso31661Alpha3, forKey: .iso31661Alpha3)
}
}
17 changes: 10 additions & 7 deletions apple/Sources/OSRM/Models/Annotation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,27 @@ import Foundation
#endif

public struct Annotation: Codable, Hashable {
/** The distance, in metres, between each pair of coordinates */
/** The distance, in meters, between each pair of coordinates. */
public var distance: [Double]?
/** The duration between each pair of coordinates, in seconds */
/** The duration between each pair of coordinates, in seconds. */
public var duration: [Double]?
/** The index of the datasource for the speed between each pair of coordinates. 0 is the default profile. Other values are supplied via --segment-speed-file to osrm-contract. This is OSRM-specific and not supported by most other routers. */
public var datasources: [Int]?
/** The OSM node ID for each coordinate along the route (excluding the first/last user-supplied coordinates). This is not included in Valhalla-derived routers. */
public var nodes: [Int]?
public var weight: [Int]?
/** The estimated speed of travel between each pair of coordinates in meters/sec. */
public var speed: [Double]?
public var metadata: AnnotationMetadata?
public var maxspeed: [SpeedLimit]?

public init(distance: [Double]? = nil, duration: [Double]? = nil, datasources: [Int]? = nil, nodes: [Int]? = nil, weight: [Int]? = nil, speed: [Double]? = nil, metadata: AnnotationMetadata? = nil) {
public init(distance: [Double]? = nil, duration: [Double]? = nil, datasources: [Int]? = nil, nodes: [Int]? = nil, weight: [Int]? = nil, speed: [Double]? = nil, maxspeed: [SpeedLimit]? = nil) {
self.distance = distance
self.duration = duration
self.datasources = datasources
self.nodes = nodes
self.weight = weight
self.speed = speed
self.metadata = metadata
self.maxspeed = maxspeed
}

public enum CodingKeys: String, CodingKey, CaseIterable {
Expand All @@ -38,7 +41,7 @@ public struct Annotation: Codable, Hashable {
case nodes
case weight
case speed
case metadata
case maxspeed
}

// Encodable protocol methods
Expand All @@ -51,6 +54,6 @@ public struct Annotation: Codable, Hashable {
try container.encodeIfPresent(nodes, forKey: .nodes)
try container.encodeIfPresent(weight, forKey: .weight)
try container.encodeIfPresent(speed, forKey: .speed)
try container.encodeIfPresent(metadata, forKey: .metadata)
try container.encodeIfPresent(maxspeed, forKey: .maxspeed)
}
}
30 changes: 0 additions & 30 deletions apple/Sources/OSRM/Models/AnnotationMetadata.swift

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//
// BannerInstructionsPrimaryComponentsInner.swift
// BannerComponent.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
Expand All @@ -10,11 +10,20 @@ import Foundation
import AnyCodable
#endif

public struct BannerInstructionsPrimaryComponentsInner: Codable, Hashable {
public struct BannerComponent: Codable, Hashable {
public enum ModelType: String, Codable, CaseIterable {
case text
case icon
case delimiter
case exitNumber = "exit-number"
case exit
case lane
}

public var text: String?
public var type: String?
public var type: ModelType?

public init(text: String? = nil, type: String? = nil) {
public init(text: String? = nil, type: ModelType? = nil) {
self.text = text
self.type = type
}
Expand Down
28 changes: 24 additions & 4 deletions apple/Sources/OSRM/Models/BannerContent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,32 @@ import Foundation
#endif

public struct BannerContent: Codable, Hashable {
public enum ModelType: String, Codable, CaseIterable {
case turn
case newName = "new name"
case depart
case arrive
case merge
case onRamp = "on ramp"
case offRamp = "off ramp"
case fork
case endOfRoad = "end of road"
case _continue = "continue"
case roundabout
case rotary
case roundaboutTurn = "roundabout turn"
case notification
case exitRoundabout = "exit roundabout"
case exitRotary = "exit rotary"
}

public var text: String
public var type: String?
public var modifier: String?
public var components: [BannerContentComponentsInner]?
public var type: ModelType?
public var modifier: GuidanceModifier?
/** A list of objects with additional context that allow for visual layout improvements beyond what's possible with plain text. */
public var components: [BannerComponent]?

public init(text: String, type: String? = nil, modifier: String? = nil, components: [BannerContentComponentsInner]? = nil) {
public init(text: String, type: ModelType? = nil, modifier: GuidanceModifier? = nil, components: [BannerComponent]? = nil) {
self.text = text
self.type = type
self.modifier = modifier
Expand Down
34 changes: 0 additions & 34 deletions apple/Sources/OSRM/Models/BannerContentComponentsInner.swift

This file was deleted.

1 change: 1 addition & 0 deletions apple/Sources/OSRM/Models/BannerInstruction.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import Foundation
#endif

public struct BannerInstruction: Codable, Hashable {
/** How far (in meters) from the upcoming maneuver the instruction should start being displayed. */
public var distanceAlongGeometry: Double
public var primary: BannerContent
public var secondary: BannerContent?
Expand Down
42 changes: 0 additions & 42 deletions apple/Sources/OSRM/Models/BannerInstructionPrimary.swift

This file was deleted.

This file was deleted.

38 changes: 0 additions & 38 deletions apple/Sources/OSRM/Models/BannerInstructions.swift

This file was deleted.

Loading