Skip to content

Commit

Permalink
Merge pull request #8521 from OpenMined/feature/add_notifier_aliases
Browse files Browse the repository at this point in the history
ADD Activate/Deactivate notifier aliases for the notification service
  • Loading branch information
jcardonnet committed Feb 27, 2024
2 parents 033a0af + 760c5be commit a7c7622
Showing 1 changed file with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,32 @@ def reply(
message="The target notification id {reply.target_msg} was not found!"
)

@service_method(
path="notifications.activate",
name="activate",
roles=DATA_SCIENTIST_ROLE_LEVEL,
)
def activate(
self,
context: AuthedServiceContext,
) -> Union[Notification, SyftError]:
notifier_service = context.node.get_service("notifierservice")
result = notifier_service.activate(context.node)
return result

@service_method(
path="notifications.deactivate",
name="deactivate",
roles=DATA_SCIENTIST_ROLE_LEVEL,
)
def deactivate(
self,
context: AuthedServiceContext,
) -> Union[Notification, SyftError]:
notifier_service = context.node.get_service("notifierservice")
result = notifier_service.deactivate(context.node)
return result

@service_method(
path="notifications.get_all",
name="get_all",
Expand Down

0 comments on commit a7c7622

Please sign in to comment.