|
23 | 23 | from juju.utils import IdQueue |
24 | 24 | from juju.version import CLIENT_VERSION |
25 | 25 |
|
26 | | -from .facade import _JSON, _RICH_JSON, TypeEncoder |
| 26 | +from .facade import TypeEncoder, _Json, _RichJson |
27 | 27 | from .facade_versions import client_facade_versions, known_unsupported_facades |
28 | 28 |
|
29 | | -SPECIFIED_FACADES: TypeAlias = "dict[str, dict[Literal['versions'], Sequence[int]]]" |
| 29 | +SpecifiedFacades: TypeAlias = "dict[str, dict[Literal['versions'], Sequence[int]]]" |
30 | 30 | _WebSocket: TypeAlias = "websockets.legacy.client.WebSocketClientProtocol" |
31 | 31 |
|
32 | 32 | LEVELS = ["TRACE", "DEBUG", "INFO", "WARNING", "ERROR"] |
@@ -140,7 +140,7 @@ async def connect( |
140 | 140 | max_frame_size: int | None = None, |
141 | 141 | retries=3, |
142 | 142 | retry_backoff=10, |
143 | | - specified_facades: SPECIFIED_FACADES | None = None, |
| 143 | + specified_facades: SpecifiedFacades | None = None, |
144 | 144 | proxy=None, |
145 | 145 | debug_log_conn=None, |
146 | 146 | debug_log_params={}, |
@@ -542,17 +542,17 @@ async def _do_ping(): |
542 | 542 |
|
543 | 543 | @overload |
544 | 544 | async def rpc( |
545 | | - self, msg: dict[str, _JSON], encoder: None = None |
546 | | - ) -> dict[str, _JSON]: ... |
| 545 | + self, msg: dict[str, _Json], encoder: None = None |
| 546 | + ) -> dict[str, _Json]: ... |
547 | 547 |
|
548 | 548 | @overload |
549 | 549 | async def rpc( |
550 | | - self, msg: dict[str, _RICH_JSON], encoder: TypeEncoder |
551 | | - ) -> dict[str, _JSON]: ... |
| 550 | + self, msg: dict[str, _RichJson], encoder: TypeEncoder |
| 551 | + ) -> dict[str, _Json]: ... |
552 | 552 |
|
553 | 553 | async def rpc( |
554 | 554 | self, msg: dict[str, Any], encoder: json.JSONEncoder | None = None |
555 | | - ) -> dict[str, Any]: |
| 555 | + ) -> dict[str, _Json]: |
556 | 556 | """Make an RPC to the API. The message is encoded as JSON |
557 | 557 | using the given encoder if any. |
558 | 558 | :param msg: Parameters for the call (will be encoded as JSON). |
|
0 commit comments