(notify_api_object)
| 42 | class NotificationsHelper(object): |
| 43 | @staticmethod |
| 44 | def to_model(notify_api_object): |
| 45 | if notify_api_object.get("on-success", None): |
| 46 | on_success = NotificationsHelper._to_model_sub_schema( |
| 47 | notify_api_object["on-success"] |
| 48 | ) |
| 49 | else: |
| 50 | on_success = None |
| 51 | |
| 52 | if notify_api_object.get("on-complete", None): |
| 53 | on_complete = NotificationsHelper._to_model_sub_schema( |
| 54 | notify_api_object["on-complete"] |
| 55 | ) |
| 56 | else: |
| 57 | on_complete = None |
| 58 | |
| 59 | if notify_api_object.get("on-failure", None): |
| 60 | on_failure = NotificationsHelper._to_model_sub_schema( |
| 61 | notify_api_object["on-failure"] |
| 62 | ) |
| 63 | else: |
| 64 | on_failure = None |
| 65 | |
| 66 | model = NotificationSchema( |
| 67 | on_success=on_success, on_failure=on_failure, on_complete=on_complete |
| 68 | ) |
| 69 | return model |
| 70 | |
| 71 | @staticmethod |
| 72 | def _to_model_sub_schema(notification_settings_json): |
nothing calls this directly
no test coverage detected