Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/openstatusHQ/sdk-python. Official Python SDK for openstatus
Something went wrong. Try again.
5.4 kB · 169 lines
Python
at main
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170from __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 )