# automatically generated by the FlatBuffers compiler, do not modify

# namespace: AllWatchSerialize

import flatbuffers

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

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

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

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

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

    # Action
    def ActionName(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return bytes()

    # Action
    def Callback(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return bytes()

    # Action
    def Extras(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            x = self._tab.Vector(o)
            x += flatbuffers.number_types.UOffsetTFlags.py_type(j) * 4
            x = self._tab.Indirect(x)
            from .Extras import Extras
            obj = Extras()
            obj.Init(self._tab.Bytes, x)
            return obj
        return None

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

def ActionStart(builder): builder.StartObject(5)
def ActionAddTemp(builder, temp): builder.PrependInt16Slot(0, temp, 0)
def ActionAddA(builder, a): builder.PrependInt16Slot(1, a, 0)
def ActionAddActionName(builder, actionName): builder.PrependUOffsetTRelativeSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(actionName), 0)
def ActionAddCallback(builder, callback): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(callback), 0)
def ActionAddExtras(builder, extras): builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(extras), 0)
def ActionStartExtrasVector(builder, numElems): return builder.StartVector(4, numElems, 4)
def ActionEnd(builder): return builder.EndObject()
