"""Notifications logic.""" from ..connectors.ows_notifications import send_request from ..errors.notifications import NotificationError from ..models.store_state import StoreState from ..schemas import StreamsUpdatedNotificationPayloadSchema __all__ = ['send_streams_updated_notification'] def send_streams_updated_notification(store_state: StoreState): """Send 'streams_updated' notification. Args: store_state (StoreState): StoreState object """ schema = StreamsUpdatedNotificationPayloadSchema() try: send_request('POST', '/activity/streams_updated', json=schema.dump(store_state)) except Exception as e: raise NotificationError('Failed to send "streams_updated" notification') from e