Skip to content

Commit

Permalink
enh(SystemTag): Make MapperEvent webhook compatible
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Klehr <mklehr@gmx.net>
  • Loading branch information
marcelklehr committed Feb 20, 2025
1 parent aa4a924 commit 85bdd30
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion lib/public/SystemTag/MapperEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(),
];
}
}

0 comments on commit 85bdd30

Please sign in to comment.