# automatically generated by the FlatBuffers compiler, do not modify

# namespace: tabular

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

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

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

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

    # GetTableStatsResponse
    def NumRows(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

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

    # GetTableStatsResponse
    def IsExternalRowidAlloc(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

    # GetTableStatsResponse
    def AddressType(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # GetTableStatsResponse
    def Vips(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 vastdb.vast_flatbuf.tabular.VipRange import VipRange
            obj = VipRange()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

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

    # GetTableStatsResponse
    def SortingKeyEnabled(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return bool(self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos))
        return False

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

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

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

    # GetTableStatsResponse
    def VectorIndexMetadata(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from vastdb.vast_flatbuf.tabular.VectorIndexMetadata import VectorIndexMetadata
            obj = VectorIndexMetadata()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def Start(builder): builder.StartObject(10)
def GetTableStatsResponseStart(builder):
    """This method is deprecated. Please switch to Start."""
    return Start(builder)
def AddNumRows(builder, numRows): builder.PrependInt64Slot(0, numRows, 0)
def GetTableStatsResponseAddNumRows(builder, numRows):
    """This method is deprecated. Please switch to AddNumRows."""
    return AddNumRows(builder, numRows)
def AddSizeInBytes(builder, sizeInBytes): builder.PrependInt64Slot(1, sizeInBytes, 0)
def GetTableStatsResponseAddSizeInBytes(builder, sizeInBytes):
    """This method is deprecated. Please switch to AddSizeInBytes."""
    return AddSizeInBytes(builder, sizeInBytes)
def AddIsExternalRowidAlloc(builder, isExternalRowidAlloc): builder.PrependBoolSlot(2, isExternalRowidAlloc, 0)
def GetTableStatsResponseAddIsExternalRowidAlloc(builder, isExternalRowidAlloc):
    """This method is deprecated. Please switch to AddIsExternalRowidAlloc."""
    return AddIsExternalRowidAlloc(builder, isExternalRowidAlloc)
def AddAddressType(builder, addressType): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(addressType), 0)
def GetTableStatsResponseAddAddressType(builder, addressType):
    """This method is deprecated. Please switch to AddAddressType."""
    return AddAddressType(builder, addressType)
def AddVips(builder, vips): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(vips), 0)
def GetTableStatsResponseAddVips(builder, vips):
    """This method is deprecated. Please switch to AddVips."""
    return AddVips(builder, vips)
def StartVipsVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def GetTableStatsResponseStartVipsVector(builder, numElems):
    """This method is deprecated. Please switch to Start."""
    return StartVipsVector(builder, numElems)
def AddSortingKeyEnabled(builder, sortingKeyEnabled): builder.PrependBoolSlot(5, sortingKeyEnabled, 0)
def GetTableStatsResponseAddSortingKeyEnabled(builder, sortingKeyEnabled):
    """This method is deprecated. Please switch to AddSortingKeyEnabled."""
    return AddSortingKeyEnabled(builder, sortingKeyEnabled)
def AddSortingScore(builder, sortingScore): builder.PrependInt64Slot(6, sortingScore, 0)
def GetTableStatsResponseAddSortingScore(builder, sortingScore):
    """This method is deprecated. Please switch to AddSortingScore."""
    return AddSortingScore(builder, sortingScore)
def AddWriteAmplification(builder, writeAmplification): builder.PrependInt64Slot(7, writeAmplification, 0)
def GetTableStatsResponseAddWriteAmplification(builder, writeAmplification):
    """This method is deprecated. Please switch to AddWriteAmplification."""
    return AddWriteAmplification(builder, writeAmplification)
def AddAcummulativeRowInseritionCount(builder, acummulativeRowInseritionCount): builder.PrependInt64Slot(8, acummulativeRowInseritionCount, 0)
def GetTableStatsResponseAddAcummulativeRowInseritionCount(builder, acummulativeRowInseritionCount):
    """This method is deprecated. Please switch to AddAcummulativeRowInseritionCount."""
    return AddAcummulativeRowInseritionCount(builder, acummulativeRowInseritionCount)
def AddVectorIndexMetadata(builder, vectorIndexMetadata): builder.PrependUOffsetTRelativeSlot(9, flatbuffers.number_types.UOffsetTFlags.py_type(vectorIndexMetadata), 0)
def GetTableStatsResponseAddVectorIndexMetadata(builder, vectorIndexMetadata):
    """This method is deprecated. Please switch to AddVectorIndexMetadata."""
    return AddVectorIndexMetadata(builder, vectorIndexMetadata)
def End(builder): return builder.EndObject()
def GetTableStatsResponseEnd(builder):
    """This method is deprecated. Please switch to End."""
    return End(builder)
