Buckets:

download
raw
998 Bytes
"""Abstract base class for notification channels."""
from __future__ import annotations
import abc
from malwar.notifications.events import NotificationEvent
class NotificationChannel(abc.ABC):
"""Base class for all notification channels.
Each concrete channel must implement ``send()`` to deliver a
:class:`NotificationEvent` to its backing service (Slack, Teams,
PagerDuty, email, generic webhook, etc.).
"""
@property
@abc.abstractmethod
def name(self) -> str:
"""Human-readable channel name (e.g. ``'slack'``)."""
@abc.abstractmethod
async def send(self, event: NotificationEvent) -> bool:
"""Deliver a notification event.
Returns:
``True`` if the delivery succeeded, ``False`` otherwise.
"""
def is_configured(self) -> bool:
"""Return ``True`` if the channel has valid configuration.
Subclasses should override this to check required credentials.
"""
return True

Xet Storage Details

Size:
998 Bytes
·
Xet hash:
2af374cdfc81bdb4140b0c2e6364ec83802d59a01332047acac052947f481685

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.