notifications_connect.py 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578
  1. # -*- coding: utf-8 -*-
  2. # Generated by https://github.com/connectrpc/connect-python. DO NOT EDIT!
  3. # source: chatto/api/v1/notifications.proto
  4. from collections.abc import AsyncGenerator, AsyncIterator, Iterable, Iterator, Mapping
  5. from typing import Protocol
  6. from connectrpc.client import ConnectClient, ConnectClientSync
  7. from connectrpc.code import Code
  8. from connectrpc.compression import Compression
  9. from connectrpc.errors import ConnectError
  10. from connectrpc.interceptor import Interceptor, InterceptorSync
  11. from connectrpc.method import IdempotencyLevel, MethodInfo
  12. from connectrpc.request import Headers, RequestContext
  13. from connectrpc.server import ConnectASGIApplication, ConnectWSGIApplication, Endpoint, EndpointSync
  14. import chatto.api.v1.notifications_pb2 as chatto_dot_api_dot_v1_dot_notifications__pb2
  15. class NotificationService(Protocol):
  16. async def list_notifications(self, request: chatto_dot_api_dot_v1_dot_notifications__pb2.ListNotificationsRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_notifications__pb2.ListNotificationsResponse:
  17. raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
  18. async def get_notification(self, request: chatto_dot_api_dot_v1_dot_notifications__pb2.GetNotificationRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_notifications__pb2.GetNotificationResponse:
  19. raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
  20. async def batch_get_notifications(self, request: chatto_dot_api_dot_v1_dot_notifications__pb2.BatchGetNotificationsRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_notifications__pb2.BatchGetNotificationsResponse:
  21. raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
  22. async def list_room_notifications(self, request: chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationsRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationsResponse:
  23. raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
  24. async def list_room_notification_counts(self, request: chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationCountsRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationCountsResponse:
  25. raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
  26. async def has_notifications(self, request: chatto_dot_api_dot_v1_dot_notifications__pb2.HasNotificationsRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_notifications__pb2.HasNotificationsResponse:
  27. raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
  28. async def dismiss_notification(self, request: chatto_dot_api_dot_v1_dot_notifications__pb2.DismissNotificationRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_notifications__pb2.DismissNotificationResponse:
  29. raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
  30. async def dismiss_all_notifications(self, request: chatto_dot_api_dot_v1_dot_notifications__pb2.DismissAllNotificationsRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_notifications__pb2.DismissAllNotificationsResponse:
  31. raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
  32. class NotificationServiceASGIApplication(ConnectASGIApplication[NotificationService]):
  33. def __init__(self, service: NotificationService | AsyncGenerator[NotificationService], *, interceptors: Iterable[Interceptor]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None) -> None:
  34. super().__init__(
  35. service=service,
  36. endpoints=lambda svc: {
  37. "/chatto.api.v1.NotificationService/ListNotifications": Endpoint.unary(
  38. method=MethodInfo(
  39. name="ListNotifications",
  40. service_name="chatto.api.v1.NotificationService",
  41. input=chatto_dot_api_dot_v1_dot_notifications__pb2.ListNotificationsRequest,
  42. output=chatto_dot_api_dot_v1_dot_notifications__pb2.ListNotificationsResponse,
  43. idempotency_level=IdempotencyLevel.UNKNOWN,
  44. ),
  45. function=svc.list_notifications,
  46. ),
  47. "/chatto.api.v1.NotificationService/GetNotification": Endpoint.unary(
  48. method=MethodInfo(
  49. name="GetNotification",
  50. service_name="chatto.api.v1.NotificationService",
  51. input=chatto_dot_api_dot_v1_dot_notifications__pb2.GetNotificationRequest,
  52. output=chatto_dot_api_dot_v1_dot_notifications__pb2.GetNotificationResponse,
  53. idempotency_level=IdempotencyLevel.UNKNOWN,
  54. ),
  55. function=svc.get_notification,
  56. ),
  57. "/chatto.api.v1.NotificationService/BatchGetNotifications": Endpoint.unary(
  58. method=MethodInfo(
  59. name="BatchGetNotifications",
  60. service_name="chatto.api.v1.NotificationService",
  61. input=chatto_dot_api_dot_v1_dot_notifications__pb2.BatchGetNotificationsRequest,
  62. output=chatto_dot_api_dot_v1_dot_notifications__pb2.BatchGetNotificationsResponse,
  63. idempotency_level=IdempotencyLevel.UNKNOWN,
  64. ),
  65. function=svc.batch_get_notifications,
  66. ),
  67. "/chatto.api.v1.NotificationService/ListRoomNotifications": Endpoint.unary(
  68. method=MethodInfo(
  69. name="ListRoomNotifications",
  70. service_name="chatto.api.v1.NotificationService",
  71. input=chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationsRequest,
  72. output=chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationsResponse,
  73. idempotency_level=IdempotencyLevel.UNKNOWN,
  74. ),
  75. function=svc.list_room_notifications,
  76. ),
  77. "/chatto.api.v1.NotificationService/ListRoomNotificationCounts": Endpoint.unary(
  78. method=MethodInfo(
  79. name="ListRoomNotificationCounts",
  80. service_name="chatto.api.v1.NotificationService",
  81. input=chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationCountsRequest,
  82. output=chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationCountsResponse,
  83. idempotency_level=IdempotencyLevel.UNKNOWN,
  84. ),
  85. function=svc.list_room_notification_counts,
  86. ),
  87. "/chatto.api.v1.NotificationService/HasNotifications": Endpoint.unary(
  88. method=MethodInfo(
  89. name="HasNotifications",
  90. service_name="chatto.api.v1.NotificationService",
  91. input=chatto_dot_api_dot_v1_dot_notifications__pb2.HasNotificationsRequest,
  92. output=chatto_dot_api_dot_v1_dot_notifications__pb2.HasNotificationsResponse,
  93. idempotency_level=IdempotencyLevel.UNKNOWN,
  94. ),
  95. function=svc.has_notifications,
  96. ),
  97. "/chatto.api.v1.NotificationService/DismissNotification": Endpoint.unary(
  98. method=MethodInfo(
  99. name="DismissNotification",
  100. service_name="chatto.api.v1.NotificationService",
  101. input=chatto_dot_api_dot_v1_dot_notifications__pb2.DismissNotificationRequest,
  102. output=chatto_dot_api_dot_v1_dot_notifications__pb2.DismissNotificationResponse,
  103. idempotency_level=IdempotencyLevel.UNKNOWN,
  104. ),
  105. function=svc.dismiss_notification,
  106. ),
  107. "/chatto.api.v1.NotificationService/DismissAllNotifications": Endpoint.unary(
  108. method=MethodInfo(
  109. name="DismissAllNotifications",
  110. service_name="chatto.api.v1.NotificationService",
  111. input=chatto_dot_api_dot_v1_dot_notifications__pb2.DismissAllNotificationsRequest,
  112. output=chatto_dot_api_dot_v1_dot_notifications__pb2.DismissAllNotificationsResponse,
  113. idempotency_level=IdempotencyLevel.UNKNOWN,
  114. ),
  115. function=svc.dismiss_all_notifications,
  116. ),
  117. },
  118. interceptors=interceptors,
  119. read_max_bytes=read_max_bytes,
  120. compressions=compressions,
  121. )
  122. @property
  123. def path(self) -> str:
  124. """Returns the URL path to mount the application to when serving multiple applications."""
  125. return "/chatto.api.v1.NotificationService"
  126. class NotificationServiceClient(ConnectClient):
  127. async def list_notifications(
  128. self,
  129. request: chatto_dot_api_dot_v1_dot_notifications__pb2.ListNotificationsRequest,
  130. *,
  131. headers: Headers | Mapping[str, str] | None = None,
  132. timeout_ms: int | None = None,
  133. ) -> chatto_dot_api_dot_v1_dot_notifications__pb2.ListNotificationsResponse:
  134. return await self.execute_unary(
  135. request=request,
  136. method=MethodInfo(
  137. name="ListNotifications",
  138. service_name="chatto.api.v1.NotificationService",
  139. input=chatto_dot_api_dot_v1_dot_notifications__pb2.ListNotificationsRequest,
  140. output=chatto_dot_api_dot_v1_dot_notifications__pb2.ListNotificationsResponse,
  141. idempotency_level=IdempotencyLevel.UNKNOWN,
  142. ),
  143. headers=headers,
  144. timeout_ms=timeout_ms,
  145. )
  146. async def get_notification(
  147. self,
  148. request: chatto_dot_api_dot_v1_dot_notifications__pb2.GetNotificationRequest,
  149. *,
  150. headers: Headers | Mapping[str, str] | None = None,
  151. timeout_ms: int | None = None,
  152. ) -> chatto_dot_api_dot_v1_dot_notifications__pb2.GetNotificationResponse:
  153. return await self.execute_unary(
  154. request=request,
  155. method=MethodInfo(
  156. name="GetNotification",
  157. service_name="chatto.api.v1.NotificationService",
  158. input=chatto_dot_api_dot_v1_dot_notifications__pb2.GetNotificationRequest,
  159. output=chatto_dot_api_dot_v1_dot_notifications__pb2.GetNotificationResponse,
  160. idempotency_level=IdempotencyLevel.UNKNOWN,
  161. ),
  162. headers=headers,
  163. timeout_ms=timeout_ms,
  164. )
  165. async def batch_get_notifications(
  166. self,
  167. request: chatto_dot_api_dot_v1_dot_notifications__pb2.BatchGetNotificationsRequest,
  168. *,
  169. headers: Headers | Mapping[str, str] | None = None,
  170. timeout_ms: int | None = None,
  171. ) -> chatto_dot_api_dot_v1_dot_notifications__pb2.BatchGetNotificationsResponse:
  172. return await self.execute_unary(
  173. request=request,
  174. method=MethodInfo(
  175. name="BatchGetNotifications",
  176. service_name="chatto.api.v1.NotificationService",
  177. input=chatto_dot_api_dot_v1_dot_notifications__pb2.BatchGetNotificationsRequest,
  178. output=chatto_dot_api_dot_v1_dot_notifications__pb2.BatchGetNotificationsResponse,
  179. idempotency_level=IdempotencyLevel.UNKNOWN,
  180. ),
  181. headers=headers,
  182. timeout_ms=timeout_ms,
  183. )
  184. async def list_room_notifications(
  185. self,
  186. request: chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationsRequest,
  187. *,
  188. headers: Headers | Mapping[str, str] | None = None,
  189. timeout_ms: int | None = None,
  190. ) -> chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationsResponse:
  191. return await self.execute_unary(
  192. request=request,
  193. method=MethodInfo(
  194. name="ListRoomNotifications",
  195. service_name="chatto.api.v1.NotificationService",
  196. input=chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationsRequest,
  197. output=chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationsResponse,
  198. idempotency_level=IdempotencyLevel.UNKNOWN,
  199. ),
  200. headers=headers,
  201. timeout_ms=timeout_ms,
  202. )
  203. async def list_room_notification_counts(
  204. self,
  205. request: chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationCountsRequest,
  206. *,
  207. headers: Headers | Mapping[str, str] | None = None,
  208. timeout_ms: int | None = None,
  209. ) -> chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationCountsResponse:
  210. return await self.execute_unary(
  211. request=request,
  212. method=MethodInfo(
  213. name="ListRoomNotificationCounts",
  214. service_name="chatto.api.v1.NotificationService",
  215. input=chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationCountsRequest,
  216. output=chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationCountsResponse,
  217. idempotency_level=IdempotencyLevel.UNKNOWN,
  218. ),
  219. headers=headers,
  220. timeout_ms=timeout_ms,
  221. )
  222. async def has_notifications(
  223. self,
  224. request: chatto_dot_api_dot_v1_dot_notifications__pb2.HasNotificationsRequest,
  225. *,
  226. headers: Headers | Mapping[str, str] | None = None,
  227. timeout_ms: int | None = None,
  228. ) -> chatto_dot_api_dot_v1_dot_notifications__pb2.HasNotificationsResponse:
  229. return await self.execute_unary(
  230. request=request,
  231. method=MethodInfo(
  232. name="HasNotifications",
  233. service_name="chatto.api.v1.NotificationService",
  234. input=chatto_dot_api_dot_v1_dot_notifications__pb2.HasNotificationsRequest,
  235. output=chatto_dot_api_dot_v1_dot_notifications__pb2.HasNotificationsResponse,
  236. idempotency_level=IdempotencyLevel.UNKNOWN,
  237. ),
  238. headers=headers,
  239. timeout_ms=timeout_ms,
  240. )
  241. async def dismiss_notification(
  242. self,
  243. request: chatto_dot_api_dot_v1_dot_notifications__pb2.DismissNotificationRequest,
  244. *,
  245. headers: Headers | Mapping[str, str] | None = None,
  246. timeout_ms: int | None = None,
  247. ) -> chatto_dot_api_dot_v1_dot_notifications__pb2.DismissNotificationResponse:
  248. return await self.execute_unary(
  249. request=request,
  250. method=MethodInfo(
  251. name="DismissNotification",
  252. service_name="chatto.api.v1.NotificationService",
  253. input=chatto_dot_api_dot_v1_dot_notifications__pb2.DismissNotificationRequest,
  254. output=chatto_dot_api_dot_v1_dot_notifications__pb2.DismissNotificationResponse,
  255. idempotency_level=IdempotencyLevel.UNKNOWN,
  256. ),
  257. headers=headers,
  258. timeout_ms=timeout_ms,
  259. )
  260. async def dismiss_all_notifications(
  261. self,
  262. request: chatto_dot_api_dot_v1_dot_notifications__pb2.DismissAllNotificationsRequest,
  263. *,
  264. headers: Headers | Mapping[str, str] | None = None,
  265. timeout_ms: int | None = None,
  266. ) -> chatto_dot_api_dot_v1_dot_notifications__pb2.DismissAllNotificationsResponse:
  267. return await self.execute_unary(
  268. request=request,
  269. method=MethodInfo(
  270. name="DismissAllNotifications",
  271. service_name="chatto.api.v1.NotificationService",
  272. input=chatto_dot_api_dot_v1_dot_notifications__pb2.DismissAllNotificationsRequest,
  273. output=chatto_dot_api_dot_v1_dot_notifications__pb2.DismissAllNotificationsResponse,
  274. idempotency_level=IdempotencyLevel.UNKNOWN,
  275. ),
  276. headers=headers,
  277. timeout_ms=timeout_ms,
  278. )
  279. class NotificationServiceSync(Protocol):
  280. def list_notifications(self, request: chatto_dot_api_dot_v1_dot_notifications__pb2.ListNotificationsRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_notifications__pb2.ListNotificationsResponse:
  281. raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
  282. def get_notification(self, request: chatto_dot_api_dot_v1_dot_notifications__pb2.GetNotificationRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_notifications__pb2.GetNotificationResponse:
  283. raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
  284. def batch_get_notifications(self, request: chatto_dot_api_dot_v1_dot_notifications__pb2.BatchGetNotificationsRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_notifications__pb2.BatchGetNotificationsResponse:
  285. raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
  286. def list_room_notifications(self, request: chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationsRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationsResponse:
  287. raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
  288. def list_room_notification_counts(self, request: chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationCountsRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationCountsResponse:
  289. raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
  290. def has_notifications(self, request: chatto_dot_api_dot_v1_dot_notifications__pb2.HasNotificationsRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_notifications__pb2.HasNotificationsResponse:
  291. raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
  292. def dismiss_notification(self, request: chatto_dot_api_dot_v1_dot_notifications__pb2.DismissNotificationRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_notifications__pb2.DismissNotificationResponse:
  293. raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
  294. def dismiss_all_notifications(self, request: chatto_dot_api_dot_v1_dot_notifications__pb2.DismissAllNotificationsRequest, ctx: RequestContext) -> chatto_dot_api_dot_v1_dot_notifications__pb2.DismissAllNotificationsResponse:
  295. raise ConnectError(Code.UNIMPLEMENTED, "Not implemented")
  296. class NotificationServiceWSGIApplication(ConnectWSGIApplication):
  297. def __init__(self, service: NotificationServiceSync, interceptors: Iterable[InterceptorSync]=(), read_max_bytes: int | None = None, compressions: Iterable[Compression] | None = None) -> None:
  298. super().__init__(
  299. endpoints={
  300. "/chatto.api.v1.NotificationService/ListNotifications": EndpointSync.unary(
  301. method=MethodInfo(
  302. name="ListNotifications",
  303. service_name="chatto.api.v1.NotificationService",
  304. input=chatto_dot_api_dot_v1_dot_notifications__pb2.ListNotificationsRequest,
  305. output=chatto_dot_api_dot_v1_dot_notifications__pb2.ListNotificationsResponse,
  306. idempotency_level=IdempotencyLevel.UNKNOWN,
  307. ),
  308. function=service.list_notifications,
  309. ),
  310. "/chatto.api.v1.NotificationService/GetNotification": EndpointSync.unary(
  311. method=MethodInfo(
  312. name="GetNotification",
  313. service_name="chatto.api.v1.NotificationService",
  314. input=chatto_dot_api_dot_v1_dot_notifications__pb2.GetNotificationRequest,
  315. output=chatto_dot_api_dot_v1_dot_notifications__pb2.GetNotificationResponse,
  316. idempotency_level=IdempotencyLevel.UNKNOWN,
  317. ),
  318. function=service.get_notification,
  319. ),
  320. "/chatto.api.v1.NotificationService/BatchGetNotifications": EndpointSync.unary(
  321. method=MethodInfo(
  322. name="BatchGetNotifications",
  323. service_name="chatto.api.v1.NotificationService",
  324. input=chatto_dot_api_dot_v1_dot_notifications__pb2.BatchGetNotificationsRequest,
  325. output=chatto_dot_api_dot_v1_dot_notifications__pb2.BatchGetNotificationsResponse,
  326. idempotency_level=IdempotencyLevel.UNKNOWN,
  327. ),
  328. function=service.batch_get_notifications,
  329. ),
  330. "/chatto.api.v1.NotificationService/ListRoomNotifications": EndpointSync.unary(
  331. method=MethodInfo(
  332. name="ListRoomNotifications",
  333. service_name="chatto.api.v1.NotificationService",
  334. input=chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationsRequest,
  335. output=chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationsResponse,
  336. idempotency_level=IdempotencyLevel.UNKNOWN,
  337. ),
  338. function=service.list_room_notifications,
  339. ),
  340. "/chatto.api.v1.NotificationService/ListRoomNotificationCounts": EndpointSync.unary(
  341. method=MethodInfo(
  342. name="ListRoomNotificationCounts",
  343. service_name="chatto.api.v1.NotificationService",
  344. input=chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationCountsRequest,
  345. output=chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationCountsResponse,
  346. idempotency_level=IdempotencyLevel.UNKNOWN,
  347. ),
  348. function=service.list_room_notification_counts,
  349. ),
  350. "/chatto.api.v1.NotificationService/HasNotifications": EndpointSync.unary(
  351. method=MethodInfo(
  352. name="HasNotifications",
  353. service_name="chatto.api.v1.NotificationService",
  354. input=chatto_dot_api_dot_v1_dot_notifications__pb2.HasNotificationsRequest,
  355. output=chatto_dot_api_dot_v1_dot_notifications__pb2.HasNotificationsResponse,
  356. idempotency_level=IdempotencyLevel.UNKNOWN,
  357. ),
  358. function=service.has_notifications,
  359. ),
  360. "/chatto.api.v1.NotificationService/DismissNotification": EndpointSync.unary(
  361. method=MethodInfo(
  362. name="DismissNotification",
  363. service_name="chatto.api.v1.NotificationService",
  364. input=chatto_dot_api_dot_v1_dot_notifications__pb2.DismissNotificationRequest,
  365. output=chatto_dot_api_dot_v1_dot_notifications__pb2.DismissNotificationResponse,
  366. idempotency_level=IdempotencyLevel.UNKNOWN,
  367. ),
  368. function=service.dismiss_notification,
  369. ),
  370. "/chatto.api.v1.NotificationService/DismissAllNotifications": EndpointSync.unary(
  371. method=MethodInfo(
  372. name="DismissAllNotifications",
  373. service_name="chatto.api.v1.NotificationService",
  374. input=chatto_dot_api_dot_v1_dot_notifications__pb2.DismissAllNotificationsRequest,
  375. output=chatto_dot_api_dot_v1_dot_notifications__pb2.DismissAllNotificationsResponse,
  376. idempotency_level=IdempotencyLevel.UNKNOWN,
  377. ),
  378. function=service.dismiss_all_notifications,
  379. ),
  380. },
  381. interceptors=interceptors,
  382. read_max_bytes=read_max_bytes,
  383. compressions=compressions,
  384. )
  385. @property
  386. def path(self) -> str:
  387. """Returns the URL path to mount the application to when serving multiple applications."""
  388. return "/chatto.api.v1.NotificationService"
  389. class NotificationServiceClientSync(ConnectClientSync):
  390. def list_notifications(
  391. self,
  392. request: chatto_dot_api_dot_v1_dot_notifications__pb2.ListNotificationsRequest,
  393. *,
  394. headers: Headers | Mapping[str, str] | None = None,
  395. timeout_ms: int | None = None,
  396. ) -> chatto_dot_api_dot_v1_dot_notifications__pb2.ListNotificationsResponse:
  397. return self.execute_unary(
  398. request=request,
  399. method=MethodInfo(
  400. name="ListNotifications",
  401. service_name="chatto.api.v1.NotificationService",
  402. input=chatto_dot_api_dot_v1_dot_notifications__pb2.ListNotificationsRequest,
  403. output=chatto_dot_api_dot_v1_dot_notifications__pb2.ListNotificationsResponse,
  404. idempotency_level=IdempotencyLevel.UNKNOWN,
  405. ),
  406. headers=headers,
  407. timeout_ms=timeout_ms,
  408. )
  409. def get_notification(
  410. self,
  411. request: chatto_dot_api_dot_v1_dot_notifications__pb2.GetNotificationRequest,
  412. *,
  413. headers: Headers | Mapping[str, str] | None = None,
  414. timeout_ms: int | None = None,
  415. ) -> chatto_dot_api_dot_v1_dot_notifications__pb2.GetNotificationResponse:
  416. return self.execute_unary(
  417. request=request,
  418. method=MethodInfo(
  419. name="GetNotification",
  420. service_name="chatto.api.v1.NotificationService",
  421. input=chatto_dot_api_dot_v1_dot_notifications__pb2.GetNotificationRequest,
  422. output=chatto_dot_api_dot_v1_dot_notifications__pb2.GetNotificationResponse,
  423. idempotency_level=IdempotencyLevel.UNKNOWN,
  424. ),
  425. headers=headers,
  426. timeout_ms=timeout_ms,
  427. )
  428. def batch_get_notifications(
  429. self,
  430. request: chatto_dot_api_dot_v1_dot_notifications__pb2.BatchGetNotificationsRequest,
  431. *,
  432. headers: Headers | Mapping[str, str] | None = None,
  433. timeout_ms: int | None = None,
  434. ) -> chatto_dot_api_dot_v1_dot_notifications__pb2.BatchGetNotificationsResponse:
  435. return self.execute_unary(
  436. request=request,
  437. method=MethodInfo(
  438. name="BatchGetNotifications",
  439. service_name="chatto.api.v1.NotificationService",
  440. input=chatto_dot_api_dot_v1_dot_notifications__pb2.BatchGetNotificationsRequest,
  441. output=chatto_dot_api_dot_v1_dot_notifications__pb2.BatchGetNotificationsResponse,
  442. idempotency_level=IdempotencyLevel.UNKNOWN,
  443. ),
  444. headers=headers,
  445. timeout_ms=timeout_ms,
  446. )
  447. def list_room_notifications(
  448. self,
  449. request: chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationsRequest,
  450. *,
  451. headers: Headers | Mapping[str, str] | None = None,
  452. timeout_ms: int | None = None,
  453. ) -> chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationsResponse:
  454. return self.execute_unary(
  455. request=request,
  456. method=MethodInfo(
  457. name="ListRoomNotifications",
  458. service_name="chatto.api.v1.NotificationService",
  459. input=chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationsRequest,
  460. output=chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationsResponse,
  461. idempotency_level=IdempotencyLevel.UNKNOWN,
  462. ),
  463. headers=headers,
  464. timeout_ms=timeout_ms,
  465. )
  466. def list_room_notification_counts(
  467. self,
  468. request: chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationCountsRequest,
  469. *,
  470. headers: Headers | Mapping[str, str] | None = None,
  471. timeout_ms: int | None = None,
  472. ) -> chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationCountsResponse:
  473. return self.execute_unary(
  474. request=request,
  475. method=MethodInfo(
  476. name="ListRoomNotificationCounts",
  477. service_name="chatto.api.v1.NotificationService",
  478. input=chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationCountsRequest,
  479. output=chatto_dot_api_dot_v1_dot_notifications__pb2.ListRoomNotificationCountsResponse,
  480. idempotency_level=IdempotencyLevel.UNKNOWN,
  481. ),
  482. headers=headers,
  483. timeout_ms=timeout_ms,
  484. )
  485. def has_notifications(
  486. self,
  487. request: chatto_dot_api_dot_v1_dot_notifications__pb2.HasNotificationsRequest,
  488. *,
  489. headers: Headers | Mapping[str, str] | None = None,
  490. timeout_ms: int | None = None,
  491. ) -> chatto_dot_api_dot_v1_dot_notifications__pb2.HasNotificationsResponse:
  492. return self.execute_unary(
  493. request=request,
  494. method=MethodInfo(
  495. name="HasNotifications",
  496. service_name="chatto.api.v1.NotificationService",
  497. input=chatto_dot_api_dot_v1_dot_notifications__pb2.HasNotificationsRequest,
  498. output=chatto_dot_api_dot_v1_dot_notifications__pb2.HasNotificationsResponse,
  499. idempotency_level=IdempotencyLevel.UNKNOWN,
  500. ),
  501. headers=headers,
  502. timeout_ms=timeout_ms,
  503. )
  504. def dismiss_notification(
  505. self,
  506. request: chatto_dot_api_dot_v1_dot_notifications__pb2.DismissNotificationRequest,
  507. *,
  508. headers: Headers | Mapping[str, str] | None = None,
  509. timeout_ms: int | None = None,
  510. ) -> chatto_dot_api_dot_v1_dot_notifications__pb2.DismissNotificationResponse:
  511. return self.execute_unary(
  512. request=request,
  513. method=MethodInfo(
  514. name="DismissNotification",
  515. service_name="chatto.api.v1.NotificationService",
  516. input=chatto_dot_api_dot_v1_dot_notifications__pb2.DismissNotificationRequest,
  517. output=chatto_dot_api_dot_v1_dot_notifications__pb2.DismissNotificationResponse,
  518. idempotency_level=IdempotencyLevel.UNKNOWN,
  519. ),
  520. headers=headers,
  521. timeout_ms=timeout_ms,
  522. )
  523. def dismiss_all_notifications(
  524. self,
  525. request: chatto_dot_api_dot_v1_dot_notifications__pb2.DismissAllNotificationsRequest,
  526. *,
  527. headers: Headers | Mapping[str, str] | None = None,
  528. timeout_ms: int | None = None,
  529. ) -> chatto_dot_api_dot_v1_dot_notifications__pb2.DismissAllNotificationsResponse:
  530. return self.execute_unary(
  531. request=request,
  532. method=MethodInfo(
  533. name="DismissAllNotifications",
  534. service_name="chatto.api.v1.NotificationService",
  535. input=chatto_dot_api_dot_v1_dot_notifications__pb2.DismissAllNotificationsRequest,
  536. output=chatto_dot_api_dot_v1_dot_notifications__pb2.DismissAllNotificationsResponse,
  537. idempotency_level=IdempotencyLevel.UNKNOWN,
  538. ),
  539. headers=headers,
  540. timeout_ms=timeout_ms,
  541. )