Can't trigger function from attachListeners()

Hi,
I am trying to trigger function (which does some image processing) after the image is uploaded/edited via Administration, but I can’t manage to trigger this function. What can be wrong with my configuration of “attachListeners”? I also tried “entity.persist.post”.

public function attachListeners(SharedEventManagerInterface $sharedEventManager)
{
$sharedEventManager->attach(
‘Omeka\Entity\Media’,
‘entity.update.post’,
[$this, ‘callIiifhostingIngestApi’]
);
}

The correct solution is probably this one:

public function attachListeners(SharedEventManagerInterface $sharedEventManager)
{
$sharedEventManager->attach(
‘Omeka\Api\Adapter\MediaAdapter’,
‘api.update.post’,
[$this, ‘callIiifhostingIngestApi’]
);
}

The update is OK, but creation is still a problem.

“api.create.post” for “MediaAdapter” isn’t triggered after the media is added to actualy created item. It seems that “Omeka\Api\Adapter\MediaAdapter” isn’t used there, so what is the best way to catch event for newly created media?