

@staticmethod
def to_model(notify_api_object):
    if notify_api_object.get('on-success', None):
        on_success = NotificationsHelper._to_model_sub_schema(notify_api_object['on-success'])
    else:
        on_success = None
    if notify_api_object.get('on-complete', None):
        on_complete = NotificationsHelper._to_model_sub_schema(notify_api_object['on-complete'])
    else:
        on_complete = None
    if notify_api_object.get('on-failure', None):
        on_failure = NotificationsHelper._to_model_sub_schema(notify_api_object['on-failure'])
    else:
        on_failure = None
    model = NotificationSchema(on_success=on_success, on_failure=on_failure, on_complete=on_complete)
    return model

dataset/ETHPy150Open StackStorm/st2/st2common/st2common/models/api/notification.py NotificationsHelper.to_model/original