# automatically generated by the FlatBuffers compiler, do not modify

# namespace: openmeteo_sdk

import flatbuffers
from flatbuffers.compat import import_numpy
from typing import Any
from openmeteo_sdk.TimeRange import TimeRange
from openmeteo_sdk.ValuesAndUnit import ValuesAndUnit
from typing import Optional
np = import_numpy()

class MarineHourly(object):
    __slots__ = ['_tab']

    @classmethod
    def GetRootAs(cls, buf, offset: int = 0):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
        x = MarineHourly()
        x.Init(buf, n + offset)
        return x

    @classmethod
    def GetRootAsMarineHourly(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)
    # MarineHourly
    def Init(self, buf: bytes, pos: int):
        self._tab = flatbuffers.table.Table(buf, pos)

    # MarineHourly
    def Time(self) -> Optional[TimeRange]:
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = o + self._tab.Pos
            obj = TimeRange()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # MarineHourly
    def WaveHeight(self) -> Optional[ValuesAndUnit]:
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = ValuesAndUnit()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # MarineHourly
    def WavePeriod(self) -> Optional[ValuesAndUnit]:
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = ValuesAndUnit()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # MarineHourly
    def WaveDirection(self) -> Optional[ValuesAndUnit]:
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = ValuesAndUnit()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # MarineHourly
    def WindWaveHeight(self) -> Optional[ValuesAndUnit]:
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = ValuesAndUnit()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # MarineHourly
    def WindWavePeriod(self) -> Optional[ValuesAndUnit]:
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = ValuesAndUnit()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # MarineHourly
    def WindWavePeakPeriod(self) -> Optional[ValuesAndUnit]:
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = ValuesAndUnit()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # MarineHourly
    def WindWaveDirection(self) -> Optional[ValuesAndUnit]:
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = ValuesAndUnit()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # MarineHourly
    def SwellWaveHeight(self) -> Optional[ValuesAndUnit]:
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = ValuesAndUnit()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # MarineHourly
    def SwellWavePeriod(self) -> Optional[ValuesAndUnit]:
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = ValuesAndUnit()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # MarineHourly
    def SwellWavePeakPeriod(self) -> Optional[ValuesAndUnit]:
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = ValuesAndUnit()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # MarineHourly
    def SwellWaveDirection(self) -> Optional[ValuesAndUnit]:
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            obj = ValuesAndUnit()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def MarineHourlyStart(builder: flatbuffers.Builder):
    builder.StartObject(12)

def Start(builder: flatbuffers.Builder):
    MarineHourlyStart(builder)

def MarineHourlyAddTime(builder: flatbuffers.Builder, time: Any):
    builder.PrependStructSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(time), 0)

def AddTime(builder: flatbuffers.Builder, time: Any):
    MarineHourlyAddTime(builder, time)

def MarineHourlyAddWaveHeight(builder: flatbuffers.Builder, waveHeight: int):
    builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(waveHeight), 0)

def AddWaveHeight(builder: flatbuffers.Builder, waveHeight: int):
    MarineHourlyAddWaveHeight(builder, waveHeight)

def MarineHourlyAddWavePeriod(builder: flatbuffers.Builder, wavePeriod: int):
    builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(wavePeriod), 0)

def AddWavePeriod(builder: flatbuffers.Builder, wavePeriod: int):
    MarineHourlyAddWavePeriod(builder, wavePeriod)

def MarineHourlyAddWaveDirection(builder: flatbuffers.Builder, waveDirection: int):
    builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(waveDirection), 0)

def AddWaveDirection(builder: flatbuffers.Builder, waveDirection: int):
    MarineHourlyAddWaveDirection(builder, waveDirection)

def MarineHourlyAddWindWaveHeight(builder: flatbuffers.Builder, windWaveHeight: int):
    builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(windWaveHeight), 0)

def AddWindWaveHeight(builder: flatbuffers.Builder, windWaveHeight: int):
    MarineHourlyAddWindWaveHeight(builder, windWaveHeight)

def MarineHourlyAddWindWavePeriod(builder: flatbuffers.Builder, windWavePeriod: int):
    builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(windWavePeriod), 0)

def AddWindWavePeriod(builder: flatbuffers.Builder, windWavePeriod: int):
    MarineHourlyAddWindWavePeriod(builder, windWavePeriod)

def MarineHourlyAddWindWavePeakPeriod(builder: flatbuffers.Builder, windWavePeakPeriod: int):
    builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(windWavePeakPeriod), 0)

def AddWindWavePeakPeriod(builder: flatbuffers.Builder, windWavePeakPeriod: int):
    MarineHourlyAddWindWavePeakPeriod(builder, windWavePeakPeriod)

def MarineHourlyAddWindWaveDirection(builder: flatbuffers.Builder, windWaveDirection: int):
    builder.PrependUOffsetTRelativeSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(windWaveDirection), 0)

def AddWindWaveDirection(builder: flatbuffers.Builder, windWaveDirection: int):
    MarineHourlyAddWindWaveDirection(builder, windWaveDirection)

def MarineHourlyAddSwellWaveHeight(builder: flatbuffers.Builder, swellWaveHeight: int):
    builder.PrependUOffsetTRelativeSlot(8, flatbuffers.number_types.UOffsetTFlags.py_type(swellWaveHeight), 0)

def AddSwellWaveHeight(builder: flatbuffers.Builder, swellWaveHeight: int):
    MarineHourlyAddSwellWaveHeight(builder, swellWaveHeight)

def MarineHourlyAddSwellWavePeriod(builder: flatbuffers.Builder, swellWavePeriod: int):
    builder.PrependUOffsetTRelativeSlot(9, flatbuffers.number_types.UOffsetTFlags.py_type(swellWavePeriod), 0)

def AddSwellWavePeriod(builder: flatbuffers.Builder, swellWavePeriod: int):
    MarineHourlyAddSwellWavePeriod(builder, swellWavePeriod)

def MarineHourlyAddSwellWavePeakPeriod(builder: flatbuffers.Builder, swellWavePeakPeriod: int):
    builder.PrependUOffsetTRelativeSlot(10, flatbuffers.number_types.UOffsetTFlags.py_type(swellWavePeakPeriod), 0)

def AddSwellWavePeakPeriod(builder: flatbuffers.Builder, swellWavePeakPeriod: int):
    MarineHourlyAddSwellWavePeakPeriod(builder, swellWavePeakPeriod)

def MarineHourlyAddSwellWaveDirection(builder: flatbuffers.Builder, swellWaveDirection: int):
    builder.PrependUOffsetTRelativeSlot(11, flatbuffers.number_types.UOffsetTFlags.py_type(swellWaveDirection), 0)

def AddSwellWaveDirection(builder: flatbuffers.Builder, swellWaveDirection: int):
    MarineHourlyAddSwellWaveDirection(builder, swellWaveDirection)

def MarineHourlyEnd(builder: flatbuffers.Builder) -> int:
    return builder.EndObject()

def End(builder: flatbuffers.Builder) -> int:
    return MarineHourlyEnd(builder)
