def METHOD_NAME(
    cls, event_type: constants.EventType
) -> Callable[[Type["Event"]], Type["Event"]]:
    """Register a class with a given event type."""
    def _internal(python_class: Type["Event"]) -> Type["Event"]:
        if event_type in cls._event_classes:
            logger.warning(
                "%s is already registered. "
                "Overwriting with %s" % (event_type, python_class)
            )
        for attr in attributes.AttributesPerResource[event_type]:
            if not hasattr(python_class, attr.py_name):
                raise TypeError(
                    "%s is expected to have an attribute %s"
                    % (python_class, attr.py_name)
                )
        cls._event_classes[event_type] = python_class
        return python_class
    return _internal