def __init__(self,
              id=None,
              action=None,
              actor=None,
              object=None,
              eventTime=None):
     BaseEvent.__init__(self,
                        id=id,
                        action=action,
                        object=object,
                        eventTime=eventTime)
     self._set_obj_prop("actor", actor, t=ENTITY_TYPES["AGENT"], req=True)
Beispiel #2
0
    def __init__(self,
                 id=None,
                 action=None,
                 actor=None,
                 object=None,
                 eventTime=None):
        BaseEvent.__init__(self, context=None)
        self._set_id(id or 'urn:uuid:{}'.format(uuid.uuid4()))
        self._set_str_prop('action', action, req=True)
        self._set_obj_prop('actor', actor, t=ENTITY_TYPES['AGENT'], req=True)
        self._set_date_prop('eventTime', eventTime, req=True)
        self._set_obj_prop('object', object, t=ENTITY_TYPES['ENTITY'])

        if action and (action not in BASIC_EVENT_ACTIONS.values()):
            raise_with_traceback(
                ValueError('action must be in the list of Caliper actions'))
        else:
            self._set_str_prop('action', action, req=True)
Beispiel #3
0
 def __init__(self,
              id=None,
              context=None,
              action=None,
              actor=None,
              edApp=None,
              object=None,
              eventTime=None,
              extensions=None,
              federatedSession=None,
              generated=None,
              group=None,
              membership=None,
              referrer=None,
              session=None,
              sourcedId=None,
              target=None):
     BaseEvent.__init__(self, context=context)
     self._set_id(id or 'urn:uuid:{}'.format(uuid.uuid4()))
     if action and (action not in CALIPER_ACTIONS.values()):
         raise_with_traceback(
             ValueError('action must be in the list of Caliper actions'))
     else:
         self._set_str_prop('action', action, req=True)
     self._set_obj_prop('actor', actor, t=ENTITY_TYPES['AGENT'], req=True)
     self._set_obj_prop('edApp',
                        edApp,
                        t=ENTITY_TYPES['SOFTWARE_APPLICATION'])
     self._set_date_prop('eventTime', eventTime, req=True)
     self._set_obj_prop('extensions', extensions)
     self._set_obj_prop('object', object, t=BaseEntity)
     self._set_obj_prop('federatedSession',
                        federatedSession,
                        t=ENTITY_TYPES['LTI_SESSION'])
     self._set_obj_prop('generated',
                        generated,
                        t=MARKER_TYPES['GENERATABLE'])
     self._set_obj_prop('group', group, t=ENTITY_TYPES['ORGANIZATION'])
     self._set_obj_prop('membership',
                        membership,
                        t=ENTITY_TYPES['MEMBERSHIP'])
     self._set_obj_prop('referrer', referrer, t=MARKER_TYPES['REFERRABLE'])
     self._set_obj_prop('session', session, t=ENTITY_TYPES['SESSION'])
     self._set_obj_prop('target', target, t=MARKER_TYPES['TARGETABLE'])
 def __init__(
     self,
     id=None,
     context=None,
     profile=None,
     action=None,
     actor=None,
     edApp=None,
     object=None,
     eventTime=None,
     extensions=None,
     federatedSession=None,
     generated=None,
     group=None,
     membership=None,
     referrer=None,
     session=None,
     target=None,
 ):
     BaseEvent.__init__(
         self,
         context=context,
         id=id,
         profile=profile,
         action=action,
         eventTime=eventTime,
         object=object,
     )
     self._set_obj_prop("actor", actor, t=ENTITY_TYPES["AGENT"], req=True)
     self._set_obj_prop("edApp",
                        edApp,
                        t=ENTITY_TYPES["SOFTWARE_APPLICATION"])
     self._set_dict_prop("extensions", extensions)
     self._set_obj_prop("federatedSession",
                        federatedSession,
                        t=ENTITY_TYPES["LTI_SESSION"])
     self._set_obj_prop("generated", generated)
     self._set_obj_prop("group", group, t=ENTITY_TYPES["ORGANIZATION"])
     self._set_obj_prop("membership",
                        membership,
                        t=ENTITY_TYPES["MEMBERSHIP"])
     self._set_obj_prop("referrer", referrer)
     self._set_obj_prop("session", session, t=ENTITY_TYPES["SESSION"])
     self._set_obj_prop("target", target)