Source code for action0.open_meteo.marine.models

# generated by action0-client-openapi v0.1.2 from marine.yml — do not edit

from __future__ import annotations

import enum
from dataclasses import dataclass
from typing import Any


[docs] class GetV1MarineHourlyItem(enum.Enum): """The ``GetV1MarineHourlyItem`` values.""" WAVE_HEIGHT = "wave_height" WAVE_DIRECTION = "wave_direction" WAVE_PERIOD = "wave_period" WAVE_PEAK_PERIOD = "wave_peak_period" WIND_WAVE_HEIGHT = "wind_wave_height" WIND_WAVE_DIRECTION = "wind_wave_direction" WIND_WAVE_PERIOD = "wind_wave_period" WIND_WAVE_PEAK_PERIOD = "wind_wave_peak_period" SWELL_WAVE_HEIGHT = "swell_wave_height" SWELL_WAVE_DIRECTION = "swell_wave_direction" SWELL_WAVE_PERIOD = "swell_wave_period" SWELL_WAVE_PEAK_PERIOD = "swell_wave_peak_period" SECONDARY_SWELL_WAVE_HEIGHT = "secondary_swell_wave_height" SECONDARY_SWELL_WAVE_PERIOD = "secondary_swell_wave_period" SECONDARY_SWELL_WAVE_DIRECTION = "secondary_swell_wave_direction" TERTIARY_SWELL_WAVE_HEIGHT = "tertiary_swell_wave_height" TERTIARY_SWELL_WAVE_PERIOD = "tertiary_swell_wave_period" TERTIARY_SWELL_WAVE_DIRECTION = "tertiary_swell_wave_direction" SEA_LEVEL_HEIGHT_MSL = "sea_level_height_msl" SEA_SURFACE_TEMPERATURE = "sea_surface_temperature" OCEAN_CURRENT_VELOCITY = "ocean_current_velocity" OCEAN_CURRENT_DIRECTION = "ocean_current_direction"
[docs] class GetV1MarineDailyItem(enum.Enum): """The ``GetV1MarineDailyItem`` values.""" WAVE_HEIGHT_MAX = "wave_height_max" WAVE_DIRECTION_DOMINANT = "wave_direction_dominant" WAVE_PERIOD_MAX = "wave_period_max" WIND_WAVE_HEIGHT_MAX = "wind_wave_height_max" WIND_WAVE_DIRECTION_DOMINANT = "wind_wave_direction_dominant" WIND_WAVE_PERIOD_MAX = "wind_wave_period_max" WIND_WAVE_PEAK_PERIOD_MAX = "wind_wave_peak_period_max" SWELL_WAVE_HEIGHT_MAX = "swell_wave_height_max" SWELL_WAVE_DIRECTION_DOMINANT = "swell_wave_direction_dominant" SWELL_WAVE_PERIOD_MAX = "swell_wave_period_max" SWELL_WAVE_PEAK_PERIOD_MAX = "swell_wave_peak_period_max"
[docs] class GetV1MarineCurrentItem(enum.Enum): """The ``GetV1MarineCurrentItem`` values.""" WAVE_HEIGHT = "wave_height" WAVE_DIRECTION = "wave_direction" WAVE_PERIOD = "wave_period" WIND_WAVE_HEIGHT = "wind_wave_height" WIND_WAVE_DIRECTION = "wind_wave_direction" WIND_WAVE_PERIOD = "wind_wave_period" WIND_WAVE_PEAK_PERIOD = "wind_wave_peak_period" SWELL_WAVE_HEIGHT = "swell_wave_height" SWELL_WAVE_DIRECTION = "swell_wave_direction" SWELL_WAVE_PERIOD = "swell_wave_period" SWELL_WAVE_PEAK_PERIOD = "swell_wave_peak_period" SEA_SURFACE_TEMPERATURE = "sea_surface_temperature" OCEAN_CURRENT_VELOCITY = "ocean_current_velocity" OCEAN_CURRENT_DIRECTION = "ocean_current_direction"
[docs] class GetV1MarineMinutely15Item(enum.Enum): """The ``GetV1MarineMinutely15Item`` values.""" OCEAN_CURRENT_VELOCITY = "ocean_current_velocity" OCEAN_CURRENT_DIRECTION = "ocean_current_direction" SEA_LEVEL_HEIGHT_MSL = "sea_level_height_msl"
[docs] class GetV1MarineTemperatureUnit(enum.Enum): """The ``GetV1MarineTemperatureUnit`` values.""" CELSIUS = "celsius" FAHRENHEIT = "fahrenheit"
[docs] class GetV1MarineWindSpeedUnit(enum.Enum): """The ``GetV1MarineWindSpeedUnit`` values.""" KMH = "kmh" MS = "ms" MPH = "mph" KN = "kn"
[docs] class GetV1MarineLengthUnit(enum.Enum): """The ``GetV1MarineLengthUnit`` values.""" METRIC = "metric" IMPERIAL = "imperial"
[docs] class GetV1MarineTimeformat(enum.Enum): """The ``GetV1MarineTimeformat`` values.""" ISO8601 = "iso8601" UNIXTIME = "unixtime"
[docs] class GetV1MarineCellSelection(enum.Enum): """The ``GetV1MarineCellSelection`` values.""" LAND = "land" SEA = "sea" NEAREST = "nearest"
[docs] class GetV1MarineModelsItem(enum.Enum): """The ``GetV1MarineModelsItem`` values.""" BEST_MATCH = "best_match" METEOFRANCE_WAVE = "meteofrance_wave" METEOFRANCE_CURRENTS = "meteofrance_currents" DWD_EWAM = "dwd_ewam" DWD_GWAM = "dwd_gwam" ECMWF_WAM = "ecmwf_wam" ECMWF_WAM025 = "ecmwf_wam025" NCEP_GFSWAVE025 = "ncep_gfswave025" NCEP_GFSWAVE016 = "ncep_gfswave016" ERA5_OCEAN = "era5_ocean"
[docs] @dataclass class GetV1MarineResponseHourly: """The ``GetV1MarineResponseHourly`` model.""" time: list[str] | None = None wave_height: list[float] | None = None wave_direction: list[float] | None = None wave_period: list[float] | None = None wave_peak_period: list[float] | None = None wind_wave_height: list[float] | None = None wind_wave_direction: list[float] | None = None wind_wave_period: list[float] | None = None wind_wave_peak_period: list[float] | None = None swell_wave_height: list[float] | None = None swell_wave_direction: list[float] | None = None swell_wave_period: list[float] | None = None swell_wave_peak_period: list[float] | None = None secondary_swell_wave_height: list[float] | None = None secondary_swell_wave_period: list[float] | None = None secondary_swell_wave_direction: list[float] | None = None tertiary_swell_wave_height: list[float] | None = None tertiary_swell_wave_period: list[float] | None = None tertiary_swell_wave_direction: list[float] | None = None sea_level_height_msl: list[float] | None = None sea_surface_temperature: list[float] | None = None ocean_current_velocity: list[float] | None = None ocean_current_direction: list[float] | None = None
[docs] def get_v1_marine_response_hourly_from_json(data: Any) -> GetV1MarineResponseHourly: """ Build a :py:class:`GetV1MarineResponseHourly` from one decoded JSON object. :param data: the decoded JSON object :return: the GetV1MarineResponseHourly """ return GetV1MarineResponseHourly( time=data.get("time"), wave_height=data.get("wave_height"), wave_direction=data.get("wave_direction"), wave_period=data.get("wave_period"), wave_peak_period=data.get("wave_peak_period"), wind_wave_height=data.get("wind_wave_height"), wind_wave_direction=data.get("wind_wave_direction"), wind_wave_period=data.get("wind_wave_period"), wind_wave_peak_period=data.get("wind_wave_peak_period"), swell_wave_height=data.get("swell_wave_height"), swell_wave_direction=data.get("swell_wave_direction"), swell_wave_period=data.get("swell_wave_period"), swell_wave_peak_period=data.get("swell_wave_peak_period"), secondary_swell_wave_height=data.get("secondary_swell_wave_height"), secondary_swell_wave_period=data.get("secondary_swell_wave_period"), secondary_swell_wave_direction=data.get("secondary_swell_wave_direction"), tertiary_swell_wave_height=data.get("tertiary_swell_wave_height"), tertiary_swell_wave_period=data.get("tertiary_swell_wave_period"), tertiary_swell_wave_direction=data.get("tertiary_swell_wave_direction"), sea_level_height_msl=data.get("sea_level_height_msl"), sea_surface_temperature=data.get("sea_surface_temperature"), ocean_current_velocity=data.get("ocean_current_velocity"), ocean_current_direction=data.get("ocean_current_direction"), )
[docs] @dataclass class GetV1MarineResponseHourlyUnits: """The ``GetV1MarineResponseHourlyUnits`` model.""" time: str | None = None wave_height: str | None = None wave_direction: str | None = None wave_period: str | None = None wave_peak_period: str | None = None wind_wave_height: str | None = None wind_wave_direction: str | None = None wind_wave_period: str | None = None wind_wave_peak_period: str | None = None swell_wave_height: str | None = None swell_wave_direction: str | None = None swell_wave_period: str | None = None swell_wave_peak_period: str | None = None secondary_swell_wave_height: str | None = None secondary_swell_wave_period: str | None = None secondary_swell_wave_direction: str | None = None tertiary_swell_wave_height: str | None = None tertiary_swell_wave_period: str | None = None tertiary_swell_wave_direction: str | None = None sea_level_height_msl: str | None = None sea_surface_temperature: str | None = None ocean_current_velocity: str | None = None ocean_current_direction: str | None = None
[docs] def get_v1_marine_response_hourly_units_from_json(data: Any) -> GetV1MarineResponseHourlyUnits: """ Build a :py:class:`GetV1MarineResponseHourlyUnits` from one decoded JSON object. :param data: the decoded JSON object :return: the GetV1MarineResponseHourlyUnits """ return GetV1MarineResponseHourlyUnits( time=data.get("time"), wave_height=data.get("wave_height"), wave_direction=data.get("wave_direction"), wave_period=data.get("wave_period"), wave_peak_period=data.get("wave_peak_period"), wind_wave_height=data.get("wind_wave_height"), wind_wave_direction=data.get("wind_wave_direction"), wind_wave_period=data.get("wind_wave_period"), wind_wave_peak_period=data.get("wind_wave_peak_period"), swell_wave_height=data.get("swell_wave_height"), swell_wave_direction=data.get("swell_wave_direction"), swell_wave_period=data.get("swell_wave_period"), swell_wave_peak_period=data.get("swell_wave_peak_period"), secondary_swell_wave_height=data.get("secondary_swell_wave_height"), secondary_swell_wave_period=data.get("secondary_swell_wave_period"), secondary_swell_wave_direction=data.get("secondary_swell_wave_direction"), tertiary_swell_wave_height=data.get("tertiary_swell_wave_height"), tertiary_swell_wave_period=data.get("tertiary_swell_wave_period"), tertiary_swell_wave_direction=data.get("tertiary_swell_wave_direction"), sea_level_height_msl=data.get("sea_level_height_msl"), sea_surface_temperature=data.get("sea_surface_temperature"), ocean_current_velocity=data.get("ocean_current_velocity"), ocean_current_direction=data.get("ocean_current_direction"), )
[docs] @dataclass class GetV1MarineResponseDaily: """The ``GetV1MarineResponseDaily`` model.""" time: list[str] | None = None wave_height_max: list[float] | None = None wave_direction_dominant: list[float] | None = None wave_period_max: list[float] | None = None wind_wave_height_max: list[float] | None = None wind_wave_direction_dominant: list[float] | None = None wind_wave_period_max: list[float] | None = None wind_wave_peak_period_max: list[float] | None = None swell_wave_height_max: list[float] | None = None swell_wave_direction_dominant: list[float] | None = None swell_wave_period_max: list[float] | None = None swell_wave_peak_period_max: list[float] | None = None
[docs] def get_v1_marine_response_daily_from_json(data: Any) -> GetV1MarineResponseDaily: """ Build a :py:class:`GetV1MarineResponseDaily` from one decoded JSON object. :param data: the decoded JSON object :return: the GetV1MarineResponseDaily """ return GetV1MarineResponseDaily( time=data.get("time"), wave_height_max=data.get("wave_height_max"), wave_direction_dominant=data.get("wave_direction_dominant"), wave_period_max=data.get("wave_period_max"), wind_wave_height_max=data.get("wind_wave_height_max"), wind_wave_direction_dominant=data.get("wind_wave_direction_dominant"), wind_wave_period_max=data.get("wind_wave_period_max"), wind_wave_peak_period_max=data.get("wind_wave_peak_period_max"), swell_wave_height_max=data.get("swell_wave_height_max"), swell_wave_direction_dominant=data.get("swell_wave_direction_dominant"), swell_wave_period_max=data.get("swell_wave_period_max"), swell_wave_peak_period_max=data.get("swell_wave_peak_period_max"), )
[docs] @dataclass class GetV1MarineResponseDailyUnits: """The ``GetV1MarineResponseDailyUnits`` model.""" time: str | None = None wave_height_max: str | None = None wave_direction_dominant: str | None = None wave_period_max: str | None = None wind_wave_height_max: str | None = None wind_wave_direction_dominant: str | None = None wind_wave_period_max: str | None = None wind_wave_peak_period_max: str | None = None swell_wave_height_max: str | None = None swell_wave_direction_dominant: str | None = None swell_wave_period_max: str | None = None swell_wave_peak_period_max: str | None = None
[docs] def get_v1_marine_response_daily_units_from_json(data: Any) -> GetV1MarineResponseDailyUnits: """ Build a :py:class:`GetV1MarineResponseDailyUnits` from one decoded JSON object. :param data: the decoded JSON object :return: the GetV1MarineResponseDailyUnits """ return GetV1MarineResponseDailyUnits( time=data.get("time"), wave_height_max=data.get("wave_height_max"), wave_direction_dominant=data.get("wave_direction_dominant"), wave_period_max=data.get("wave_period_max"), wind_wave_height_max=data.get("wind_wave_height_max"), wind_wave_direction_dominant=data.get("wind_wave_direction_dominant"), wind_wave_period_max=data.get("wind_wave_period_max"), wind_wave_peak_period_max=data.get("wind_wave_peak_period_max"), swell_wave_height_max=data.get("swell_wave_height_max"), swell_wave_direction_dominant=data.get("swell_wave_direction_dominant"), swell_wave_period_max=data.get("swell_wave_period_max"), swell_wave_peak_period_max=data.get("swell_wave_peak_period_max"), )
[docs] @dataclass class GetV1MarineResponseCurrent: """The ``GetV1MarineResponseCurrent`` model.""" time: str | None = None interval: int | None = None wave_height: float | None = None wave_direction: float | None = None wave_period: float | None = None wind_wave_height: float | None = None wind_wave_direction: float | None = None wind_wave_period: float | None = None wind_wave_peak_period: float | None = None swell_wave_height: float | None = None swell_wave_direction: float | None = None swell_wave_period: float | None = None swell_wave_peak_period: float | None = None sea_surface_temperature: float | None = None ocean_current_velocity: float | None = None ocean_current_direction: float | None = None
[docs] def get_v1_marine_response_current_from_json(data: Any) -> GetV1MarineResponseCurrent: """ Build a :py:class:`GetV1MarineResponseCurrent` from one decoded JSON object. :param data: the decoded JSON object :return: the GetV1MarineResponseCurrent """ return GetV1MarineResponseCurrent( time=data.get("time"), interval=data.get("interval"), wave_height=data.get("wave_height"), wave_direction=data.get("wave_direction"), wave_period=data.get("wave_period"), wind_wave_height=data.get("wind_wave_height"), wind_wave_direction=data.get("wind_wave_direction"), wind_wave_period=data.get("wind_wave_period"), wind_wave_peak_period=data.get("wind_wave_peak_period"), swell_wave_height=data.get("swell_wave_height"), swell_wave_direction=data.get("swell_wave_direction"), swell_wave_period=data.get("swell_wave_period"), swell_wave_peak_period=data.get("swell_wave_peak_period"), sea_surface_temperature=data.get("sea_surface_temperature"), ocean_current_velocity=data.get("ocean_current_velocity"), ocean_current_direction=data.get("ocean_current_direction"), )
[docs] @dataclass class GetV1MarineResponseCurrentUnits: """The ``GetV1MarineResponseCurrentUnits`` model.""" time: str | None = None wave_height: str | None = None wave_direction: str | None = None wave_period: str | None = None wind_wave_height: str | None = None wind_wave_direction: str | None = None wind_wave_period: str | None = None wind_wave_peak_period: str | None = None swell_wave_height: str | None = None swell_wave_direction: str | None = None swell_wave_period: str | None = None swell_wave_peak_period: str | None = None sea_surface_temperature: str | None = None ocean_current_velocity: str | None = None ocean_current_direction: str | None = None
[docs] def get_v1_marine_response_current_units_from_json(data: Any) -> GetV1MarineResponseCurrentUnits: """ Build a :py:class:`GetV1MarineResponseCurrentUnits` from one decoded JSON object. :param data: the decoded JSON object :return: the GetV1MarineResponseCurrentUnits """ return GetV1MarineResponseCurrentUnits( time=data.get("time"), wave_height=data.get("wave_height"), wave_direction=data.get("wave_direction"), wave_period=data.get("wave_period"), wind_wave_height=data.get("wind_wave_height"), wind_wave_direction=data.get("wind_wave_direction"), wind_wave_period=data.get("wind_wave_period"), wind_wave_peak_period=data.get("wind_wave_peak_period"), swell_wave_height=data.get("swell_wave_height"), swell_wave_direction=data.get("swell_wave_direction"), swell_wave_period=data.get("swell_wave_period"), swell_wave_peak_period=data.get("swell_wave_peak_period"), sea_surface_temperature=data.get("sea_surface_temperature"), ocean_current_velocity=data.get("ocean_current_velocity"), ocean_current_direction=data.get("ocean_current_direction"), )
[docs] @dataclass class GetV1MarineResponseMinutely15: """The ``GetV1MarineResponseMinutely15`` model.""" time: list[str] | None = None ocean_current_velocity: list[float] | None = None ocean_current_direction: list[float] | None = None sea_level_height_msl: list[float] | None = None
[docs] def get_v1_marine_response_minutely15_from_json(data: Any) -> GetV1MarineResponseMinutely15: """ Build a :py:class:`GetV1MarineResponseMinutely15` from one decoded JSON object. :param data: the decoded JSON object :return: the GetV1MarineResponseMinutely15 """ return GetV1MarineResponseMinutely15( time=data.get("time"), ocean_current_velocity=data.get("ocean_current_velocity"), ocean_current_direction=data.get("ocean_current_direction"), sea_level_height_msl=data.get("sea_level_height_msl"), )
[docs] @dataclass class GetV1MarineResponseMinutely15Units: """The ``GetV1MarineResponseMinutely15Units`` model.""" time: str | None = None ocean_current_velocity: str | None = None ocean_current_direction: str | None = None sea_level_height_msl: str | None = None
[docs] def get_v1_marine_response_minutely15_units_from_json( data: Any, ) -> GetV1MarineResponseMinutely15Units: """ Build a :py:class:`GetV1MarineResponseMinutely15Units` from one decoded JSON object. :param data: the decoded JSON object :return: the GetV1MarineResponseMinutely15Units """ return GetV1MarineResponseMinutely15Units( time=data.get("time"), ocean_current_velocity=data.get("ocean_current_velocity"), ocean_current_direction=data.get("ocean_current_direction"), sea_level_height_msl=data.get("sea_level_height_msl"), )
[docs] @dataclass class GetV1MarineResponse: """The ``GetV1MarineResponse`` model.""" latitude: float | None = None longitude: float | None = None elevation: float | None = None generationtime_ms: float | None = None utc_offset_seconds: int | None = None timezone: str | None = None timezone_abbreviation: str | None = None hourly: GetV1MarineResponseHourly | None = None hourly_units: GetV1MarineResponseHourlyUnits | None = None daily: GetV1MarineResponseDaily | None = None daily_units: GetV1MarineResponseDailyUnits | None = None current: GetV1MarineResponseCurrent | None = None current_units: GetV1MarineResponseCurrentUnits | None = None minutely_15: GetV1MarineResponseMinutely15 | None = None minutely_15_units: GetV1MarineResponseMinutely15Units | None = None
[docs] def get_v1_marine_response_from_json(data: Any) -> GetV1MarineResponse: """ Build a :py:class:`GetV1MarineResponse` from one decoded JSON object. :param data: the decoded JSON object :return: the GetV1MarineResponse """ return GetV1MarineResponse( latitude=data.get("latitude"), longitude=data.get("longitude"), elevation=data.get("elevation"), generationtime_ms=data.get("generationtime_ms"), utc_offset_seconds=data.get("utc_offset_seconds"), timezone=data.get("timezone"), timezone_abbreviation=data.get("timezone_abbreviation"), hourly=( get_v1_marine_response_hourly_from_json(data["hourly"]) if data.get("hourly") is not None else None ), hourly_units=( get_v1_marine_response_hourly_units_from_json(data["hourly_units"]) if data.get("hourly_units") is not None else None ), daily=( get_v1_marine_response_daily_from_json(data["daily"]) if data.get("daily") is not None else None ), daily_units=( get_v1_marine_response_daily_units_from_json(data["daily_units"]) if data.get("daily_units") is not None else None ), current=( get_v1_marine_response_current_from_json(data["current"]) if data.get("current") is not None else None ), current_units=( get_v1_marine_response_current_units_from_json(data["current_units"]) if data.get("current_units") is not None else None ), minutely_15=( get_v1_marine_response_minutely15_from_json(data["minutely_15"]) if data.get("minutely_15") is not None else None ), minutely_15_units=( get_v1_marine_response_minutely15_units_from_json(data["minutely_15_units"]) if data.get("minutely_15_units") is not None else None ), )
[docs] @dataclass class GetV1MarineError: """The ``GetV1MarineError`` model.""" error: bool | None = None reason: str | None = None
[docs] def get_v1_marine_error_from_json(data: Any) -> GetV1MarineError: """ Build a :py:class:`GetV1MarineError` from one decoded JSON object. :param data: the decoded JSON object :return: the GetV1MarineError """ return GetV1MarineError( error=data.get("error"), reason=data.get("reason"), )