@classmethod
def _message_id(cls, message, require_id):
    """Validate the message is a dictionary and return its ID.

        Raise an error if the message is invalid or the ID is of an
        invalid type.  If it has no ID, raise an error if require_id
        is True, otherwise return None.
        """
    raise NotImplementedError
