import Foundation

struct WeatherModel : Codable {
    
	let location : WeatherLocation?
	let current : WeatherCurrent?
	let forecast : WeatherForecast?

	enum CodingKeys: String, CodingKey {

		case location = "location"
		case current = "current"
		case forecast = "forecast"
	}

	init(from decoder: Decoder) throws {
		let values = try decoder.container(keyedBy: CodingKeys.self)
		location = try values.decodeIfPresent(WeatherLocation.self, forKey: .location)
		current = try values.decodeIfPresent(WeatherCurrent.self, forKey: .current)
		forecast = try values.decodeIfPresent(WeatherForecast.self, forKey: .forecast)
	}

}
