Skip to content

Commit 6a363c3

Browse files
chore(internal): codegen related update (#72)
1 parent ef36085 commit 6a363c3

File tree

2 files changed

+110
-120
lines changed

2 files changed

+110
-120
lines changed

src/asktable/_client.py

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

99
import httpx
1010

11-
from . import _exceptions
11+
from . import resources, _exceptions
1212
from ._qs import Querystring
1313
from ._types import (
1414
NOT_GIVEN,
@@ -24,25 +24,20 @@
2424
get_async_library,
2525
)
2626
from ._version import __version__
27-
from .resources import auth, bots, roles, caches, policies, integration, securetunnels, business_glossary
2827
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
2928
from ._exceptions import AsktableError, APIStatusError
3029
from ._base_client import (
3130
DEFAULT_MAX_RETRIES,
3231
SyncAPIClient,
3332
AsyncAPIClient,
3433
)
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
4034

4135
__all__ = [
4236
"Timeout",
4337
"Transport",
4438
"ProxiesTypes",
4539
"RequestOptions",
40+
"resources",
4641
"Asktable",
4742
"AsyncAsktable",
4843
"Client",
@@ -51,19 +46,19 @@
5146

5247

5348
class Asktable(SyncAPIClient):
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
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
6762
with_raw_response: AsktableWithRawResponse
6863
with_streaming_response: AsktableWithStreamedResponse
6964

@@ -121,19 +116,19 @@ def __init__(
121116
_strict_response_validation=_strict_response_validation,
122117
)
123118

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)
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)
137132
self.with_raw_response = AsktableWithRawResponse(self)
138133
self.with_streaming_response = AsktableWithStreamedResponse(self)
139134

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

244239

245240
class AsyncAsktable(AsyncAPIClient):
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
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
259254
with_raw_response: AsyncAsktableWithRawResponse
260255
with_streaming_response: AsyncAsktableWithStreamedResponse
261256

@@ -313,19 +308,19 @@ def __init__(
313308
_strict_response_validation=_strict_response_validation,
314309
)
315310

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)
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)
329324
self.with_raw_response = AsyncAsktableWithRawResponse(self)
330325
self.with_streaming_response = AsyncAsktableWithStreamedResponse(self)
331326

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

437432
class AsktableWithRawResponse:
438433
def __init__(self, client: Asktable) -> None:
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)
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)
452447

453448

454449
class AsyncAsktableWithRawResponse:
455450
def __init__(self, client: AsyncAsktable) -> None:
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-
)
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)
471464

472465

473466
class AsktableWithStreamedResponse:
474467
def __init__(self, client: Asktable) -> None:
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-
)
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)
490481

491482

492483
class AsyncAsktableWithStreamedResponse:
493484
def __init__(self, client: AsyncAsktable) -> None:
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-
)
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)
509498

510499

511500
Client = Asktable

src/asktable/resources/sys/sys.py

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

33
from __future__ import annotations
44

5-
from ..._compat import cached_property
6-
from ..._resource import SyncAPIResource, AsyncAPIResource
7-
from .projects.projects import (
5+
from .projects import (
86
ProjectsResource,
97
AsyncProjectsResource,
108
ProjectsResourceWithRawResponse,
119
AsyncProjectsResourceWithRawResponse,
1210
ProjectsResourceWithStreamingResponse,
1311
AsyncProjectsResourceWithStreamingResponse,
1412
)
13+
from ..._compat import cached_property
14+
from ..._resource import SyncAPIResource, AsyncAPIResource
15+
from .projects.projects import ProjectsResource, AsyncProjectsResource
1516

1617
__all__ = ["SysResource", "AsyncSysResource"]
1718

0 commit comments

Comments
 (0)