# automatically generated by the FlatBuffers compiler, do not modify

# namespace: tabular

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

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

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

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

    # ListTablesResponse
    def BucketName(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

    # ListTablesResponse
    def SchemaName(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

    # ListTablesResponse
    def Tables(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from vast_flatbuf.tabular.ObjectDetails import ObjectDetails
            obj = ObjectDetails()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

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

def Start(builder): builder.StartObject(3)
def ListTablesResponseStart(builder):
    """This method is deprecated. Please switch to Start."""
    return Start(builder)
def AddBucketName(builder, bucketName): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(bucketName), 0)
def ListTablesResponseAddBucketName(builder, bucketName):
    """This method is deprecated. Please switch to AddBucketName."""
    return AddBucketName(builder, bucketName)
def AddSchemaName(builder, schemaName): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(schemaName), 0)
def ListTablesResponseAddSchemaName(builder, schemaName):
    """This method is deprecated. Please switch to AddSchemaName."""
    return AddSchemaName(builder, schemaName)
def AddTables(builder, tables): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(tables), 0)
def ListTablesResponseAddTables(builder, tables):
    """This method is deprecated. Please switch to AddTables."""
    return AddTables(builder, tables)
def StartTablesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def ListTablesResponseStartTablesVector(builder, numElems):
    """This method is deprecated. Please switch to Start."""
    return StartTablesVector(builder, numElems)
def End(builder): return builder.EndObject()
def ListTablesResponseEnd(builder):
    """This method is deprecated. Please switch to End."""
    return End(builder)