summary refs log tree commit diff
path: root/synapse/rest/client/versions.py
diff options
context:
space:
mode:
authorPatrick Cloke <clokep@users.noreply.github.com>2021-08-23 08:14:17 -0400
committerGitHub <noreply@github.com>2021-08-23 08:14:17 -0400
commit2af6d31b78109a989e27128ac655990c35b29d62 (patch)
treede461f67cf18f7bce536407e07b1eab15deee56a /synapse/rest/client/versions.py
parentDo not include stack traces for known exceptions when trying multiple federat... (diff)
downloadsynapse-2af6d31b78109a989e27128ac655990c35b29d62.tar.xz
Addtional type hints for the REST servlets. (#10665)
Diffstat (limited to 'synapse/rest/client/versions.py')
-rw-r--r--synapse/rest/client/versions.py14
1 files changed, 11 insertions, 3 deletions
diff --git a/synapse/rest/client/versions.py b/synapse/rest/client/versions.py
index fa2e4e9cba..a1a815cf82 100644
--- a/synapse/rest/client/versions.py
+++ b/synapse/rest/client/versions.py
@@ -17,9 +17,17 @@
 
 import logging
 import re
+from typing import TYPE_CHECKING, Tuple
+
+from twisted.web.server import Request
 
 from synapse.api.constants import RoomCreationPreset
+from synapse.http.server import HttpServer
 from synapse.http.servlet import RestServlet
+from synapse.types import JsonDict
+
+if TYPE_CHECKING:
+    from synapse.server import HomeServer
 
 logger = logging.getLogger(__name__)
 
@@ -27,7 +35,7 @@ logger = logging.getLogger(__name__)
 class VersionsRestServlet(RestServlet):
     PATTERNS = [re.compile("^/_matrix/client/versions$")]
 
-    def __init__(self, hs):
+    def __init__(self, hs: "HomeServer"):
         super().__init__()
         self.config = hs.config
 
@@ -45,7 +53,7 @@ class VersionsRestServlet(RestServlet):
             in self.config.encryption_enabled_by_default_for_room_presets
         )
 
-    def on_GET(self, request):
+    def on_GET(self, request: Request) -> Tuple[int, JsonDict]:
         return (
             200,
             {
@@ -89,5 +97,5 @@ class VersionsRestServlet(RestServlet):
         )
 
 
-def register_servlets(hs, http_server):
+def register_servlets(hs: "HomeServer", http_server: HttpServer) -> None:
     VersionsRestServlet(hs).register(http_server)