# automatically generated by the FlatBuffers compiler, do not modify

# namespace: arealm

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

# WAMP permission (authorization of performing a WAMP action on a WAMP URI pattern).
class Permission(object):
    __slots__ = ['_tab']

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

    # URI matching mode.
    # Permission
    def Match(self): return self._tab.Get(flatbuffers.number_types.Int8Flags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(0))
    # Allow/disallow calling procedures on a match.
    # Permission
    def AllowCall(self): return self._tab.Get(flatbuffers.number_types.BoolFlags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(1))
    # Allow/disallow registering procedures on a match.
    # Permission
    def AllowRegister(self): return self._tab.Get(flatbuffers.number_types.BoolFlags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(2))
    # Allow/disallow publishing events on a match.
    # Permission
    def AllowPublish(self): return self._tab.Get(flatbuffers.number_types.BoolFlags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(3))
    # Allow/disallow subscribing topics on a match.
    # Permission
    def AllowSubscribe(self): return self._tab.Get(flatbuffers.number_types.BoolFlags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(4))
    # Disclose the caller on a match (of a procedure) when called.
    # Permission
    def DiscloseCaller(self): return self._tab.Get(flatbuffers.number_types.BoolFlags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(5))
    # Disclose the publisher on a match (of a topic) when published to.
    # Permission
    def DisclosePublisher(self): return self._tab.Get(flatbuffers.number_types.BoolFlags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(6))
    # Cache the permission on a match in the router worker.
    # Permission
    def Cache(self): return self._tab.Get(flatbuffers.number_types.BoolFlags, self._tab.Pos + flatbuffers.number_types.UOffsetTFlags.py_type(7))

def CreatePermission(builder, match, allowCall, allowRegister, allowPublish, allowSubscribe, discloseCaller, disclosePublisher, cache):
    builder.Prep(1, 8)
    builder.PrependBool(cache)
    builder.PrependBool(disclosePublisher)
    builder.PrependBool(discloseCaller)
    builder.PrependBool(allowSubscribe)
    builder.PrependBool(allowPublish)
    builder.PrependBool(allowRegister)
    builder.PrependBool(allowCall)
    builder.PrependInt8(match)
    return builder.Offset()
