from __future__ import annotations from openstatus._gen.openstatus.notification.v1.service_pb2 import ( CheckNotificationLimitRequest, CheckNotificationLimitResponse, CreateNotificationRequest, CreateNotificationResponse, DeleteNotificationRequest, DeleteNotificationResponse, GetNotificationRequest, GetNotificationResponse, ListNotificationsRequest, ListNotificationsResponse, SendTestNotificationRequest, SendTestNotificationResponse, UpdateNotificationRequest, UpdateNotificationResponse, ) from openstatus._transport import _AsyncJsonTransport, _JsonTransport __all__ = ["AsyncNotificationServiceClient", "NotificationServiceClient"] _FQN = "openstatus.notification.v1.NotificationService" class NotificationServiceClient: def __init__(self, transport: _JsonTransport) -> None: self._t = transport def create_notification( self, request: CreateNotificationRequest, *, headers: dict[str, str] | None = None, ) -> CreateNotificationResponse: return self._t.call( _FQN, "CreateNotification", request, CreateNotificationResponse, headers ) def get_notification( self, request: GetNotificationRequest, *, headers: dict[str, str] | None = None, ) -> GetNotificationResponse: return self._t.call(_FQN, "GetNotification", request, GetNotificationResponse, headers) def list_notifications( self, request: ListNotificationsRequest, *, headers: dict[str, str] | None = None, ) -> ListNotificationsResponse: return self._t.call(_FQN, "ListNotifications", request, ListNotificationsResponse, headers) def update_notification( self, request: UpdateNotificationRequest, *, headers: dict[str, str] | None = None, ) -> UpdateNotificationResponse: return self._t.call( _FQN, "UpdateNotification", request, UpdateNotificationResponse, headers ) def delete_notification( self, request: DeleteNotificationRequest, *, headers: dict[str, str] | None = None, ) -> DeleteNotificationResponse: return self._t.call( _FQN, "DeleteNotification", request, DeleteNotificationResponse, headers ) def send_test_notification( self, request: SendTestNotificationRequest, *, headers: dict[str, str] | None = None, ) -> SendTestNotificationResponse: return self._t.call( _FQN, "SendTestNotification", request, SendTestNotificationResponse, headers ) def check_notification_limit( self, request: CheckNotificationLimitRequest, *, headers: dict[str, str] | None = None, ) -> CheckNotificationLimitResponse: return self._t.call( _FQN, "CheckNotificationLimit", request, CheckNotificationLimitResponse, headers ) class AsyncNotificationServiceClient: def __init__(self, transport: _AsyncJsonTransport) -> None: self._t = transport async def create_notification( self, request: CreateNotificationRequest, *, headers: dict[str, str] | None = None, ) -> CreateNotificationResponse: return await self._t.call( _FQN, "CreateNotification", request, CreateNotificationResponse, headers ) async def get_notification( self, request: GetNotificationRequest, *, headers: dict[str, str] | None = None, ) -> GetNotificationResponse: return await self._t.call( _FQN, "GetNotification", request, GetNotificationResponse, headers ) async def list_notifications( self, request: ListNotificationsRequest, *, headers: dict[str, str] | None = None, ) -> ListNotificationsResponse: return await self._t.call( _FQN, "ListNotifications", request, ListNotificationsResponse, headers ) async def update_notification( self, request: UpdateNotificationRequest, *, headers: dict[str, str] | None = None, ) -> UpdateNotificationResponse: return await self._t.call( _FQN, "UpdateNotification", request, UpdateNotificationResponse, headers ) async def delete_notification( self, request: DeleteNotificationRequest, *, headers: dict[str, str] | None = None, ) -> DeleteNotificationResponse: return await self._t.call( _FQN, "DeleteNotification", request, DeleteNotificationResponse, headers ) async def send_test_notification( self, request: SendTestNotificationRequest, *, headers: dict[str, str] | None = None, ) -> SendTestNotificationResponse: return await self._t.call( _FQN, "SendTestNotification", request, SendTestNotificationResponse, headers ) async def check_notification_limit( self, request: CheckNotificationLimitRequest, *, headers: dict[str, str] | None = None, ) -> CheckNotificationLimitResponse: return await self._t.call( _FQN, "CheckNotificationLimit", request, CheckNotificationLimitResponse, headers )