def rule(event):
    if all(
        [
            event.deep_get("eventSource", default="") == "guardduty.amazonaws.com",
            any(
                [
                    event.deep_get("eventName", default="") == "DeleteDetector",
                    all(
                        [
                            event.deep_get("eventName", default="") == "UpdateDetector",
                            event.deep_get("requestParameters", "enable", default="") == "false",
                        ]
                    ),
                ]
            ),
            any(
                [
                    event.deep_get("errorCode", default="") == "Success",
                    event.deep_get("errorCode", default="") == "",
                ]
            ),
        ]
    ):
        return True
    return False
