|
| 1 | +# This file was auto-generated by Fern from our API Definition. |
| 2 | + |
| 3 | +import typing |
| 4 | + |
| 5 | +from backports.cached_property import cached_property |
| 6 | + |
| 7 | +from .environment import CodecombatApiEnvironment |
| 8 | +from .resources.auth.client import AsyncAuthClient, AuthClient |
| 9 | +from .resources.clans.client import AsyncClansClient, ClansClient |
| 10 | +from .resources.classrooms.client import AsyncClassroomsClient, ClassroomsClient |
| 11 | +from .resources.stats.client import AsyncStatsClient, StatsClient |
| 12 | +from .resources.users.client import AsyncUsersClient, UsersClient |
| 13 | + |
| 14 | + |
| 15 | +class CodecombatApi: |
| 16 | + def __init__( |
| 17 | + self, |
| 18 | + *, |
| 19 | + environment: CodecombatApiEnvironment = CodecombatApiEnvironment.PRODUCTION, |
| 20 | + username: typing.Optional[str] = None, |
| 21 | + password: typing.Optional[str] = None |
| 22 | + ): |
| 23 | + self._environment = environment |
| 24 | + self._username = username |
| 25 | + self._password = password |
| 26 | + |
| 27 | + @cached_property |
| 28 | + def auth(self) -> AuthClient: |
| 29 | + return AuthClient(environment=self._environment, username=self._username, password=self._password) |
| 30 | + |
| 31 | + @cached_property |
| 32 | + def clans(self) -> ClansClient: |
| 33 | + return ClansClient(environment=self._environment, username=self._username, password=self._password) |
| 34 | + |
| 35 | + @cached_property |
| 36 | + def classrooms(self) -> ClassroomsClient: |
| 37 | + return ClassroomsClient(environment=self._environment, username=self._username, password=self._password) |
| 38 | + |
| 39 | + @cached_property |
| 40 | + def stats(self) -> StatsClient: |
| 41 | + return StatsClient(environment=self._environment, username=self._username, password=self._password) |
| 42 | + |
| 43 | + @cached_property |
| 44 | + def users(self) -> UsersClient: |
| 45 | + return UsersClient(environment=self._environment, username=self._username, password=self._password) |
| 46 | + |
| 47 | + |
| 48 | +class AsyncCodecombatApi: |
| 49 | + def __init__( |
| 50 | + self, |
| 51 | + *, |
| 52 | + environment: CodecombatApiEnvironment = CodecombatApiEnvironment.PRODUCTION, |
| 53 | + username: typing.Optional[str] = None, |
| 54 | + password: typing.Optional[str] = None |
| 55 | + ): |
| 56 | + self._environment = environment |
| 57 | + self._username = username |
| 58 | + self._password = password |
| 59 | + |
| 60 | + @cached_property |
| 61 | + def auth(self) -> AsyncAuthClient: |
| 62 | + return AsyncAuthClient(environment=self._environment, username=self._username, password=self._password) |
| 63 | + |
| 64 | + @cached_property |
| 65 | + def clans(self) -> AsyncClansClient: |
| 66 | + return AsyncClansClient(environment=self._environment, username=self._username, password=self._password) |
| 67 | + |
| 68 | + @cached_property |
| 69 | + def classrooms(self) -> AsyncClassroomsClient: |
| 70 | + return AsyncClassroomsClient(environment=self._environment, username=self._username, password=self._password) |
| 71 | + |
| 72 | + @cached_property |
| 73 | + def stats(self) -> AsyncStatsClient: |
| 74 | + return AsyncStatsClient(environment=self._environment, username=self._username, password=self._password) |
| 75 | + |
| 76 | + @cached_property |
| 77 | + def users(self) -> AsyncUsersClient: |
| 78 | + return AsyncUsersClient(environment=self._environment, username=self._username, password=self._password) |
0 commit comments