# automatically generated by the FlatBuffers compiler, do not modify

# namespace: AllWatchSerialize

import flatbuffers

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

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

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

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

def UpdateStart(builder): builder.StartObject(1)
def UpdateAddView(builder, view): builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(view), 0)
def UpdateEnd(builder): return builder.EndObject()
