code: public function onInsert(ResourceEventInterface $event)
      {
          $attachment = $this->getAttachmentFromEvent($event);
  
          $this->updateMessage($attachment->getMessage());
      }
docs: Insert event handler.
  
  @param ResourceEventInterface $event