# automatically generated by the FlatBuffers compiler, do not modify

# namespace: proto

from autobahn import flatbuffers
from autobahn.flatbuffers.compat import import_numpy

np = import_numpy()


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

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

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

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

    # Publish
    def Session(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.Get(
                flatbuffers.number_types.Uint64Flags, o + self._tab.Pos
            )
        return 0

    # Publish
    def Request(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            return self._tab.Get(
                flatbuffers.number_types.Uint64Flags, o + self._tab.Pos
            )
        return 0

    # Publish
    def Topic(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

    # Positional values for application-defined event payload.
    # Publish
    def Args(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

    # Publish
    def ArgsAsNumpy(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

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

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

    # Keyword values for application-defined event payload.
    # Publish
    def Kwargs(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

    # Publish
    def KwargsAsNumpy(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

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

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

    # Alternative, transparent payload. If given, ``args`` and ``kwargs`` must be left unset.
    # Publish
    def Payload(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        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

    # Publish
    def PayloadAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # Publish
    def PayloadLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Publish
    def PayloadIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14))
        return o == 0

    # The specific scheme in use with Payload Passthru (PPT) mode for the application payload.
    # Publish
    def PptScheme(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
        return 0

    # The specific serializer encoding the application payload with the Payload Passthru (PPT) scheme in use.
    # Publish
    def PptSerializer(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(18))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
        return 0

    # The cryptographic algorithm ("cipher") encrypting the application payload with the Payload Passthru (PPT) scheme in use.
    # Publish
    def PptCipher(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(20))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
        return 0

    # The identifier or reference to the encryption key that was used to encrypt the payload with the Payload Passthru (PPT) scheme and cipher in use.
    # Publish
    def PptKeyid(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(22))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # Publish
    def Acknowledge(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(24))
        if o != 0:
            return bool(
                self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)
            )
        return False

    # Publish
    def ExcludeMe(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(26))
        if o != 0:
            return bool(
                self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)
            )
        return True

    # Publish
    def Exclude(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(28))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(
                flatbuffers.number_types.Uint64Flags,
                a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8),
            )
        return 0

    # Publish
    def ExcludeAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(28))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint64Flags, o)
        return 0

    # Publish
    def ExcludeLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(28))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Publish
    def ExcludeIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(28))
        return o == 0

    # Publish
    def ExcludeAuthid(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(30))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.String(
                a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)
            )
        return ""

    # Publish
    def ExcludeAuthidLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(30))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Publish
    def ExcludeAuthidIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(30))
        return o == 0

    # Publish
    def ExcludeAuthrole(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(32))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.String(
                a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)
            )
        return ""

    # Publish
    def ExcludeAuthroleLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(32))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Publish
    def ExcludeAuthroleIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(32))
        return o == 0

    # Publish
    def Eligible(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(34))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.Get(
                flatbuffers.number_types.Uint64Flags,
                a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 8),
            )
        return 0

    # Publish
    def EligibleAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(34))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint64Flags, o)
        return 0

    # Publish
    def EligibleLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(34))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Publish
    def EligibleIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(34))
        return o == 0

    # Publish
    def EligibleAuthid(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.String(
                a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)
            )
        return ""

    # Publish
    def EligibleAuthidLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Publish
    def EligibleAuthidIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(36))
        return o == 0

    # Publish
    def EligibleAuthrole(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(38))
        if o != 0:
            a = self._tab.Vector(o)
            return self._tab.String(
                a + flatbuffers.number_types.UOffsetTFlags.py_type(j * 4)
            )
        return ""

    # Publish
    def EligibleAuthroleLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(38))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Publish
    def EligibleAuthroleIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(38))
        return o == 0

    # Publish
    def Retain(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(40))
        if o != 0:
            return bool(
                self._tab.Get(flatbuffers.number_types.BoolFlags, o + self._tab.Pos)
            )
        return False

    # Publish
    def TransactionHash(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(42))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # Publish
    def ForwardFor(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(44))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from autobahn.wamp.gen.wamp.proto.Principal import Principal

            obj = Principal()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # Publish
    def ForwardForLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(44))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # Publish
    def ForwardForIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(44))
        return o == 0


