# automatically generated by the FlatBuffers compiler, do not modify

# namespace: proto

import flatbuffers

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

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

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

    # ClientRoles
    def Publisher(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .PublisherFeatures import PublisherFeatures
            obj = PublisherFeatures()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # ClientRoles
    def Subscriber(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .SubscriberFeatures import SubscriberFeatures
            obj = SubscriberFeatures()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # ClientRoles
    def Caller(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .CallerFeatures import CallerFeatures
            obj = CallerFeatures()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

    # ClientRoles
    def Callee(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            x = self._tab.Indirect(o + self._tab.Pos)
            from .CalleeFeatures import CalleeFeatures
            obj = CalleeFeatures()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

def ClientRolesStart(builder): builder.StartObject(4)
def ClientRolesAddPublisher(builder, publisher): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(publisher), 0)
def ClientRolesAddSubscriber(builder, subscriber): builder.PrependUOffsetTRelativeSlot(1, flatbuffers.number_types.UOffsetTFlags.py_type(subscriber), 0)
def ClientRolesAddCaller(builder, caller): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(caller), 0)
def ClientRolesAddCallee(builder, callee): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(callee), 0)
def ClientRolesEnd(builder): return builder.EndObject()
