Example #1
0
    def _fill_from_action(self, action):
        self.type = underscore_to_camel(action) + self._base_type
        self.attributes_key = decapitalize(self.type +
                                           self._attributes_key_suffix)

        self['decisionType'] = self.type
        self[self.attributes_key] = {}
Example #2
0
    def _fill_from_action(self, action):
        self.type = underscore_to_camel(action) + self._base_type
        self.attributes_key = decapitalize(self.type +
                                           self._attributes_key_suffix)

        self['decisionType'] = self.type
        self[self.attributes_key] = {}
Example #3
0
    def __new__(klass, raw_event):
        event_id = raw_event['eventId']
        event_name = raw_event['eventType']
        event_timestamp = raw_event['eventTimestamp']

        event_type = klass._extract_event_type(event_name)
        event_state = klass._extract_event_state(event_type, event_name)
        # amazon swf format is not very normalized and event attributes
        # response field is non-capitalized...
        event_attributes_key = decapitalize(event_name) + 'EventAttributes'

        klass = EventFactory.events[event_type]['event']
        klass._name = event_name
        klass._attributes_key = event_attributes_key

        instance = klass(id=event_id,
                         state=event_state,
                         timestamp=event_timestamp,
                         raw_data=raw_event)

        return instance
Example #4
0
    def __new__(klass, raw_event):
        event_id = raw_event['eventId']
        event_name = raw_event['eventType']
        event_timestamp = raw_event['eventTimestamp']

        event_type = klass._extract_event_type(event_name)
        event_state = klass._extract_event_state(event_type, event_name)
        # amazon swf format is not very normalized and event attributes
        # response field is non-capitalized...
        event_attributes_key = decapitalize(event_name) + 'EventAttributes'

        klass = EventFactory.events[event_type]['event']
        klass._name = event_name
        klass._attributes_key = event_attributes_key

        instance = klass(
            id=event_id,
            state=event_state,
            timestamp=event_timestamp,
            raw_data=raw_event
        )

        return instance