def METHOD_NAME(self, obj, attrs, user, **kwargs):
    environment = attrs["environment"]
    all_conditions = [
        dict(list(o.items()) + [("name", _generate_rule_label(obj.project, obj, o))])
        for o in obj.data.get("conditions", [])
    ]
    actions = []
    for action in obj.data.get("actions", []):
        try:
            actions.append(
                dict(
                    list(action.items())
                    + [("name", _generate_rule_label(obj.project, obj, action))]
                )
            )
        except serializers.ValidationError:
            # Integrations can be deleted and we don't want to fail to load the rule
            pass
    d = {
        # XXX(dcramer): we currently serialize unsaved rule objects
        # as part of the rule editor
        "id": str(obj.id) if obj.id else None,
        # conditions pertain to criteria that can trigger an alert
        "conditions": list(filter(lambda condition: not _is_filter(condition), all_conditions)),
        # filters are not new conditions but are the subset of conditions that pertain to event attributes
        "filters": list(filter(lambda condition: _is_filter(condition), all_conditions)),
        "actions": actions,
        "actionMatch": obj.data.get("action_match") or Rule.DEFAULT_CONDITION_MATCH,
        "filterMatch": obj.data.get("filter_match") or Rule.DEFAULT_FILTER_MATCH,
        "frequency": obj.data.get("frequency") or Rule.DEFAULT_FREQUENCY,
        "name": obj.label,
        "dateCreated": obj.date_added,
        "owner": attrs.get("owner", None),
        "createdBy": attrs.get("created_by", None),
        "environment": environment.name if environment is not None else None,
        "projects": [obj.project.slug],
        "status": "active" if obj.status == ObjectStatus.ACTIVE else "disabled",
    }
    if "last_triggered" in attrs:
        d["lastTriggered"] = attrs["last_triggered"]
    rule_snooze = RuleSnooze.objects.filter(Q(user_id=user.id) | Q(user_id=None), rule=obj)
    if rule_snooze.exists():
        d["snooze"] = True
        snooze = rule_snooze[0]
        if user.id == snooze.owner_id:
            created_by = "You"
        else:
            creator_name = user_service.get_user(snooze.owner_id).get_display_name()
            created_by = creator_name
        d["snoozeCreatedBy"] = created_by
        d["snoozeForEveryone"] = snooze.user_id is None
    else:
        d["snooze"] = False
    return d