def PublishStart(builder):
    builder.StartObject(21)


def Start(builder):
    PublishStart(builder)


def PublishAddSession(builder, session):
    builder.PrependUint64Slot(0, session, 0)


def AddSession(builder, session):
    PublishAddSession(builder, session)


def PublishAddRequest(builder, request):
    builder.PrependUint64Slot(1, request, 0)


def AddRequest(builder, request):
    PublishAddRequest(builder, request)


def PublishAddTopic(builder, topic):
    builder.PrependUOffsetTRelativeSlot(
        2, flatbuffers.number_types.UOffsetTFlags.py_type(topic), 0
    )


def AddTopic(builder, topic):
    PublishAddTopic(builder, topic)


def PublishAddArgs(builder, args):
    builder.PrependUOffsetTRelativeSlot(
        3, flatbuffers.number_types.UOffsetTFlags.py_type(args), 0
    )


def AddArgs(builder, args):
    PublishAddArgs(builder, args)


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


def StartArgsVector(builder, numElems):
    return PublishStartArgsVector(builder, numElems)


def PublishAddKwargs(builder, kwargs):
    builder.PrependUOffsetTRelativeSlot(
        4, flatbuffers.number_types.UOffsetTFlags.py_type(kwargs), 0
    )


def AddKwargs(builder, kwargs):
    PublishAddKwargs(builder, kwargs)


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


def StartKwargsVector(builder, numElems):
    return PublishStartKwargsVector(builder, numElems)


def PublishAddPayload(builder, payload):
    builder.PrependUOffsetTRelativeSlot(
        5, flatbuffers.number_types.UOffsetTFlags.py_type(payload), 0
    )


def AddPayload(builder, payload):
    PublishAddPayload(builder, payload)


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


def StartPayloadVector(builder, numElems):
    return PublishStartPayloadVector(builder, numElems)


def PublishAddPptScheme(builder, pptScheme):
    builder.PrependUint8Slot(6, pptScheme, 0)


def AddPptScheme(builder, pptScheme):
    PublishAddPptScheme(builder, pptScheme)


def PublishAddPptSerializer(builder, pptSerializer):
    builder.PrependUint8Slot(7, pptSerializer, 0)


def AddPptSerializer(builder, pptSerializer):
    PublishAddPptSerializer(builder, pptSerializer)


def PublishAddPptCipher(builder, pptCipher):
    builder.PrependUint8Slot(8, pptCipher, 0)


def AddPptCipher(builder, pptCipher):
    PublishAddPptCipher(builder, pptCipher)


def PublishAddPptKeyid(builder, pptKeyid):
    builder.PrependUOffsetTRelativeSlot(
        9, flatbuffers.number_types.UOffsetTFlags.py_type(pptKeyid), 0
    )


def AddPptKeyid(builder, pptKeyid):
    PublishAddPptKeyid(builder, pptKeyid)


def PublishAddAcknowledge(builder, acknowledge):
    builder.PrependBoolSlot(10, acknowledge, 0)


def AddAcknowledge(builder, acknowledge):
    PublishAddAcknowledge(builder, acknowledge)


def PublishAddExcludeMe(builder, excludeMe):
    builder.PrependBoolSlot(11, excludeMe, 1)


def AddExcludeMe(builder, excludeMe):
    PublishAddExcludeMe(builder, excludeMe)


def PublishAddExclude(builder, exclude):
    builder.PrependUOffsetTRelativeSlot(
        12, flatbuffers.number_types.UOffsetTFlags.py_type(exclude), 0
    )


def AddExclude(builder, exclude):
    PublishAddExclude(builder, exclude)


def PublishStartExcludeVector(builder, numElems):
    return builder.StartVector(8, numElems, 8)


def StartExcludeVector(builder, numElems):
    return PublishStartExcludeVector(builder, numElems)


