from typing import Any


def config2msg(config_inst: Any, msg_cls: Any):
    """Convert a configuration instance to a specific message type."""
    return msg_cls(**{a.name: getattr(config_inst, a.name)
                      for a in msg_cls.__attrs_attrs__})