Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alexbaramilis/95d6b012fcb72d57257356acd4d45ae3 to your computer and use it in GitHub Desktop.
Save alexbaramilis/95d6b012fcb72d57257356acd4d45ae3 to your computer and use it in GitHub Desktop.
AirVisual API's nearest_city endpoint response CodingKeys extensions
// 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