Skip to content

Commit

Permalink
Merge pull request #2 from stadiamaps/feat/voice-banner
Browse files Browse the repository at this point in the history
feat: added voice and banner instructions
  • Loading branch information
ianthetechie authored Apr 18, 2024
2 parents 95ce3bf + 74cb62e commit 39ad70c
Show file tree
Hide file tree
Showing 17 changed files with 832 additions and 2 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Test

on:
push:
branches: [ "*" ]
pull_request:
branches: [ main ]

jobs:
test:
runs-on: macos-14

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Test
run: swift test
32 changes: 32 additions & 0 deletions Package.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"pins" : [
{
"identity" : "anycodable",
"kind" : "remoteSourceControl",
"location" : "https://github.com/Flight-School/AnyCodable",
"state" : {
"revision" : "862808b2070cd908cb04f9aafe7de83d35f81b05",
"version" : "0.6.7"
}
},
{
"identity" : "swift-snapshot-testing",
"kind" : "remoteSourceControl",
"location" : "https://github.com/pointfreeco/swift-snapshot-testing.git",
"state" : {
"revision" : "625ccca8570773dd84a34ee51a81aa2bc5a4f97a",
"version" : "1.16.0"
}
},
{
"identity" : "swift-syntax",
"kind" : "remoteSourceControl",
"location" : "https://github.com/apple/swift-syntax",
"state" : {
"revision" : "fa8f95c2d536d6620cc2f504ebe8a6167c9fc2dd",
"version" : "510.0.1"
}
}
],
"version" : 2
}
14 changes: 13 additions & 1 deletion Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ let package = Package(
],
dependencies: [
.package(url: "https://github.com/Flight-School/AnyCodable", from: "0.6.1"),
.package(url: "https://github.com/pointfreeco/swift-snapshot-testing.git", from: "1.16.0")
],
targets: [
.target(
Expand All @@ -24,6 +25,17 @@ let package = Package(
"AnyCodable"
],
path: "apple/Sources/OSRM"
)
),
.testTarget(
name: "OSRMTests",
dependencies: [
"OSRM",
.product(name: "SnapshotTesting", package: "swift-snapshot-testing")
],
path: "apple/Tests/OSRM",
resources: [
.copy("TestData")
]
),
]
)
42 changes: 42 additions & 0 deletions apple/Sources/OSRM/Models/BannerContent.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// BannerContent.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//

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

public struct BannerContent: Codable, Hashable {
public var text: String
public var type: String?
public var modifier: String?
public var components: [BannerContentComponentsInner]?

public init(text: String, type: String? = nil, modifier: String? = nil, components: [BannerContentComponentsInner]? = nil) {
self.text = text
self.type = type
self.modifier = modifier
self.components = components
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case text
case type
case modifier
case components
}

// Encodable protocol methods

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(text, forKey: .text)
try container.encodeIfPresent(type, forKey: .type)
try container.encodeIfPresent(modifier, forKey: .modifier)
try container.encodeIfPresent(components, forKey: .components)
}
}
34 changes: 34 additions & 0 deletions apple/Sources/OSRM/Models/BannerContentComponentsInner.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// BannerContentComponentsInner.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//

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

public struct BannerContentComponentsInner: Codable, Hashable {
public var text: String?
public var type: String?

public init(text: String? = nil, type: String? = nil) {
self.text = text
self.type = type
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case text
case type
}

// Encodable protocol methods

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(text, forKey: .text)
try container.encodeIfPresent(type, forKey: .type)
}
}
38 changes: 38 additions & 0 deletions apple/Sources/OSRM/Models/BannerInstruction.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// BannerInstruction.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//

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

