# automatically generated by the FlatBuffers compiler, do not modify

# namespace: PrepareConf

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

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

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

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

    # Req
    def Conf(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 A6.TextEntry import TextEntry
            obj = TextEntry()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

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

    # Req
    def Key(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

def Start(builder): builder.StartObject(2)
def ReqStart(builder):
    """This method is deprecated. Please switch to Start."""
    return Start(builder)
def AddConf(builder, conf): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(conf), 0)
def ReqAddConf(builder, conf):
    """This method is deprecated. Please switch to AddConf."""
    return AddConf(builder, conf)
def StartConfVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def ReqStartConfVector(builder, numElems):
    """This method is deprecated. Please switch to Start."""
    return StartConfVector(builder, numElems)
def AddKey(builder, key): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(key), 0)
def ReqAddKey(builder, key):
    """This method is deprecated. Please switch to AddKey."""
    return AddKey(builder, key)
def End(builder): return builder.EndObject()
def ReqEnd(builder):
    """This method is deprecated. Please switch to End."""
    return End(builder)