CitraClient.Schemas.WeatherResponse (citra_client v0.3.0)

View Source

Complete weather response from OpenWeatherMap One Call API 3.0

Fields

  • :alerts — list of CitraClient.Schemas.WeatherAlert.t() — National weather alerts data
  • :currentCitraClient.Schemas.CurrentWeather.t()
  • :daily — list of CitraClient.Schemas.DailyForecast.t() — Daily forecast data
  • :hourly — list of CitraClient.Schemas.HourlyForecast.t() — Hourly forecast data
  • :latnumber() — Geographical coordinates of the location (latitude)
  • :lonnumber() — Geographical coordinates of the location (longitude)
  • :minutely — list of CitraClient.Schemas.MinutelyForecast.t() — Minute forecast data
  • :timezoneString.t() — Timezone name for the requested location
  • :timezone_offsetinteger() (API key: timezoneOffset) — Shift in seconds from UTC

Summary

Functions

Build this struct from a decoded JSON map received from the API. Unknown fields are ignored.

Convert this struct into a map with the API's camelCase keys, ready to be JSON-encoded. Fields whose value is nil are omitted.

Types

t()

@type t() :: %CitraClient.Schemas.WeatherResponse{
  alerts: [CitraClient.Schemas.WeatherAlert.t() | map() | nil],
  current: CitraClient.Schemas.CurrentWeather.t() | map() | nil,
  daily: [CitraClient.Schemas.DailyForecast.t() | map() | nil],
  hourly: [CitraClient.Schemas.HourlyForecast.t() | map() | nil],
  lat: number() | nil,
  lon: number() | nil,
  minutely: [CitraClient.Schemas.MinutelyForecast.t() | map() | nil],
  timezone: String.t() | nil,
  timezone_offset: integer() | nil
}

Functions

from_api(data)

Build this struct from a decoded JSON map received from the API. Unknown fields are ignored.

to_api(struct)

Convert this struct into a map with the API's camelCase keys, ready to be JSON-encoded. Fields whose value is nil are omitted.