|
3 | 3 | from __future__ import annotations |
4 | 4 |
|
5 | 5 | import sys |
6 | | -from typing import TYPE_CHECKING, Any |
| 6 | +from typing import Any, cast |
7 | 7 |
|
8 | 8 | if sys.version_info >= (3, 11): |
9 | 9 | from typing import Self |
10 | 10 | else: |
11 | 11 | from typing_extensions import Self |
12 | 12 |
|
| 13 | +from . import types as lm_types |
13 | 14 | from .client import AsyncLettermintClient, LettermintClient |
14 | 15 | from .endpoints.api import ( |
15 | 16 | AsyncDomainsEndpoint, |
|
31 | 32 | ) |
32 | 33 | from .endpoints.email import AsyncEmailEndpoint, EmailEndpoint |
33 | 34 |
|
34 | | -if TYPE_CHECKING: |
35 | | - from . import types as lm_types |
36 | | - |
37 | 35 |
|
38 | 36 | class _EmailAccessor: |
39 | 37 | def __get__(self, instance: Lettermint | None, owner: type[Lettermint]) -> Any: |
@@ -91,7 +89,10 @@ def ping(self) -> str: |
91 | 89 | return self._client.get_raw("/ping").strip() |
92 | 90 |
|
93 | 91 | def blocked_file_types(self) -> lm_types.BlockedFileTypesResponse: |
94 | | - return self._client.get("/blocked-file-types") |
| 92 | + return cast( |
| 93 | + lm_types.BlockedFileTypesResponse, |
| 94 | + self._client.get("/blocked-file-types"), |
| 95 | + ) |
95 | 96 |
|
96 | 97 |
|
97 | 98 | class AsyncApiClient: |
@@ -132,7 +133,10 @@ async def ping(self) -> str: |
132 | 133 | return (await self._client.get_raw("/ping")).strip() |
133 | 134 |
|
134 | 135 | async def blocked_file_types(self) -> lm_types.BlockedFileTypesResponse: |
135 | | - return await self._client.get("/blocked-file-types") |
| 136 | + return cast( |
| 137 | + lm_types.BlockedFileTypesResponse, |
| 138 | + await self._client.get("/blocked-file-types"), |
| 139 | + ) |
136 | 140 |
|
137 | 141 |
|
138 | 142 | class Lettermint: |
|
0 commit comments