# automatically generated by the FlatBuffers compiler, do not modify

# namespace: timeseries

import flatbuffers
from flatbuffers.compat import import_numpy
np = import_numpy()

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

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

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

    # Tag
    def Name(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # Tag
    def Value(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

def TagStart(builder): builder.StartObject(2)
def Start(builder):
    return TagStart(builder)
def TagAddName(builder, name): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(name), 0)
def AddName(builder, name):
    return TagAddName(builder, name)
def TagAddValue(builder, value): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(value), 0)
def AddValue(builder, value):
    return TagAddValue(builder, value)
def TagEnd(builder): return builder.EndObject()
def End(builder):
    return TagEnd(builder)