Source code for cfxdb.gen.arealm.Principal

# automatically generated by the FlatBuffers compiler, do not modify

# namespace: arealm

import flatbuffers
from flatbuffers.compat import import_numpy

[docs] np = import_numpy()
# Application realm client principals.
[docs] class Principal(object):
[docs] __slots__ = ["_tab"]
@classmethod
[docs] def GetRootAs(cls, buf, offset=0): n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset) x = Principal() x.Init(buf, n + offset) return x
@classmethod
[docs] def GetRootAsPrincipal(cls, buf, offset=0): """This method is deprecated. Please switch to GetRootAs.""" return cls.GetRootAs(buf, offset)
# Principal
[docs] def Init(self, buf, pos): self._tab = flatbuffers.table.Table(buf, pos)
# ID of this principal. # Principal
[docs] def Oid(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(4)) if o != 0: x = o + self._tab.Pos from ..oid_t import oid_t obj = oid_t() obj.Init(self._tab.Bytes, x) return obj return None
# Timestamp when the principal was last modified # Principal
[docs] def Modified(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(6)) if o != 0: return self._tab.Get(flatbuffers.number_types.Int32Flags, o + self._tab.Pos) return 0
# ID of the application realm the authenticated principal will be joined to. # Principal
[docs] def ArealmOid(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(8)) if o != 0: x = o + self._tab.Pos from ..oid_t import oid_t obj = oid_t() obj.Init(self._tab.Bytes, x) return obj return None
# WAMP authid of the principal, must be unique within the application realm at any moment in time. # Principal
[docs] def Authid(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(10)) if o != 0: return self._tab.String(o + self._tab.Pos) return None
# ID of the role the authenticated principal will be joined to the application realm. # Principal
[docs] def RoleOid(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(12)) if o != 0: x = o + self._tab.Pos from ..oid_t import oid_t obj = oid_t() obj.Init(self._tab.Bytes, x) return obj return None
# Optional authextra information returned to the authenticating principal (CBOR serialized). # Principal
[docs] def Authextra(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
# Principal
[docs] def AuthextraAsNumpy(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
# Principal
[docs] def AuthextraLength(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) if o != 0: return self._tab.VectorLen(o) return 0
# Principal
[docs] def AuthextraIsNone(self): o = flatbuffers.number_types.UOffsetTFlags.py_type(self._tab.Offset(14)) return o == 0
[docs] def PrincipalStart(builder): builder.StartObject(6)
[docs] def Start(builder): PrincipalStart(builder)
[docs] def PrincipalAddOid(builder, oid): builder.PrependStructSlot(0, flatbuffers.number_types.UOffsetTFlags.py_type(oid), 0)
[docs] def AddOid(builder, oid): PrincipalAddOid(builder, oid)
[docs] def PrincipalAddModified(builder, modified): builder.PrependInt32Slot(1, modified, 0)
[docs] def AddModified(builder, modified): PrincipalAddModified(builder, modified)
[docs] def PrincipalAddArealmOid(builder, arealmOid): builder.PrependStructSlot(2, flatbuffers.number_types.UOffsetTFlags.py_type(arealmOid), 0)
[docs] def AddArealmOid(builder, arealmOid): PrincipalAddArealmOid(builder, arealmOid)
[docs] def PrincipalAddAuthid(builder, authid): builder.PrependUOffsetTRelativeSlot(3, flatbuffers.number_types.UOffsetTFlags.py_type(authid), 0)
[docs] def AddAuthid(builder, authid): PrincipalAddAuthid(builder, authid)
[docs] def PrincipalAddRoleOid(builder, roleOid): builder.PrependStructSlot(4, flatbuffers.number_types.UOffsetTFlags.py_type(roleOid), 0)
[docs] def AddRoleOid(builder, roleOid): PrincipalAddRoleOid(builder, roleOid)
[docs] def PrincipalAddAuthextra(builder, authextra): builder.PrependUOffsetTRelativeSlot(5, flatbuffers.number_types.UOffsetTFlags.py_type(authextra), 0)
[docs] def AddAuthextra(builder, authextra): PrincipalAddAuthextra(builder, authextra)
[docs] def PrincipalStartAuthextraVector(builder, numElems): return builder.StartVector(1, numElems, 1)
[docs] def StartAuthextraVector(builder, numElems: int) -> int: return PrincipalStartAuthextraVector(builder, numElems)
[docs] def PrincipalEnd(builder): return builder.EndObject()
[docs] def End(builder): return PrincipalEnd(builder)