code: protected function getAttachmentFromEvent(ResourceEventInterface $event)
      {
          $attachment = $event->getResource();
  
          if (!$attachment instanceof TicketAttachmentInterface) {
              throw new UnexpectedValueException("Expected instance of " . TicketAttachmentInterface::class);
          }
  
          return $attachment;
      }
docs: Returns the attachment from the event.
  
  @param ResourceEventInterface $event
  
  @return TicketAttachmentInterface