Skip to content

Commit ef36085

Browse files
chore(internal): codegen related update (#71)
1 parent c0046ed commit ef36085

File tree

2 files changed

+120
-110
lines changed

2 files changed

+120
-110
lines changed

src/asktable/_client.py

Lines changed: 117 additions & 106 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
import httpx
1010

11-
from . import resources, _exceptions
11+
from . import _exceptions
1212
from ._qs import Querystring
1313
from ._types import (
1414
NOT_GIVEN,
@@ -24,20 +24,25 @@
2424
get_async_library,
2525
)
2626
from ._version import __version__
27+
from .resources import auth, bots, roles, caches, policies, integration, securetunnels, business_glossary
2728
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
2829
from ._exceptions import AsktableError, APIStatusError
2930
from ._base_client import (
3031
DEFAULT_MAX_RETRIES,
3132
SyncAPIClient,
3233
AsyncAPIClient,
3334
)
35+
from .resources.sys import sys
36+
from .resources.chats import chats
37+
from .resources.extapis import extapis
38+
from .resources.datasources import datasources
39+
from .resources.single_turn import single_turn
3440

3541
__all__ = [
3642
"Timeout",
3743
"Transport",
3844
"ProxiesTypes",
3945
"RequestOptions",
40-
"resources",
4146
"Asktable",
4247
"AsyncAsktable",
4348
"Client",
@@ -46,19 +51,19 @@
4651

4752

4853
class Asktable(SyncAPIClient):
49-
sys: resources.SysResource
50-
securetunnels: resources.SecuretunnelsResource
51-
roles: resources.RolesResource
52-
policies: resources.PoliciesResource
53-
chats: resources.ChatsResource
54-
datasources: resources.DatasourcesResource
55-
bots: resources.BotsResource
56-
extapis: resources.ExtapisResource
57-
auth: resources.AuthResource
58-
single_turn: resources.SingleTurnResource
59-
caches: resources.CachesResource
60-
integration: resources.IntegrationResource
61-
business_glossary: resources.BusinessGlossaryResource
54+
sys: sys.SysResource
55+
securetunnels: securetunnels.SecuretunnelsResource
56+
roles: roles.RolesResource
57+
policies: policies.PoliciesResource
58+
chats: chats.ChatsResource
59+
datasources: datasources.DatasourcesResource
60+
bots: bots.BotsResource
61+
extapis: extapis.ExtapisResource
62+
auth: auth.AuthResource
63+
single_turn: single_turn.SingleTurnResource
64+
caches: caches.CachesResource
65+
integration: integration.IntegrationResource
66+
business_glossary: business_glossary.BusinessGlossaryResource
6267
with_raw_response: AsktableWithRawResponse
6368
with_streaming_response: AsktableWithStreamedResponse
6469

@@ -116,19 +121,19 @@ def __init__(
116121
_strict_response_validation=_strict_response_validation,
117122
)
118123

119-
self.sys = resources.SysResource(self)
120-
self.securetunnels = resources.SecuretunnelsResource(self)
121-
self.roles = resources.RolesResource(self)
122-
self.policies = resources.PoliciesResource(self)
123-
self.chats = resources.ChatsResource(self)
124-
self.datasources = resources.DatasourcesResource(self)
125-
self.bots = resources.BotsResource(self)
126-
self.extapis = resources.ExtapisResource(self)
127-
self.auth = resources.AuthResource(self)
128-
self.single_turn = resources.SingleTurnResource(self)
129-
self.caches = resources.CachesResource(self)
130-
self.integration = resources.IntegrationResource(self)
131-
self.business_glossary = resources.BusinessGlossaryResource(self)
124+
self.sys = sys.SysResource(self)
125+
self.securetunnels = securetunnels.SecuretunnelsResource(self)
126+
self.roles = roles.RolesResource(self)
127+
self.policies = policies.PoliciesResource(self)
128+
self.chats = chats.ChatsResource(self)
129+
self.datasources = datasources.DatasourcesResource(self)
130+
self.bots = bots.BotsResource(self)
131+
self.extapis = extapis.ExtapisResource(self)
132+
self.auth = auth.AuthResource(self)
133+
self.single_turn = single_turn.SingleTurnResource(self)
134+
self.caches = caches.CachesResource(self)
135+
self.integration = integration.IntegrationResource(self)
136+
self.business_glossary = business_glossary.BusinessGlossaryResource(self)
132137
self.with_raw_response = AsktableWithRawResponse(self)
133138
self.with_streaming_response = AsktableWithStreamedResponse(self)
134139

@@ -238,19 +243,19 @@ def _make_status_error(
238243

239244

240245
class AsyncAsktable(AsyncAPIClient):
241-
sys: resources.AsyncSysResource
242-
securetunnels: resources.AsyncSecuretunnelsResource
243-
roles: resources.AsyncRolesResource
244-
policies: resources.AsyncPoliciesResource
245-
chats: resources.AsyncChatsResource
246-
datasources: resources.AsyncDatasourcesResource
247-
bots: resources.AsyncBotsResource
248-
extapis: resources.AsyncExtapisResource
249-
auth: resources.AsyncAuthResource
250-
single_turn: resources.AsyncSingleTurnResource
251-
caches: resources.AsyncCachesResource
252-
integration: resources.AsyncIntegrationResource
253-
business_glossary: resources.AsyncBusinessGlossaryResource
246+
sys: sys.AsyncSysResource
247+
securetunnels: securetunnels.AsyncSecuretunnelsResource
248+
roles: roles.AsyncRolesResource
249+
policies: policies.AsyncPoliciesResource
250+
chats: chats.AsyncChatsResource
251+
datasources: datasources.AsyncDatasourcesResource
252+
bots: bots.AsyncBotsResource
253+
extapis: extapis.AsyncExtapisResource
254+
auth: auth.AsyncAuthResource
255+
single_turn: single_turn.AsyncSingleTurnResource
256+
caches: caches.AsyncCachesResource
257+
integration: integration.AsyncIntegrationResource
258+
business_glossary: business_glossary.AsyncBusinessGlossaryResource
254259
with_raw_response: AsyncAsktableWithRawResponse
255260
with_streaming_response: AsyncAsktableWithStreamedResponse
256261

@@ -308,19 +313,19 @@ def __init__(
308313
_strict_response_validation=_strict_response_validation,
309314
)
310315

311-
self.sys = resources.AsyncSysResource(self)
312-
self.securetunnels = resources.AsyncSecuretunnelsResource(self)
313-
self.roles = resources.AsyncRolesResource(self)
314-
self.policies = resources.AsyncPoliciesResource(self)
315-
self.chats = resources.AsyncChatsResource(self)
316-
self.datasources = resources.AsyncDatasourcesResource(self)
317-
self.bots = resources.AsyncBotsResource(self)
318-
self.extapis = resources.AsyncExtapisResource(self)
319-
self.auth = resources.AsyncAuthResource(self)
320-
self.single_turn = resources.AsyncSingleTurnResource(self)
321-
self.caches = resources.AsyncCachesResource(self)
322-
self.integration = resources.AsyncIntegrationResource(self)
323-
self.business_glossary = resources.AsyncBusinessGlossaryResource(self)
316+
self.sys = sys.AsyncSysResource(self)
317+
self.securetunnels = securetunnels.AsyncSecuretunnelsResource(self)
318+
self.roles = roles.AsyncRolesResource(self)
319+
self.policies = policies.AsyncPoliciesResource(self)
320+
self.chats = chats.AsyncChatsResource(self)
321+
self.datasources = datasources.AsyncDatasourcesResource(self)
322+
self.bots = bots.AsyncBotsResource(self)
323+
self.extapis = extapis.AsyncExtapisResource(self)
324+
self.auth = auth.AsyncAuthResource(self)
325+
self.single_turn = single_turn.AsyncSingleTurnResource(self)
326+
self.caches = caches.AsyncCachesResource(self)
327+
self.integration = integration.AsyncIntegrationResource(self)
328+
self.business_glossary = business_glossary.AsyncBusinessGlossaryResource(self)
324329
self.with_raw_response = AsyncAsktableWithRawResponse(self)
325330
self.with_streaming_response = AsyncAsktableWithStreamedResponse(self)
326331

@@ -431,70 +436,76 @@ def _make_status_error(
431436

432437
class AsktableWithRawResponse:
433438
def __init__(self, client: Asktable) -> None:
434-
self.sys = resources.SysResourceWithRawResponse(client.sys)
435-
self.securetunnels = resources.SecuretunnelsResourceWithRawResponse(client.securetunnels)
436-
self.roles = resources.RolesResourceWithRawResponse(client.roles)
437-
self.policies = resources.PoliciesResourceWithRawResponse(client.policies)
438-
self.chats = resources.ChatsResourceWithRawResponse(client.chats)
439-
self.datasources = resources.DatasourcesResourceWithRawResponse(client.datasources)
440-
self.bots = resources.BotsResourceWithRawResponse(client.bots)
441-
self.extapis = resources.ExtapisResourceWithRawResponse(client.extapis)
442-
self.auth = resources.AuthResourceWithRawResponse(client.auth)
443-
self.single_turn = resources.SingleTurnResourceWithRawResponse(client.single_turn)
444-
self.caches = resources.CachesResourceWithRawResponse(client.caches)
445-
self.integration = resources.IntegrationResourceWithRawResponse(client.integration)
446-
self.business_glossary = resources.BusinessGlossaryResourceWithRawResponse(client.business_glossary)
439+
self.sys = sys.SysResourceWithRawResponse(client.sys)
440+
self.securetunnels = securetunnels.SecuretunnelsResourceWithRawResponse(client.securetunnels)
441+
self.roles = roles.RolesResourceWithRawResponse(client.roles)
442+
self.policies = policies.PoliciesResourceWithRawResponse(client.policies)
443+
self.chats = chats.ChatsResourceWithRawResponse(client.chats)
444+
self.datasources = datasources.DatasourcesResourceWithRawResponse(client.datasources)
445+
self.bots = bots.BotsResourceWithRawResponse(client.bots)
446+
self.extapis = extapis.ExtapisResourceWithRawResponse(client.extapis)
447+
self.auth = auth.AuthResourceWithRawResponse(client.auth)
448+
self.single_turn = single_turn.SingleTurnResourceWithRawResponse(client.single_turn)
449+
self.caches = caches.CachesResourceWithRawResponse(client.caches)
450+
self.integration = integration.IntegrationResourceWithRawResponse(client.integration)
451+
self.business_glossary = business_glossary.BusinessGlossaryResourceWithRawResponse(client.business_glossary)
447452

448453

449454
class AsyncAsktableWithRawResponse:
450455
def __init__(self, client: AsyncAsktable) -> None:
451-
self.sys = resources.AsyncSysResourceWithRawResponse(client.sys)
452-
self.securetunnels = resources.AsyncSecuretunnelsResourceWithRawResponse(client.securetunnels)
453-
self.roles = resources.AsyncRolesResourceWithRawResponse(client.roles)
454-
self.policies = resources.AsyncPoliciesResourceWithRawResponse(client.policies)
455-
self.chats = resources.AsyncChatsResourceWithRawResponse(client.chats)
456-
self.datasources = resources.AsyncDatasourcesResourceWithRawResponse(client.datasources)
457-
self.bots = resources.AsyncBotsResourceWithRawResponse(client.bots)
458-
self.extapis = resources.AsyncExtapisResourceWithRawResponse(client.extapis)
459-
self.auth = resources.AsyncAuthResourceWithRawResponse(client.auth)
460-
self.single_turn = resources.AsyncSingleTurnResourceWithRawResponse(client.single_turn)
461-
self.caches = resources.AsyncCachesResourceWithRawResponse(client.caches)
462-
self.integration = resources.AsyncIntegrationResourceWithRawResponse(client.integration)
463-
self.business_glossary = resources.AsyncBusinessGlossaryResourceWithRawResponse(client.business_glossary)
456+
self.sys = sys.AsyncSysResourceWithRawResponse(client.sys)
457+
self.securetunnels = securetunnels.AsyncSecuretunnelsResourceWithRawResponse(client.securetunnels)
458+
self.roles = roles.AsyncRolesResourceWithRawResponse(client.roles)
459+
self.policies = policies.AsyncPoliciesResourceWithRawResponse(client.policies)
460+
self.chats = chats.AsyncChatsResourceWithRawResponse(client.chats)
461+
self.datasources = datasources.AsyncDatasourcesResourceWithRawResponse(client.datasources)
462+
self.bots = bots.AsyncBotsResourceWithRawResponse(client.bots)
463+
self.extapis = extapis.AsyncExtapisResourceWithRawResponse(client.extapis)
464+
self.auth = auth.AsyncAuthResourceWithRawResponse(client.auth)
465+
self.single_turn = single_turn.AsyncSingleTurnResourceWithRawResponse(client.single_turn)
466+
self.caches = caches.AsyncCachesResourceWithRawResponse(client.caches)
467+
self.integration = integration.AsyncIntegrationResourceWithRawResponse(client.integration)
468+
self.business_glossary = business_glossary.AsyncBusinessGlossaryResourceWithRawResponse(
469+
client.business_glossary
470+
)
464471

465472

466473
class AsktableWithStreamedResponse:
467474
def __init__(self, client: Asktable) -> None:
468-
self.sys = resources.SysResourceWithStreamingResponse(client.sys)
469-
self.securetunnels = resources.SecuretunnelsResourceWithStreamingResponse(client.securetunnels)
470-
self.roles = resources.RolesResourceWithStreamingResponse(client.roles)
471-
self.policies = resources.PoliciesResourceWithStreamingResponse(client.policies)
472-
self.chats = resources.ChatsResourceWithStreamingResponse(client.chats)
473-
self.datasources = resources.DatasourcesResourceWithStreamingResponse(client.datasources)
474-
self.bots = resources.BotsResourceWithStreamingResponse(client.bots)
475-
self.extapis = resources.ExtapisResourceWithStreamingResponse(client.extapis)
476-
self.auth = resources.AuthResourceWithStreamingResponse(client.auth)
477-
self.single_turn = resources.SingleTurnResourceWithStreamingResponse(client.single_turn)
478-
self.caches = resources.CachesResourceWithStreamingResponse(client.caches)
479-
self.integration = resources.IntegrationResourceWithStreamingResponse(client.integration)
480-
self.business_glossary = resources.BusinessGlossaryResourceWithStreamingResponse(client.business_glossary)
475+
self.sys = sys.SysResourceWithStreamingResponse(client.sys)
476+
self.securetunnels = securetunnels.SecuretunnelsResourceWithStreamingResponse(client.securetunnels)
477+
self.roles = roles.RolesResourceWithStreamingResponse(client.roles)
478+
self.policies = policies.PoliciesResourceWithStreamingResponse(client.policies)
479+
self.chats = chats.ChatsResourceWithStreamingResponse(client.chats)
480+
self.datasources = datasources.DatasourcesResourceWithStreamingResponse(client.datasources)
481+
self.bots = bots.BotsResourceWithStreamingResponse(client.bots)
482+
self.extapis = extapis.ExtapisResourceWithStreamingResponse(client.extapis)
483+
self.auth = auth.AuthResourceWithStreamingResponse(client.auth)
484+
self.single_turn = single_turn.SingleTurnResourceWithStreamingResponse(client.single_turn)
485+
self.caches = caches.CachesResourceWithStreamingResponse(client.caches)
486+
self.integration = integration.IntegrationResourceWithStreamingResponse(client.integration)
487+
self.business_glossary = business_glossary.BusinessGlossaryResourceWithStreamingResponse(
488+
client.business_glossary
489+
)
481490

482491

483492
class AsyncAsktableWithStreamedResponse:
484493
def __init__(self, client: AsyncAsktable) -> None:
485-
self.sys = resources.AsyncSysResourceWithStreamingResponse(client.sys)
486-
self.securetunnels = resources.AsyncSecuretunnelsResourceWithStreamingResponse(client.securetunnels)
487-
self.roles = resources.AsyncRolesResourceWithStreamingResponse(client.roles)
488-
self.policies = resources.AsyncPoliciesResourceWithStreamingResponse(client.policies)
489-
self.chats = resources.AsyncChatsResourceWithStreamingResponse(client.chats)
490-
self.datasources = resources.AsyncDatasourcesResourceWithStreamingResponse(client.datasources)
491-
self.bots = resources.AsyncBotsResourceWithStreamingResponse(client.bots)
492-
self.extapis = resources.AsyncExtapisResourceWithStreamingResponse(client.extapis)
493-
self.auth = resources.AsyncAuthResourceWithStreamingResponse(client.auth)
494-
self.single_turn = resources.AsyncSingleTurnResourceWithStreamingResponse(client.single_turn)
495-
self.caches = resources.AsyncCachesResourceWithStreamingResponse(client.caches)
496-
self.integration = resources.AsyncIntegrationResourceWithStreamingResponse(client.integration)
497-
self.business_glossary = resources.AsyncBusinessGlossaryResourceWithStreamingResponse(client.business_glossary)
494+
self.sys = sys.AsyncSysResourceWithStreamingResponse(client.sys)
495+
self.securetunnels = securetunnels.AsyncSecuretunnelsResourceWithStreamingResponse(client.securetunnels)
496+
self.roles = roles.AsyncRolesResourceWithStreamingResponse(client.roles)
497+
self.policies = policies.AsyncPoliciesResourceWithStreamingResponse(client.policies)
498+
self.chats = chats.AsyncChatsResourceWithStreamingResponse(client.chats)
499+
self.datasources = datasources.AsyncDatasourcesResourceWithStreamingResponse(client.datasources)
500+
self.bots = bots.AsyncBotsResourceWithStreamingResponse(client.bots)
501+
self.extapis = extapis.AsyncExtapisResourceWithStreamingResponse(client.extapis)
502+
self.auth = auth.AsyncAuthResourceWithStreamingResponse(client.auth)
503+
self.single_turn = single_turn.AsyncSingleTurnResourceWithStreamingResponse(client.single_turn)
504+
self.caches = caches.AsyncCachesResourceWithStreamingResponse(client.caches)
505+
self.integration = integration.AsyncIntegrationResourceWithStreamingResponse(client.integration)
506+
self.business_glossary = business_glossary.AsyncBusinessGlossaryResourceWithStreamingResponse(
507+
client.business_glossary
508+
)
498509

499510

500511
Client = Asktable

src/asktable/resources/sys/sys.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,16 @@
22

33
from __future__ import annotations
44

5-
from .projects import (
5+
from ..._compat import cached_property
6+
from ..._resource import SyncAPIResource, AsyncAPIResource
7+
from .projects.projects import (
68
ProjectsResource,
79
AsyncProjectsResource,
810
ProjectsResourceWithRawResponse,
911
AsyncProjectsResourceWithRawResponse,
1012
ProjectsResourceWithStreamingResponse,
1113
AsyncProjectsResourceWithStreamingResponse,
1214
)
13-
from ..._compat import cached_property
14-
from ..._resource import SyncAPIResource, AsyncAPIResource
15-
from .projects.projects import ProjectsResource, AsyncProjectsResource
1615

1716
__all__ = ["SysResource", "AsyncSysResource"]
1817

0 commit comments

Comments
 (0)