|
| 1 | +package com.openmeteo.api.gem |
| 2 | + |
| 3 | +import com.openmeteo.api.common.query.* |
| 4 | +import com.openmeteo.api.common.response.* |
| 5 | +import com.openmeteo.api.common.response.ResponseCurrentWeather.CurrentWeather |
| 6 | +import com.openmeteo.api.common.time.Date |
| 7 | +import com.openmeteo.api.common.time.TimeZone |
| 8 | +import com.openmeteo.api.common.units.PrecipitationUnit |
| 9 | +import com.openmeteo.api.common.units.TemperatureUnit |
| 10 | +import com.openmeteo.api.common.units.Unit |
| 11 | +import com.openmeteo.api.common.units.WindSpeedUnit |
| 12 | +import kotlinx.serialization.SerialName |
| 13 | +import kotlinx.serialization.Serializable |
| 14 | +import java.net.URL |
| 15 | + |
| 16 | +object Gem { |
| 17 | + |
| 18 | + val context = URL("https://api.open-meteo.com/v1/gem") |
| 19 | + |
| 20 | + open class Query( |
| 21 | + override val latitude: Float, |
| 22 | + override val longitude: Float, |
| 23 | + override val hourly: Iterable<GemHourly>? = null, |
| 24 | + override val daily: Iterable<GemDaily>? = null, |
| 25 | + override val currentWeather: Boolean? = null, |
| 26 | + val temperatureUnit: TemperatureUnit? = null, |
| 27 | + val windSpeedUnit: WindSpeedUnit? = null, |
| 28 | + val precipitationUnit: PrecipitationUnit? = null, |
| 29 | + override val timeZone: TimeZone? = null, |
| 30 | + override val startDate: Date? = null, |
| 31 | + override val endDate: Date? = null, |
| 32 | + @SerialName("past_days") |
| 33 | + val pastDays: Int? = null, |
| 34 | + ) : QueryCoordinates, |
| 35 | + QueryHourly, |
| 36 | + QueryDaily, |
| 37 | + QueryCurrentWeather, |
| 38 | + QueryDateRange |
| 39 | + |
| 40 | + @Serializable |
| 41 | + open class Response( |
| 42 | + override val latitude: Float, |
| 43 | + override val longitude: Float, |
| 44 | + val elevation: Float, |
| 45 | + @SerialName("utc_offset_seconds") |
| 46 | + override val utcOffsetSeconds: Int, |
| 47 | + @SerialName("timezone") |
| 48 | + override val timeZone: TimeZone, |
| 49 | + @SerialName("timezone_abbreviation") |
| 50 | + override val timeZoneAbbreviation: String, |
| 51 | + @SerialName("hourly_units") |
| 52 | + override val hourlyUnits: Map<GemHourly, Unit> = emptyMap(), |
| 53 | + @SerialName("hourly") |
| 54 | + override val hourlyValues: Map<GemHourly, Array<Double?>> = emptyMap(), |
| 55 | + @SerialName("daily_units") |
| 56 | + override val dailyUnits: Map<GemDaily, Unit> = emptyMap(), |
| 57 | + @SerialName("daily") |
| 58 | + override val dailyValues: Map<GemDaily, Array<Double?>> = emptyMap(), |
| 59 | + @SerialName("generationtime_ms") |
| 60 | + override val generationTimeMs: Float, |
| 61 | + @SerialName("current_weather") |
| 62 | + override val currentWeather: CurrentWeather? = null, |
| 63 | + ) : ResponseCoordinates, |
| 64 | + ResponseHourly, |
| 65 | + ResponseDaily, |
| 66 | + ResponseCurrentWeather, |
| 67 | + ResponseGenerationTimed |
| 68 | + |
| 69 | +} |
0 commit comments