def _get_id(self):
        """If this message has no id, generate one."""
        id = self._options.get('id')
        if id:
            return id

        id = uuid.uuid4().hex
        self.update_options(id=id)
        return id