Last active
May 8, 2019 11:08
-
-
Save alexbaramilis/95d6b012fcb72d57257356acd4d45ae3 to your computer and use it in GitHub Desktop.
AirVisual API's nearest_city endpoint response CodingKeys extensions
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
// MARK: - CodingKeys | |
extension AirVisualNearestCityData { | |
enum CodingKeys: String, CodingKey { | |
case city = "city" | |
case currentConditions = "current" | |
} | |
} | |
extension AirVisualWeather { | |
enum CodingKeys: String, CodingKey { | |
case timestamp = "ts" | |
case iconCode = "ic" | |
case temperature = "tp" | |
case humidity = "hu" | |
case pressure = "pr" | |
case windSpeed = "ws" | |
case windDirection = "wd" | |
} | |
} | |
extension AirVisualPollution { | |
enum CodingKeys: String, CodingKey { | |
case timestamp = "ts" | |
case aqiUS = "aqius" | |
case mainPollutantUS = "mainus" | |
case aqiChina = "aqicn" | |
case mainPollutantChina = "maincn" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment