def __trigger_event__(self, event_class, **kwargs):
        """
        Constructs, applies, and publishes a domain event.
        """
        self.__assert_not_discarded__()
        event = event_class(
            originator_id=self._id,
            **kwargs
        )
        event.__mutate__(self)
        self.__publish__(event)
def __trigger_event__ ( self , event_class , ** kwargs ) : self . __assert_not_discarded__ ( ) event = event_class ( originator_id = self . _id , ** kwargs ) event . __mutate__ ( self ) self . __publish__ ( event )
Constructs, applies, and publishes a domain event.