# automatically generated by the FlatBuffers compiler, do not modify

# namespace: foxglove

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

# Command to remove previously published entities
class SceneEntityDeletion(object):
    __slots__ = ['_tab']

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

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

    # Timestamp of the deletion. Only matching entities earlier than this timestamp will be deleted.
    # SceneEntityDeletion
    def Timestamp(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = o + self._tab.Pos
            from .Time import Time
            obj = Time()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Type of deletion action to perform
    # SceneEntityDeletion
    def Type(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
        return 0

    # Identifier which must match if `type` is `MATCHING_ID`.
    # SceneEntityDeletion
    def Id(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

def SceneEntityDeletionStart(builder): builder.StartObject(3)
def Start(builder):
    return SceneEntityDeletionStart(builder)
def SceneEntityDeletionAddTimestamp(builder, timestamp): builder.PrependStructSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(timestamp), 0)
def AddTimestamp(builder, timestamp):
    return SceneEntityDeletionAddTimestamp(builder, timestamp)
def SceneEntityDeletionAddType(builder, type): builder.PrependUint8Slot(1, type, 0)
def AddType(builder, type):
    return SceneEntityDeletionAddType(builder, type)
def SceneEntityDeletionAddId(builder, id): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(id), 0)
def AddId(builder, id):
    return SceneEntityDeletionAddId(builder, id)
def SceneEntityDeletionEnd(builder): return builder.EndObject()
def End(builder):
    return SceneEntityDeletionEnd(builder)