# automatically generated by the FlatBuffers compiler, do not modify

# namespace: timeseries

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

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

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

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

    # FieldValues
    def LongValues(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Int64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # FieldValues
    def LongValuesAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Int64Flags, o)
        return 0

    # FieldValues
    def LongValuesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # FieldValues
    def LongValuesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        return o == 0

    # FieldValues
    def BoolValues(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.BoolFlags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1))
        return 0

    # FieldValues
    def BoolValuesAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.BoolFlags, o)
        return 0

    # FieldValues
    def BoolValuesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # FieldValues
    def BoolValuesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        return o == 0

    # FieldValues
    def DoubleValues(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(flatbuffers.number_types.Float64Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8))
        return 0

    # FieldValues
    def DoubleValuesAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Float64Flags, o)
        return 0

    # FieldValues
    def DoubleValuesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # FieldValues
    def DoubleValuesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        return o == 0

    # FieldValues
    def StringValues(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.String(a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4))
        return ""

    # FieldValues
    def StringValuesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # FieldValues
    def StringValuesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        return o == 0

    # FieldValues
    def BinaryValues(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from tablestore.flatbuffer.timeseries.BytesValue import BytesValue
            obj = BytesValue()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # FieldValues
    def BinaryValuesLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # FieldValues
    def BinaryValuesIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        return o == 0

def FieldValuesStart(builder): builder.StartObject(5)
def Start(builder):
    return FieldValuesStart(builder)
def FieldValuesAddLongValues(builder, longValues): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(longValues), 0)
def AddLongValues(builder, longValues):
    return FieldValuesAddLongValues(builder, longValues)
def FieldValuesStartLongValuesVector(builder, numElems): return builder.StartVector(8, numElems, 8)
def StartLongValuesVector(builder, numElems):
    return FieldValuesStartLongValuesVector(builder, numElems)
def FieldValuesAddBoolValues(builder, boolValues): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(boolValues), 0)
def AddBoolValues(builder, boolValues):
    return FieldValuesAddBoolValues(builder, boolValues)
def FieldValuesStartBoolValuesVector(builder, numElems): return builder.StartVector(1, numElems, 1)
def StartBoolValuesVector(builder, numElems):
    return FieldValuesStartBoolValuesVector(builder, numElems)
def FieldValuesAddDoubleValues(builder, doubleValues): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(doubleValues), 0)
def AddDoubleValues(builder, doubleValues):
    return FieldValuesAddDoubleValues(builder, doubleValues)
def FieldValuesStartDoubleValuesVector(builder, numElems): return builder.StartVector(8, numElems, 8)
def StartDoubleValuesVector(builder, numElems):
    return FieldValuesStartDoubleValuesVector(builder, numElems)
def FieldValuesAddStringValues(builder, stringValues): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(stringValues), 0)
def AddStringValues(builder, stringValues):
    return FieldValuesAddStringValues(builder, stringValues)
def FieldValuesStartStringValuesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartStringValuesVector(builder, numElems):
    return FieldValuesStartStringValuesVector(builder, numElems)
def FieldValuesAddBinaryValues(builder, binaryValues): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(binaryValues), 0)
def AddBinaryValues(builder, binaryValues):
    return FieldValuesAddBinaryValues(builder, binaryValues)
def FieldValuesStartBinaryValuesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def StartBinaryValuesVector(builder, numElems):
    return FieldValuesStartBinaryValuesVector(builder, numElems)
def FieldValuesEnd(builder): return builder.EndObject()
def End(builder):
    return FieldValuesEnd(builder)