From a70071541eb60c57fbdd7a26d14ab75a7c5a0213 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Thu, 20 Feb 2025 11:38:30 +0100 Subject: [PATCH] feat(SystemTag): Make MapperEvent webhook compatible Signed-off-by: Marcel Klehr --- lib/public/SystemTag/MapperEvent.php | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/lib/public/SystemTag/MapperEvent.php b/lib/public/SystemTag/MapperEvent.php index f8f130d647399..821d1b5dc5e0e 100644 --- a/lib/public/SystemTag/MapperEvent.php +++ b/lib/public/SystemTag/MapperEvent.php @@ -9,13 +9,14 @@ namespace OCP\SystemTag; use OCP\EventDispatcher\Event; +use OCP\EventDispatcher\IWebhookCompatibleEvent; /** * Class MapperEvent * * @since 9.0.0 */ -class MapperEvent extends Event { +class MapperEvent extends Event implements IWebhookCompatibleEvent { /** * @since 9.0.0 * @deprecated 22.0.0 @@ -84,4 +85,17 @@ public function getObjectId(): string { public function getTags(): array { return $this->tags; } + + /** + * @return array + * @since 32.0.0 + */ + public function getWebhookSerializable(): array { + return [ + 'eventType' => $this->getEvent(), + 'objectType' => $this->getObjectType(), + 'objectId' => $this->getObjectId(), + 'tagIds' => $this->getTags(), + ]; + } }