# automatically generated by the FlatBuffers compiler, do not modify

# namespace: Packets

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

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

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

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

    # InspectObjectWithIdParam
    def ObjectId(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

def InspectObjectWithIdParamStart(builder): builder.StartObject(1)
def Start(builder):
    return InspectObjectWithIdParamStart(builder)
def InspectObjectWithIdParamAddObjectId(builder, objectId): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(objectId), 0)
def AddObjectId(builder, objectId):
    return InspectObjectWithIdParamAddObjectId(builder, objectId)
def InspectObjectWithIdParamEnd(builder): return builder.EndObject()
def End(builder):
    return InspectObjectWithIdParamEnd(builder)

class InspectObjectWithIdParamT(object):

    # InspectObjectWithIdParamT
    def __init__(self):
        self.objectId = None  # type: str

    @classmethod
    def InitFromBuf(cls, buf, pos):
        inspectObjectWithIdParam = InspectObjectWithIdParam()
        inspectObjectWithIdParam.Init(buf, pos)
        return cls.InitFromObj(inspectObjectWithIdParam)

    @classmethod
    def InitFromPackedBuf(cls, buf, pos=0):
        n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, pos)
        return cls.InitFromBuf(buf, pos+n)

    @classmethod
    def InitFromObj(cls, inspectObjectWithIdParam):
        x = InspectObjectWithIdParamT()
        x._UnPack(inspectObjectWithIdParam)
        return x

    # InspectObjectWithIdParamT
    def _UnPack(self, inspectObjectWithIdParam):
        if inspectObjectWithIdParam is None:
            return
        self.objectId = inspectObjectWithIdParam.ObjectId()

    # InspectObjectWithIdParamT
    def Pack(self, builder):
        if self.objectId is not None:
            objectId = builder.CreateString(self.objectId)
        InspectObjectWithIdParamStart(builder)
        if self.objectId is not None:
            InspectObjectWithIdParamAddObjectId(builder, objectId)
        inspectObjectWithIdParam = InspectObjectWithIdParamEnd(builder)
        return inspectObjectWithIdParam
