def METHOD_NAME(
    cls,
    obj: RestMonitorDefinition,
    **kwargs,  # pylint: disable=unused-argument
) -> "MonitorDefinition":
    from_rest_alert_notification = None
    if obj.alert_notification_setting:
        if isinstance(obj.alert_notification_setting, AzMonMonitoringAlertNotificationSettings):
            from_rest_alert_notification = AZMONITORING
        else:
            from_rest_alert_notification = AlertNotification.METHOD_NAME(obj.alert_notification_setting)
    return cls(
        compute=ServerlessSparkCompute.METHOD_NAME(obj.compute_configuration),
        monitoring_target=MonitoringTarget(
            endpoint_deployment_id=obj.monitoring_target.deployment_id, ml_task=obj.monitoring_target.task_type
        )
        if obj.monitoring_target
        else None,
        monitoring_signals={
            signal_name: MonitoringSignal.METHOD_NAME(signal) for signal_name, signal in obj.signals.items()
        },
        alert_notification=from_rest_alert_notification,
    )