# 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.ValueAndUnit import ValueAndUnit
from typing import Optional
np = import_numpy()

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

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

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

    # MarineCurrent
    def Time(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int64Flags, o + self._tab.Pos)
        return 0

    # MarineCurrent
    def Interval(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos)
        return 0

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

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

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

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

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

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

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

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

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

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

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

def MarineCurrentStart(builder: flatbuffers.Builder):
    builder.StartObject(13)

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

def MarineCurrentAddTime(builder: flatbuffers.Builder, time: int):
    builder.PrependInt64Slot(0, time, 0)

def AddTime(builder: flatbuffers.Builder, time: int):
    MarineCurrentAddTime(builder, time)

def MarineCurrentAddInterval(builder: flatbuffers.Builder, interval: int):
    builder.PrependInt32Slot(1, interval, 0)

def AddInterval(builder: flatbuffers.Builder, interval: int):
    MarineCurrentAddInterval(builder, interval)

def MarineCurrentAddWaveHeight(builder: flatbuffers.Builder, waveHeight: Any):
    builder.PrependStructSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(waveHeight), 0)

def AddWaveHeight(builder: flatbuffers.Builder, waveHeight: Any):
    MarineCurrentAddWaveHeight(builder, waveHeight)

def MarineCurrentAddWavePeriod(builder: flatbuffers.Builder, wavePeriod: Any):
    builder.PrependStructSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(wavePeriod), 0)

def AddWavePeriod(builder: flatbuffers.Builder, wavePeriod: Any):
    MarineCurrentAddWavePeriod(builder, wavePeriod)

def MarineCurrentAddWaveDirection(builder: flatbuffers.Builder, waveDirection: Any):
    builder.PrependStructSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(waveDirection), 0)

def AddWaveDirection(builder: flatbuffers.Builder, waveDirection: Any):
    MarineCurrentAddWaveDirection(builder, waveDirection)

def MarineCurrentAddWindWaveHeight(builder: flatbuffers.Builder, windWaveHeight: Any):
    builder.PrependStructSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(windWaveHeight), 0)

def AddWindWaveHeight(builder: flatbuffers.Builder, windWaveHeight: Any):
    MarineCurrentAddWindWaveHeight(builder, windWaveHeight)

def MarineCurrentAddWindWavePeriod(builder: flatbuffers.Builder, windWavePeriod: Any):
    builder.PrependStructSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(windWavePeriod), 0)

def AddWindWavePeriod(builder: flatbuffers.Builder, windWavePeriod: Any):
    MarineCurrentAddWindWavePeriod(builder, windWavePeriod)

def MarineCurrentAddWindWavePeakPeriod(builder: flatbuffers.Builder, windWavePeakPeriod: Any):
    builder.PrependStructSlot(7, flatbuffers.number_types.UOffsetTFlags.py_type(windWavePeakPeriod), 0)

def AddWindWavePeakPeriod(builder: flatbuffers.Builder, windWavePeakPeriod: Any):
    MarineCurrentAddWindWavePeakPeriod(builder, windWavePeakPeriod)

def MarineCurrentAddWindWaveDirection(builder: flatbuffers.Builder, windWaveDirection: Any):
    builder.PrependStructSlot(8, flatbuffers.number_types.UOffsetTFlags.py_type(windWaveDirection), 0)

def AddWindWaveDirection(builder: flatbuffers.Builder, windWaveDirection: Any):
    MarineCurrentAddWindWaveDirection(builder, windWaveDirection)

def MarineCurrentAddSwellWaveHeight(builder: flatbuffers.Builder, swellWaveHeight: Any):
    builder.PrependStructSlot(9, flatbuffers.number_types.UOffsetTFlags.py_type(swellWaveHeight), 0)

def AddSwellWaveHeight(builder: flatbuffers.Builder, swellWaveHeight: Any):
    MarineCurrentAddSwellWaveHeight(builder, swellWaveHeight)

def MarineCurrentAddSwellWavePeriod(builder: flatbuffers.Builder, swellWavePeriod: Any):
    builder.PrependStructSlot(10, flatbuffers.number_types.UOffsetTFlags.py_type(swellWavePeriod), 0)

def AddSwellWavePeriod(builder: flatbuffers.Builder, swellWavePeriod: Any):
    MarineCurrentAddSwellWavePeriod(builder, swellWavePeriod)

def MarineCurrentAddSwellWavePeakPeriod(builder: flatbuffers.Builder, swellWavePeakPeriod: Any):
    builder.PrependStructSlot(11, flatbuffers.number_types.UOffsetTFlags.py_type(swellWavePeakPeriod), 0)

def AddSwellWavePeakPeriod(builder: flatbuffers.Builder, swellWavePeakPeriod: Any):
    MarineCurrentAddSwellWavePeakPeriod(builder, swellWavePeakPeriod)

def MarineCurrentAddSwellWaveDirection(builder: flatbuffers.Builder, swellWaveDirection: Any):
    builder.PrependStructSlot(12, flatbuffers.number_types.UOffsetTFlags.py_type(swellWaveDirection), 0)

def AddSwellWaveDirection(builder: flatbuffers.Builder, swellWaveDirection: Any):
    MarineCurrentAddSwellWaveDirection(builder, swellWaveDirection)

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

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