|
@@ -23,6 +23,9 @@ class PushNotificationService(Protocol):
|
|
|
async def unsubscribe(self, request: chatto_dot_api_dot_v1_dot_push__notifications__pb2.UnsubscribePushRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_push__notifications__pb2.UnsubscribePushResponse:
|
|
async def unsubscribe(self, request: chatto_dot_api_dot_v1_dot_push__notifications__pb2.UnsubscribePushRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_push__notifications__pb2.UnsubscribePushResponse:
|
|
|
raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
|
|
raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
|
|
|
|
|
|
|
|
|
|
+ async def send_test_notification(self, request: chatto_dot_api_dot_v1_dot_push__notifications__pb2.SendTestPushNotificationRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_push__notifications__pb2.SendTestPushNotificationResponse:
|
|
|
|
|
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
|
|
|
|
|
+
|
|
|
|
|
|
|
|
class PushNotificationServiceASGIApplication(ConnectASGIApplication[PushNotificationService]):
|
|
class PushNotificationServiceASGIApplication(ConnectASGIApplication[PushNotificationService]):
|
|
|
def __init__(self, service: PushNotificationService | AsyncGenerator[PushNotificationService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None) -> None:
|
|
def __init__(self, service: PushNotificationService | AsyncGenerator[PushNotificationService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None) -> None:
|
|
@@ -49,6 +52,16 @@ class PushNotificationServiceASGIApplication(ConnectASGIApplication[PushNotifica
|
|
|
),
|
|
),
|
|
|
function=svc.unsubscribe,
|
|
function=svc.unsubscribe,
|
|
|
),
|
|
),
|
|
|
|
|
+ "/chatto.api.v1.PushNotificationService/SendTestNotification": Endpoint.unary(
|
|
|
|
|
+ method=MethodInfo(
|
|
|
|
|
+ name="SendTestNotification",
|
|
|
|
|
+ service_name="chatto.api.v1.PushNotificationService",
|
|
|
|
|
+ input=chatto_dot_api_dot_v1_dot_push__notifications__pb2.SendTestPushNotificationRequest,
|
|
|
|
|
+ output=chatto_dot_api_dot_v1_dot_push__notifications__pb2.SendTestPushNotificationResponse,
|
|
|
|
|
+ idempotency_level=IdempotencyLevel.UNKNOWN,
|
|
|
|
|
+ ),
|
|
|
|
|
+ function=svc.send_test_notification,
|
|
|
|
|
+ ),
|
|
|
},
|
|
},
|
|
|
interceptors=interceptors,
|
|
interceptors=interceptors,
|
|
|
read_max_bytes=read_max_bytes,
|
|
read_max_bytes=read_max_bytes,
|
|
@@ -102,12 +115,34 @@ class PushNotificationServiceClient(ConnectClient):
|
|
|
timeout_ms=timeout_ms,
|
|
timeout_ms=timeout_ms,
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
|
|
+ async def send_test_notification(
|
|
|
|
|
+ self,
|
|
|
|
|
+ request: chatto_dot_api_dot_v1_dot_push__notifications__pb2.SendTestPushNotificationRequest,
|
|
|
|
|
+ *,
|
|
|
|
|
+ headers: Headers | Mapping[str, str] | None = None,
|
|
|
|
|
+ timeout_ms: int | None = None,
|
|
|
|
|
+ ) -> chatto_dot_api_dot_v1_dot_push__notifications__pb2.SendTestPushNotificationResponse:
|
|
|
|
|
+ return await self.execute_unary(
|
|
|
|
|
+ request=request,
|
|
|
|
|
+ method=MethodInfo(
|
|
|
|
|
+ name="SendTestNotification",
|
|
|
|
|
+ service_name="chatto.api.v1.PushNotificationService",
|
|
|
|
|
+ input=chatto_dot_api_dot_v1_dot_push__notifications__pb2.SendTestPushNotificationRequest,
|
|
|
|
|
+ output=chatto_dot_api_dot_v1_dot_push__notifications__pb2.SendTestPushNotificationResponse,
|
|
|
|
|
+ idempotency_level=IdempotencyLevel.UNKNOWN,
|
|
|
|
|
+ ),
|
|
|
|
|
+ headers=headers,
|
|
|
|
|
+ timeout_ms=timeout_ms,
|
|
|
|
|
+ )
|
|
|
|
|
+
|
|
|
|
|
|
|
|
class PushNotificationServiceSync(Protocol):
|
|
class PushNotificationServiceSync(Protocol):
|
|
|
def subscribe(self, request: chatto_dot_api_dot_v1_dot_push__notifications__pb2.SubscribePushRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_push__notifications__pb2.SubscribePushResponse:
|
|
def subscribe(self, request: chatto_dot_api_dot_v1_dot_push__notifications__pb2.SubscribePushRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_push__notifications__pb2.SubscribePushResponse:
|
|
|
raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
|
|
raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
|
|
|
def unsubscribe(self, request: chatto_dot_api_dot_v1_dot_push__notifications__pb2.UnsubscribePushRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_push__notifications__pb2.UnsubscribePushResponse:
|
|
def unsubscribe(self, request: chatto_dot_api_dot_v1_dot_push__notifications__pb2.UnsubscribePushRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_push__notifications__pb2.UnsubscribePushResponse:
|
|
|
raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
|
|
raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
|
|
|
|
|
+ def send_test_notification(self, request: chatto_dot_api_dot_v1_dot_push__notifications__pb2.SendTestPushNotificationRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_push__notifications__pb2.SendTestPushNotificationResponse:
|
|
|
|
|
+ raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
|
|
|
|
|
|
|
|
|
|
|
|
|
class PushNotificationServiceWSGIApplication(ConnectWSGIApplication):
|
|
class PushNotificationServiceWSGIApplication(ConnectWSGIApplication):
|
|
@@ -134,6 +169,16 @@ class PushNotificationServiceWSGIApplication(ConnectWSGIApplication):
|
|
|
),
|
|
),
|
|
|
function=service.unsubscribe,
|
|
function=service.unsubscribe,
|
|
|
),
|
|
),
|
|
|
|
|
+ "/chatto.api.v1.PushNotificationService/SendTestNotification": EndpointSync.unary(
|
|
|
|
|
+ method=MethodInfo(
|
|
|
|
|
+ name="SendTestNotification",
|
|
|
|
|
+ service_name="chatto.api.v1.PushNotificationService",
|
|
|
|
|
+ input=chatto_dot_api_dot_v1_dot_push__notifications__pb2.SendTestPushNotificationRequest,
|
|
|
|
|
+ output=chatto_dot_api_dot_v1_dot_push__notifications__pb2.SendTestPushNotificationResponse,
|
|
|
|
|
+ idempotency_level=IdempotencyLevel.UNKNOWN,
|
|
|
|
|
+ ),
|
|
|
|
|
+ function=service.send_test_notification,
|
|
|
|
|
+ ),
|
|
|
},
|
|
},
|
|
|
interceptors=interceptors,
|
|
interceptors=interceptors,
|
|
|
read_max_bytes=read_max_bytes,
|
|
read_max_bytes=read_max_bytes,
|
|
@@ -186,3 +231,23 @@ class PushNotificationServiceClientSync(ConnectClientSync):
|
|
|
headers=headers,
|
|
headers=headers,
|
|
|
timeout_ms=timeout_ms,
|
|
timeout_ms=timeout_ms,
|
|
|
)
|
|
)
|
|
|
|
|
+
|
|
|
|
|
+ def send_test_notification(
|
|
|
|
|
+ self,
|
|
|
|
|
+ request: chatto_dot_api_dot_v1_dot_push__notifications__pb2.SendTestPushNotificationRequest,
|
|
|
|
|
+ *,
|
|
|
|
|
+ headers: Headers | Mapping[str, str] | None = None,
|
|
|
|
|
+ timeout_ms: int | None = None,
|
|
|
|
|
+ ) -> chatto_dot_api_dot_v1_dot_push__notifications__pb2.SendTestPushNotificationResponse:
|
|
|
|
|
+ return self.execute_unary(
|
|
|
|
|
+ request=request,
|
|
|
|
|
+ method=MethodInfo(
|
|
|
|
|
+ name="SendTestNotification",
|
|
|
|
|
+ service_name="chatto.api.v1.PushNotificationService",
|
|
|
|
|
+ input=chatto_dot_api_dot_v1_dot_push__notifications__pb2.SendTestPushNotificationRequest,
|
|
|
|
|
+ output=chatto_dot_api_dot_v1_dot_push__notifications__pb2.SendTestPushNotificationResponse,
|
|
|
|
|
+ idempotency_level=IdempotencyLevel.UNKNOWN,
|
|
|
|
|
+ ),
|
|
|
|
|
+ headers=headers,
|
|
|
|
|
+ timeout_ms=timeout_ms,
|
|
|
|
|
+ )
|