Skip to content

Commit a45b78c

Browse files
committed
feat(apix): current weather query/response
Useful for forecast and gfs api.
1 parent 5a9a173 commit a45b78c

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
package com.openmeteo.apix.common.query
2+
3+
import kotlinx.serialization.SerialName
4+
5+
interface QueryCurrentWeather : Query {
6+
@SerialName("current_weather")
7+
val currentWeather: Boolean?
8+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
package com.openmeteo.apix.common.response
2+
3+
import com.openmeteo.api.forecast.response.WeatherCode
4+
import com.openmeteo.apix.common.time.Time
5+
import kotlinx.serialization.SerialName
6+
import kotlinx.serialization.Serializable
7+
8+
interface ResponseCurrentWeather : Response {
9+
@SerialName("current_weather")
10+
val currentWeather: CurrentWeather
11+
12+
@Serializable
13+
open class CurrentWeather(
14+
val time: Time,
15+
val temperature: Float,
16+
@SerialName("windspeed")
17+
val windSpeed: Float,
18+
@SerialName("winddirection")
19+
val windDirection: Float,
20+
@SerialName("weathercode")
21+
val weatherCode: WeatherCode
22+
)
23+
}

0 commit comments

Comments
 (0)