public struct BannerInstruction: Codable, Hashable {
public var distanceAlongGeometry: Double
public var primary: BannerContent
public var secondary: BannerContent?

public init(distanceAlongGeometry: Double, primary: BannerContent, secondary: BannerContent? = nil) {
self.distanceAlongGeometry = distanceAlongGeometry
self.primary = primary
self.secondary = secondary
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case distanceAlongGeometry
case primary
case secondary
}

// Encodable protocol methods

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encode(distanceAlongGeometry, forKey: .distanceAlongGeometry)
try container.encode(primary, forKey: .primary)
try container.encodeIfPresent(secondary, forKey: .secondary)
}
}
42 changes: 42 additions & 0 deletions apple/Sources/OSRM/Models/BannerInstructionPrimary.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// BannerInstructionPrimary.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//

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

public struct BannerInstructionPrimary: Codable, Hashable {
public var text: String?
public var type: String?
public var modifier: String?
public var components: [BannerInstructionPrimaryComponentsInner]?

public init(text: String? = nil, type: String? = nil, modifier: String? = nil, components: [BannerInstructionPrimaryComponentsInner]? = nil) {
self.text = text
self.type = type
self.modifier = modifier
self.components = components
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case text
case type
case modifier
case components
}

// Encodable protocol methods

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(text, forKey: .text)
try container.encodeIfPresent(type, forKey: .type)
try container.encodeIfPresent(modifier, forKey: .modifier)
try container.encodeIfPresent(components, forKey: .components)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// BannerInstructionPrimaryComponentsInner.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//

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

public struct BannerInstructionPrimaryComponentsInner: Codable, Hashable {
public var text: String?
public var type: String?

public init(text: String? = nil, type: String? = nil) {
self.text = text
self.type = type
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case text
case type
}

// Encodable protocol methods

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(text, forKey: .text)
try container.encodeIfPresent(type, forKey: .type)
}
}
38 changes: 38 additions & 0 deletions apple/Sources/OSRM/Models/BannerInstructions.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
//
// BannerInstructions.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//

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

public struct BannerInstructions: Codable, Hashable {
public var distanceAlongGeometry: Double?
public var primary: BannerInstructionsPrimary?
public var secondary: BannerInstructionsPrimary?

public init(distanceAlongGeometry: Double? = nil, primary: BannerInstructionsPrimary? = nil, secondary: BannerInstructionsPrimary? = nil) {
self.distanceAlongGeometry = distanceAlongGeometry
self.primary = primary
self.secondary = secondary
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case distanceAlongGeometry
case primary
case secondary
}

// Encodable protocol methods

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(distanceAlongGeometry, forKey: .distanceAlongGeometry)
try container.encodeIfPresent(primary, forKey: .primary)
try container.encodeIfPresent(secondary, forKey: .secondary)
}
}
42 changes: 42 additions & 0 deletions apple/Sources/OSRM/Models/BannerInstructionsPrimary.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
//
// BannerInstructionsPrimary.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//

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

public struct BannerInstructionsPrimary: Codable, Hashable {
public var text: String?
public var type: String?
public var modifier: String?
public var components: [BannerInstructionsPrimaryComponentsInner]?

public init(text: String? = nil, type: String? = nil, modifier: String? = nil, components: [BannerInstructionsPrimaryComponentsInner]? = nil) {
self.text = text
self.type = type
self.modifier = modifier
self.components = components
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case text
case type
case modifier
case components
}

// Encodable protocol methods

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(text, forKey: .text)
try container.encodeIfPresent(type, forKey: .type)
try container.encodeIfPresent(modifier, forKey: .modifier)
try container.encodeIfPresent(components, forKey: .components)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
//
// BannerInstructionsPrimaryComponentsInner.swift
//
// Generated by openapi-generator
// https://openapi-generator.tech
//

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

public struct BannerInstructionsPrimaryComponentsInner: Codable, Hashable {
public var text: String?
public var type: String?

public init(text: String? = nil, type: String? = nil) {
self.text = text
self.type = type
}

public enum CodingKeys: String, CodingKey, CaseIterable {
case text
case type
}

// Encodable protocol methods

public func encode(to encoder: Encoder) throws {
var container = encoder.container(keyedBy: CodingKeys.self)
try container.encodeIfPresent(text, forKey: .text)
try container.encodeIfPresent(type, forKey: .type)
}
}
Loading

0 comments on commit 39ad70c

Please sign in to comment.