# automatically generated by the FlatBuffers compiler, do not modify

# namespace: tabular

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

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

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

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

    # ImportDataRequest
    def S3Files(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        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.S3File import S3File
            obj = S3File()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

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

    # ImportDataRequest
    def KeyNames(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        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.KeyName import KeyName
            obj = KeyName()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

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

def Start(builder): builder.StartObject(2)
def ImportDataRequestStart(builder):
    """This method is deprecated. Please switch to Start."""
    return Start(builder)
def AddS3Files(builder, s3Files): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(s3Files), 0)
def ImportDataRequestAddS3Files(builder, s3Files):
    """This method is deprecated. Please switch to AddS3Files."""
    return AddS3Files(builder, s3Files)
def StartS3FilesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def ImportDataRequestStartS3FilesVector(builder, numElems):
    """This method is deprecated. Please switch to Start."""
    return StartS3FilesVector(builder, numElems)
def AddKeyNames(builder, keyNames): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(keyNames), 0)
def ImportDataRequestAddKeyNames(builder, keyNames):
    """This method is deprecated. Please switch to AddKeyNames."""
    return AddKeyNames(builder, keyNames)
def StartKeyNamesVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def ImportDataRequestStartKeyNamesVector(builder, numElems):
    """This method is deprecated. Please switch to Start."""
    return StartKeyNamesVector(builder, numElems)
def End(builder): return builder.EndObject()
def ImportDataRequestEnd(builder):
    """This method is deprecated. Please switch to End."""
    return End(builder)