-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #35 from gionoa/develop
Driver Standings
- Loading branch information
Showing
5 changed files
with
162 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// | ||
// DriverStandings.swift | ||
// | ||
// | ||
// Created by Giovanni Noa on 6/12/20. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct DriverStandings: Codable { | ||
let data: DriverStandingsData | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case data = "MRData" | ||
} | ||
} | ||
|
||
struct DriverStandingsData: Codable { | ||
let series: String | ||
let url: String | ||
let limit: String | ||
let offset: String | ||
let total: String | ||
let standingsTable: StandingsTable | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case series | ||
case url | ||
case limit | ||
case offset | ||
case total | ||
case standingsTable = "StandingsTable" | ||
} | ||
} | ||
|
||
struct StandingsTable: Codable { | ||
let season: String | ||
let standingsLists: [StandingsList] | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case season | ||
case standingsLists = "StandingsLists" | ||
} | ||
} | ||
|
||
struct StandingsList: Codable { | ||
let season: String | ||
let round: String | ||
let driverStandings: [DriverStanding] | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case season | ||
case round | ||
case driverStandings = "DriverStandings" | ||
} | ||
} | ||
|
||
struct DriverStanding: Codable { | ||
let position: String | ||
let positionText: String | ||
let points: String | ||
let wins: String | ||
let driver: Driver | ||
let constructors: [Constructor] | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case position | ||
case positionText | ||
case points | ||
case wins | ||
case driver = "Driver" | ||
case constructors = "Constructors" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
// | ||
// DriverStandings.swift | ||
// | ||
// | ||
// Created by Giovanni Noa on 6/12/20. | ||
// | ||
|
||
import Foundation | ||
|
||
public struct DriverStandings: Codable { | ||
let data: DriverStandingsData | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case data = "MRData" | ||
} | ||
} | ||
|
||
// MARK: - MRData | ||
struct DriverStandingsData: Codable { | ||
let series: String | ||
let url: String | ||
let limit: String | ||
let offset: String | ||
let total: String | ||
let standingsTable: StandingsTable | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case series | ||
case url | ||
case limit | ||
case offset | ||
case total | ||
case standingsTable = "StandingsTable" | ||
} | ||
} | ||
|
||
struct StandingsTable: Codable { | ||
let season: String | ||
let standingsLists: [StandingsList] | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case season | ||
case standingsLists = "StandingsLists" | ||
} | ||
} | ||
|
||
struct StandingsList: Codable { | ||
let season, round: String | ||
let driverStandings: [DriverStanding] | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case season, round | ||
case driverStandings = "DriverStandings" | ||
} | ||
} | ||
|
||
struct DriverStanding: Codable { | ||
let position: String | ||
let positionText: String | ||
let points: String | ||
let wins: String | ||
let driver: Driver | ||
let constructors: [Constructor] | ||
|
||
enum CodingKeys: String, CodingKey { | ||
case position | ||
case positionText | ||
case points | ||
case wins | ||
case driver = "Driver" | ||
case constructors = "Constructors" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.