def PublishAddExcludeAuthid(builder, excludeAuthid):
    builder.PrependUOffsetTRelativeSlot(
        13, flatbuffers.number_types.UOffsetTFlags.py_type(excludeAuthid), 0
    )


def AddExcludeAuthid(builder, excludeAuthid):
    PublishAddExcludeAuthid(builder, excludeAuthid)


def PublishStartExcludeAuthidVector(builder, numElems):
    return builder.StartVector(4, numElems, 4)


def StartExcludeAuthidVector(builder, numElems):
    return PublishStartExcludeAuthidVector(builder, numElems)


def PublishAddExcludeAuthrole(builder, excludeAuthrole):
    builder.PrependUOffsetTRelativeSlot(
        14, flatbuffers.number_types.UOffsetTFlags.py_type(excludeAuthrole), 0
    )


def AddExcludeAuthrole(builder, excludeAuthrole):
    PublishAddExcludeAuthrole(builder, excludeAuthrole)


def PublishStartExcludeAuthroleVector(builder, numElems):
    return builder.StartVector(4, numElems, 4)


def StartExcludeAuthroleVector(builder, numElems):
    return PublishStartExcludeAuthroleVector(builder, numElems)


def PublishAddEligible(builder, eligible):
    builder.PrependUOffsetTRelativeSlot(
        15, flatbuffers.number_types.UOffsetTFlags.py_type(eligible), 0
    )


def AddEligible(builder, eligible):
    PublishAddEligible(builder, eligible)


def PublishStartEligibleVector(builder, numElems):
    return builder.StartVector(8, numElems, 8)


def StartEligibleVector(builder, numElems):
    return PublishStartEligibleVector(builder, numElems)


def PublishAddEligibleAuthid(builder, eligibleAuthid):
    builder.PrependUOffsetTRelativeSlot(
        16, flatbuffers.number_types.UOffsetTFlags.py_type(eligibleAuthid), 0
    )


def AddEligibleAuthid(builder, eligibleAuthid):
    PublishAddEligibleAuthid(builder, eligibleAuthid)


def PublishStartEligibleAuthidVector(builder, numElems):
    return builder.StartVector(4, numElems, 4)


def StartEligibleAuthidVector(builder, numElems):
    return PublishStartEligibleAuthidVector(builder, numElems)


def PublishAddEligibleAuthrole(builder, eligibleAuthrole):
    builder.PrependUOffsetTRelativeSlot(
        17, flatbuffers.number_types.UOffsetTFlags.py_type(eligibleAuthrole), 0
    )


def AddEligibleAuthrole(builder, eligibleAuthrole):
    PublishAddEligibleAuthrole(builder, eligibleAuthrole)


def PublishStartEligibleAuthroleVector(builder, numElems):
    return builder.StartVector(4, numElems, 4)


def StartEligibleAuthroleVector(builder, numElems):
    return PublishStartEligibleAuthroleVector(builder, numElems)


def PublishAddRetain(builder, retain):
    builder.PrependBoolSlot(18, retain, 0)


def AddRetain(builder, retain):
    PublishAddRetain(builder, retain)


def PublishAddTransactionHash(builder, transactionHash):
    builder.PrependUOffsetTRelativeSlot(
        19, flatbuffers.number_types.UOffsetTFlags.py_type(transactionHash), 0
    )


def AddTransactionHash(builder, transactionHash):
    PublishAddTransactionHash(builder, transactionHash)


def PublishAddForwardFor(builder, forwardFor):
    builder.PrependUOffsetTRelativeSlot(
        20, flatbuffers.number_types.UOffsetTFlags.py_type(forwardFor), 0
    )


def AddForwardFor(builder, forwardFor):
    PublishAddForwardFor(builder, forwardFor)


def PublishStartForwardForVector(builder, numElems):
    return builder.StartVector(4, numElems, 4)


def StartForwardForVector(builder, numElems):
    return PublishStartForwardForVector(builder, numElems)


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


def End(builder):
    return PublishEnd(builder)
