# 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

def GetTableStatsResponseStart(builder):
    builder.StartObject(9)

def Start(builder):
    GetTableStatsResponseStart(builder)

def GetTableStatsResponseAddNumRows(builder, numRows):
    builder.PrependInt64Slot(0, numRows, 0)

def AddNumRows(builder, numRows):
    GetTableStatsResponseAddNumRows(builder, numRows)

def GetTableStatsResponseAddSizeInBytes(builder, sizeInBytes):
    builder.PrependInt64Slot(1, sizeInBytes, 0)

def AddSizeInBytes(builder, sizeInBytes):
    GetTableStatsResponseAddSizeInBytes(builder, sizeInBytes)

def GetTableStatsResponseAddIsExternalRowidAlloc(builder, isExternalRowidAlloc):
    builder.PrependBoolSlot(2, isExternalRowidAlloc, 0)

def AddIsExternalRowidAlloc(builder, isExternalRowidAlloc):
    GetTableStatsResponseAddIsExternalRowidAlloc(builder, isExternalRowidAlloc)

def GetTableStatsResponseAddAddressType(builder, addressType):
    builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(addressType), 0)

def AddAddressType(builder, addressType):
    GetTableStatsResponseAddAddressType(builder, addressType)

def GetTableStatsResponseAddVips(builder, vips):
    builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(vips), 0)

def AddVips(builder, vips):
    GetTableStatsResponseAddVips(builder, vips)

def GetTableStatsResponseStartVipsVector(builder, numElems):
    return builder.StartVector(4, numElems, 4)

def StartVipsVector(builder, numElems):
    return GetTableStatsResponseStartVipsVector(builder, numElems)

def GetTableStatsResponseAddSortingKeyEnabled(builder, sortingKeyEnabled):
    builder.PrependBoolSlot(5, sortingKeyEnabled, 0)

def AddSortingKeyEnabled(builder, sortingKeyEnabled):
    GetTableStatsResponseAddSortingKeyEnabled(builder, sortingKeyEnabled)

def GetTableStatsResponseAddSortingScore(builder, sortingScore):
    builder.PrependInt64Slot(6, sortingScore, 0)

def AddSortingScore(builder, sortingScore):
    GetTableStatsResponseAddSortingScore(builder, sortingScore)

def GetTableStatsResponseAddWriteAmplification(builder, writeAmplification):
    builder.PrependInt64Slot(7, writeAmplification, 0)

def AddWriteAmplification(builder, writeAmplification):
    GetTableStatsResponseAddWriteAmplification(builder, writeAmplification)

def GetTableStatsResponseAddAcummulativeRowInseritionCount(builder, acummulativeRowInseritionCount):
    builder.PrependInt64Slot(8, acummulativeRowInseritionCount, 0)

def AddAcummulativeRowInseritionCount(builder, acummulativeRowInseritionCount):
    GetTableStatsResponseAddAcummulativeRowInseritionCount(builder, acummulativeRowInseritionCount)

def GetTableStatsResponseEnd(builder):
    return builder.EndObject()

def End(builder):
    return GetTableStatsResponseEnd(builder)
