'Constructor; expects parameter d to be a dict of string parameters from a REST transport notification message'

def __init__(self, d):

    self.signature = d['Signature']
    self.timestamp = d['Timestamp']
    self.version = d['Version']
    assert (d['method'] == NotificationMessage.OPERATION_NAME), ("Method    should    be    '%s'" % NotificationMessage.OPERATION_NAME)
    self.events = []
    events_dict = {}
    if ('Event' in d):
        events_dict = d['Event']
    else:
        for k in d:
            v = d[k]
            if k.startswith('Event.'):
                ed = NotificationMessage.EVENT_RE.search(k).groupdict()
                n = int(ed['n'])
                param = str(ed['param'])
                if (n not in events_dict):
                    events_dict[n] = {}
                events_dict[n][param] = v
    for n in events_dict:
        self.events.append(Event(events_dict[n]))
