|
1 | 1 | # This file was auto-generated by Fern from our API Definition.
|
2 | 2 |
|
| 3 | +from __future__ import annotations |
| 4 | + |
3 | 5 | import typing
|
4 | 6 |
|
5 | 7 | import httpx
|
6 | 8 | from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
7 | 9 | from .environment import MergeEnvironment
|
8 |
| -from .resources.accounting.client import AccountingClient, AsyncAccountingClient |
9 |
| -from .resources.ats.client import AsyncAtsClient, AtsClient |
10 |
| -from .resources.crm.client import AsyncCrmClient, CrmClient |
11 |
| -from .resources.filestorage.client import AsyncFilestorageClient, FilestorageClient |
12 |
| -from .resources.hris.client import AsyncHrisClient, HrisClient |
13 |
| -from .resources.ticketing.client import AsyncTicketingClient, TicketingClient |
| 10 | + |
| 11 | +if typing.TYPE_CHECKING: |
| 12 | + from .resources.accounting.client import AccountingClient, AsyncAccountingClient |
| 13 | + from .resources.ats.client import AsyncAtsClient, AtsClient |
| 14 | + from .resources.crm.client import AsyncCrmClient, CrmClient |
| 15 | + from .resources.filestorage.client import AsyncFilestorageClient, FilestorageClient |
| 16 | + from .resources.hris.client import AsyncHrisClient, HrisClient |
| 17 | + from .resources.ticketing.client import AsyncTicketingClient, TicketingClient |
14 | 18 |
|
15 | 19 |
|
16 | 20 | class Merge:
|
@@ -82,12 +86,60 @@ def __init__(
|
82 | 86 | else httpx.Client(timeout=_defaulted_timeout),
|
83 | 87 | timeout=_defaulted_timeout,
|
84 | 88 | )
|
85 |
| - self.ats = AtsClient(client_wrapper=self._client_wrapper) |
86 |
| - self.crm = CrmClient(client_wrapper=self._client_wrapper) |
87 |
| - self.filestorage = FilestorageClient(client_wrapper=self._client_wrapper) |
88 |
| - self.hris = HrisClient(client_wrapper=self._client_wrapper) |
89 |
| - self.ticketing = TicketingClient(client_wrapper=self._client_wrapper) |
90 |
| - self.accounting = AccountingClient(client_wrapper=self._client_wrapper) |
| 89 | + self._ats: typing.Optional[AtsClient] = None |
| 90 | + self._crm: typing.Optional[CrmClient] = None |
| 91 | + self._filestorage: typing.Optional[FilestorageClient] = None |
| 92 | + self._hris: typing.Optional[HrisClient] = None |
| 93 | + self._ticketing: typing.Optional[TicketingClient] = None |
| 94 | + self._accounting: typing.Optional[AccountingClient] = None |
| 95 | + |
| 96 | + @property |
| 97 | + def ats(self): |
| 98 | + if self._ats is None: |
| 99 | + from .resources.ats.client import AtsClient # noqa: E402 |
| 100 | + |
| 101 | + self._ats = AtsClient(client_wrapper=self._client_wrapper) |
| 102 | + return self._ats |
| 103 | + |
| 104 | + @property |
| 105 | + def crm(self): |
| 106 | + if self._crm is None: |
| 107 | + from .resources.crm.client import CrmClient # noqa: E402 |
| 108 | + |
| 109 | + self._crm = CrmClient(client_wrapper=self._client_wrapper) |
| 110 | + return self._crm |
| 111 | + |
| 112 | + @property |
| 113 | + def filestorage(self): |
| 114 | + if self._filestorage is None: |
| 115 | + from .resources.filestorage.client import FilestorageClient # noqa: E402 |
| 116 | + |
| 117 | + self._filestorage = FilestorageClient(client_wrapper=self._client_wrapper) |
| 118 | + return self._filestorage |
| 119 | + |
| 120 | + @property |
| 121 | + def hris(self): |
| 122 | + if self._hris is None: |
| 123 | + from .resources.hris.client import HrisClient # noqa: E402 |
| 124 | + |
| 125 | + self._hris = HrisClient(client_wrapper=self._client_wrapper) |
| 126 | + return self._hris |
| 127 | + |
| 128 | + @property |
| 129 | + def ticketing(self): |
| 130 | + if self._ticketing is None: |
| 131 | + from .resources.ticketing.client import TicketingClient # noqa: E402 |
| 132 | + |
| 133 | + self._ticketing = TicketingClient(client_wrapper=self._client_wrapper) |
| 134 | + return self._ticketing |
| 135 | + |
| 136 | + @property |
| 137 | + def accounting(self): |
| 138 | + if self._accounting is None: |
| 139 | + from .resources.accounting.client import AccountingClient # noqa: E402 |
| 140 | + |
| 141 | + self._accounting = AccountingClient(client_wrapper=self._client_wrapper) |
| 142 | + return self._accounting |
91 | 143 |
|
92 | 144 |
|
93 | 145 | class AsyncMerge:
|
@@ -159,12 +211,60 @@ def __init__(
|
159 | 211 | else httpx.AsyncClient(timeout=_defaulted_timeout),
|
160 | 212 | timeout=_defaulted_timeout,
|
161 | 213 | )
|
162 |
| - self.ats = AsyncAtsClient(client_wrapper=self._client_wrapper) |
163 |
| - self.crm = AsyncCrmClient(client_wrapper=self._client_wrapper) |
164 |
| - self.filestorage = AsyncFilestorageClient(client_wrapper=self._client_wrapper) |
165 |
| - self.hris = AsyncHrisClient(client_wrapper=self._client_wrapper) |
166 |
| - self.ticketing = AsyncTicketingClient(client_wrapper=self._client_wrapper) |
167 |
| - self.accounting = AsyncAccountingClient(client_wrapper=self._client_wrapper) |
| 214 | + self._ats: typing.Optional[AsyncAtsClient] = None |
| 215 | + self._crm: typing.Optional[AsyncCrmClient] = None |
| 216 | + self._filestorage: typing.Optional[AsyncFilestorageClient] = None |
| 217 | + self._hris: typing.Optional[AsyncHrisClient] = None |
| 218 | + self._ticketing: typing.Optional[AsyncTicketingClient] = None |
| 219 | + self._accounting: typing.Optional[AsyncAccountingClient] = None |
| 220 | + |
| 221 | + @property |
| 222 | + def ats(self): |
| 223 | + if self._ats is None: |
| 224 | + from .resources.ats.client import AsyncAtsClient # noqa: E402 |
| 225 | + |
| 226 | + self._ats = AsyncAtsClient(client_wrapper=self._client_wrapper) |
| 227 | + return self._ats |
| 228 | + |
| 229 | + @property |
| 230 | + def crm(self): |
| 231 | + if self._crm is None: |
| 232 | + from .resources.crm.client import AsyncCrmClient # noqa: E402 |
| 233 | + |
| 234 | + self._crm = AsyncCrmClient(client_wrapper=self._client_wrapper) |
| 235 | + return self._crm |
| 236 | + |
| 237 | + @property |
| 238 | + def filestorage(self): |
| 239 | + if self._filestorage is None: |
| 240 | + from .resources.filestorage.client import AsyncFilestorageClient # noqa: E402 |
| 241 | + |
| 242 | + self._filestorage = AsyncFilestorageClient(client_wrapper=self._client_wrapper) |
| 243 | + return self._filestorage |
| 244 | + |
| 245 | + @property |
| 246 | + def hris(self): |
| 247 | + if self._hris is None: |
| 248 | + from .resources.hris.client import AsyncHrisClient # noqa: E402 |
| 249 | + |
| 250 | + self._hris = AsyncHrisClient(client_wrapper=self._client_wrapper) |
| 251 | + return self._hris |
| 252 | + |
| 253 | + @property |
| 254 | + def ticketing(self): |
| 255 | + if self._ticketing is None: |
| 256 | + from .resources.ticketing.client import AsyncTicketingClient # noqa: E402 |
| 257 | + |
| 258 | + self._ticketing = AsyncTicketingClient(client_wrapper=self._client_wrapper) |
| 259 | + return self._ticketing |
| 260 | + |
| 261 | + @property |
| 262 | + def accounting(self): |
| 263 | + if self._accounting is None: |
| 264 | + from .resources.accounting.client import AsyncAccountingClient # noqa: E402 |
| 265 | + |
| 266 | + self._accounting = AsyncAccountingClient(client_wrapper=self._client_wrapper) |
| 267 | + return self._accounting |
168 | 268 |
|
169 | 269 |
|
170 | 270 | def _get_base_url(*, base_url: typing.Optional[str] = None, environment: MergeEnvironment) -> str:
|
|
0 commit comments