# automatically generated by the FlatBuffers compiler, do not modify

# namespace: xbrnetwork

import flatbuffers
from flatbuffers.compat import import_numpy

np = import_numpy()


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

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

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

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

    # Globally unique and static ID of action.
    # VerifiedAction
    def Oid(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        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

    # VerifiedAction
    def OidAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # VerifiedAction
    def OidLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # VerifiedAction
    def OidIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4))
        return o == 0

    # Timestamp (epoch time in ns) of initial creation of this record.
    # VerifiedAction
    def Created(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

    # Verification type.
    # VerifiedAction
    def Vtype(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
        return 0

    # Verification type.
    # VerifiedAction
    def Vstatus(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10))
        if o != 0:
            return self._tab.Get(flatbuffers.number_types.Uint8Flags, o + self._tab.Pos)
        return 0

    # Verification code sent.
    # VerifiedAction
    def Vcode(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12))
        if o != 0:
            return self._tab.String(o + self._tab.Pos)
        return None

    # ID of object of verified action.
    # VerifiedAction
    def VerifiedOid(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

    # VerifiedAction
    def VerifiedOidAsNumpy(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

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

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

    # Action data, serialized in CBOR.
    # VerifiedAction
    def VerifiedData(self, j):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        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

    # VerifiedAction
    def VerifiedDataAsNumpy(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return self._tab.GetVectorAsNumpy(flatbuffers.number_types.Uint8Flags, o)
        return 0

    # VerifiedAction
    def VerifiedDataLength(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        if o != 0:
            return self._tab.VectorLen(o)
        return 0

    # VerifiedAction
    def VerifiedDataIsNone(self):
        o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(16))
        return o == 0


def VerifiedActionStart(builder):
    builder.StartObject(7)


def Start(builder):
    VerifiedActionStart(builder)


def VerifiedActionAddOid(builder, oid):
    builder.PrependUOffsetTRelativeSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(oid), 0)


def AddOid(builder, oid):
    VerifiedActionAddOid(builder, oid)


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


def StartOidVector(builder, numElems: int) -> int:
    return VerifiedActionStartOidVector(builder, numElems)


def VerifiedActionAddCreated(builder, created):
    builder.PrependUint64Slot(1, created, 0)


def AddCreated(builder, created):
    VerifiedActionAddCreated(builder, created)


def VerifiedActionAddVtype(builder, vtype):
    builder.PrependUint8Slot(2, vtype, 0)


def AddVtype(builder, vtype):
    VerifiedActionAddVtype(builder, vtype)


def VerifiedActionAddVstatus(builder, vstatus):
    builder.PrependUint8Slot(3, vstatus, 0)


def AddVstatus(builder, vstatus):
    VerifiedActionAddVstatus(builder, vstatus)


def VerifiedActionAddVcode(builder, vcode):
    builder.PrependUOffsetTRelativeSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(vcode), 0)


def AddVcode(builder, vcode):
    VerifiedActionAddVcode(builder, vcode)


def VerifiedActionAddVerifiedOid(builder, verifiedOid):
    builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(verifiedOid), 0)


def AddVerifiedOid(builder, verifiedOid):
    VerifiedActionAddVerifiedOid(builder, verifiedOid)


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


def StartVerifiedOidVector(builder, numElems: int) -> int:
    return VerifiedActionStartVerifiedOidVector(builder, numElems)


def VerifiedActionAddVerifiedData(builder, verifiedData):
    builder.PrependUOffsetTRelativeSlot(6, flatbuffers.number_types.UOffsetTFlags.py_type(verifiedData), 0)


def AddVerifiedData(builder, verifiedData):
    VerifiedActionAddVerifiedData(builder, verifiedData)


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


def StartVerifiedDataVector(builder, numElems: int) -> int:
    return VerifiedActionStartVerifiedDataVector(builder, numElems)


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


def End(builder):
    return VerifiedActionEnd(builder)
