# automatically generated by the FlatBuffers compiler, do not modify

# namespace: meta

import flatbuffers
from flatbuffers.compat import import_numpy

np = import_numpy()


class Comment(object):
    __slots__ = ["_tab"]

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

    @classmethod
    def GetRootAsComment(cls, buf, offset=0):
        """This method is deprecated. Please switch to GetRootAs."""
        return cls.GetRootAs(buf, offset)

    # Comment
    def Init(self, buf, pos):
        self._tab = flatbuffers.table.Table(buf, pos)

    # Comment OID.
    # Comment
    def Oid(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(
                flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)
            )
        return 0

    # Comment
    def OidAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

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

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

    # Table of the object commented on.
    # Comment
    def TableOid(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(
                flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)
            )
        return 0

    # Comment
    def TableOidAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

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

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

    # Object (within the table) commented on.
    # Comment
    def ObjectOid(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(
                flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)
            )
        return 0

    # Comment
    def ObjectOidAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

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

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

    # User that authored this comment.
    # Comment
    def AuthorOid(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(
                flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)
            )
        return 0

    # Comment
    def AuthorOidAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # Comment
    def AuthorOidLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Comment
    def AuthorOidIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        return o == 0

    # When this comment is a reply, the OID of the comment replied to.
    # Comment
    def ReplyTo(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(
                flatbuffers.number_types.Uint8Flags, a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 1)
            )
        return 0

    # Comment
    def ReplyToAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # Comment
    def ReplyToLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Comment
    def ReplyToIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        return o == 0

    # The text of the comment.
    # Comment
    def Comment(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # Timestamp when the comment was posted.
    # Comment
    def Posted(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint64Flags, o + self._tab.Pos)
        return 0


def CommentStart(builder):
    builder.StartObject(7)


def Start(builder):
    CommentStart(builder)


def CommentAddOid(builder, oid):
    builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(oid), 0)


def AddOid(builder, oid):
    CommentAddOid(builder, oid)


def CommentStartOidVector(builder, numElems):
    return builder.StartVector(1, numElems, 1)


def StartOidVector(builder, numElems: int) -> int:
    return CommentStartOidVector(builder, numElems)


def CommentAddTableOid(builder, tableOid):
    builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(tableOid), 0)


def AddTableOid(builder, tableOid):
    CommentAddTableOid(builder, tableOid)


def CommentStartTableOidVector(builder, numElems):
    return builder.StartVector(1, numElems, 1)


def StartTableOidVector(builder, numElems: int) -> int:
    return CommentStartTableOidVector(builder, numElems)


def CommentAddObjectOid(builder, objectOid):
    builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(objectOid), 0)


def AddObjectOid(builder, objectOid):
    CommentAddObjectOid(builder, objectOid)


def CommentStartObjectOidVector(builder, numElems):
    return builder.StartVector(1, numElems, 1)


def StartObjectOidVector(builder, numElems: int) -> int:
    return CommentStartObjectOidVector(builder, numElems)


def CommentAddAuthorOid(builder, authorOid):
    builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(authorOid), 0)


def AddAuthorOid(builder, authorOid):
    CommentAddAuthorOid(builder, authorOid)


def CommentStartAuthorOidVector(builder, numElems):
    return builder.StartVector(1, numElems, 1)


def StartAuthorOidVector(builder, numElems: int) -> int:
    return CommentStartAuthorOidVector(builder, numElems)


def CommentAddReplyTo(builder, replyTo):
    builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(replyTo), 0)


def AddReplyTo(builder, replyTo):
    CommentAddReplyTo(builder, replyTo)


def CommentStartReplyToVector(builder, numElems):
    return builder.StartVector(1, numElems, 1)


def StartReplyToVector(builder, numElems: int) -> int:
    return CommentStartReplyToVector(builder, numElems)


def CommentAddComment(builder, comment):
    builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(comment), 0)


def AddComment(builder, comment):
    CommentAddComment(builder, comment)


def CommentAddPosted(builder, posted):
    builder.PrependUint64Slot(6, posted, 0)


def AddPosted(builder, posted):
    CommentAddPosted(builder, posted)


def CommentEnd(builder):
    return builder.EndObject()


def End(builder):
    return CommentEnd(builder)
