athena-intelligence 0.1.227__py3-none-any.whl → 0.1.357__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of athena-intelligence might be problematic. Click here for more details.
- athena/__init__.py +223 -69
- athena/agents/__init__.py +33 -1
- athena/agents/client.py +81 -18
- athena/aop/client.py +2 -2
- athena/aop/raw_client.py +2 -2
- athena/assets/client.py +359 -2
- athena/assets/raw_client.py +562 -0
- athena/base_client.py +118 -18
- athena/client.py +23 -21
- athena/core/__init__.py +73 -20
- athena/core/client_wrapper.py +2 -2
- athena/core/force_multipart.py +4 -2
- athena/core/http_response.py +1 -1
- athena/core/pydantic_utilities.py +5 -2
- athena/environment.py +0 -2
- athena/errors/__init__.py +42 -7
- athena/query/__init__.py +28 -1
- athena/query/types/__init__.py +30 -1
- athena/tools/__init__.py +39 -4
- athena/tools/client.py +161 -31
- athena/tools/raw_client.py +12 -9
- athena/tools/sheets/__init__.py +29 -2
- athena/tools/sheets/client.py +66 -101
- athena/tools/sheets/raw_client.py +66 -93
- athena/tools/sheets/types/__init__.py +31 -2
- athena/tools/sheets/types/{insert_table_row_request_row_data_item_value.py → update_sheet_range_request_values_item_item.py} +1 -1
- athena/tools/types/__init__.py +28 -1
- athena/types/__init__.py +187 -52
- athena/types/aop_execute_response_out.py +2 -1
- athena/types/border_model.py +32 -0
- athena/types/border_style.py +7 -0
- athena/types/borders_model.py +58 -0
- athena/types/cell_format.py +60 -0
- athena/types/cell_format_horizontal_alignment.py +5 -0
- athena/types/cell_format_vertical_alignment.py +5 -0
- athena/types/conversation_asset_info.py +8 -2
- athena/types/conversation_message.py +42 -0
- athena/types/conversation_result.py +67 -0
- athena/types/creatable_asset_type.py +5 -0
- athena/types/create_asset_response_out.py +46 -0
- athena/types/create_project_response_out.py +51 -0
- athena/types/dimension_properties.py +49 -0
- athena/types/grid_range.py +39 -0
- athena/types/{file_chunk_request_out.py → number_format_model.py} +8 -4
- athena/types/number_format_type.py +21 -0
- athena/types/sheet.py +83 -0
- athena/types/table_row_data.py +5 -0
- athena/types/text_format_model.py +37 -0
- athena/types/textrotation.py +5 -0
- athena/types/{document_chunk.py → theme_color.py} +3 -7
- athena/types/thread_status_response_out.py +5 -0
- athena/types/wrap_strategy.py +5 -0
- {athena_intelligence-0.1.227.dist-info → athena_intelligence-0.1.357.dist-info}/METADATA +1 -1
- {athena_intelligence-0.1.227.dist-info → athena_intelligence-0.1.357.dist-info}/RECORD +55 -36
- {athena_intelligence-0.1.227.dist-info → athena_intelligence-0.1.357.dist-info}/WHEEL +0 -0
athena/tools/client.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
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
|
from .. import core
|
|
@@ -8,17 +10,17 @@ from ..core.request_options import RequestOptions
|
|
|
8
10
|
from ..types.asset_content_request_out import AssetContentRequestOut
|
|
9
11
|
from ..types.asset_screenshot_response_out import AssetScreenshotResponseOut
|
|
10
12
|
from ..types.data_frame_request_out import DataFrameRequestOut
|
|
11
|
-
from ..types.file_chunk_request_out import FileChunkRequestOut
|
|
12
13
|
from ..types.folder_response import FolderResponse
|
|
13
14
|
from ..types.save_asset_request_out import SaveAssetRequestOut
|
|
14
|
-
from .calendar.client import AsyncCalendarClient, CalendarClient
|
|
15
|
-
from .email.client import AsyncEmailClient, EmailClient
|
|
16
15
|
from .raw_client import AsyncRawToolsClient, RawToolsClient
|
|
17
|
-
from .sheets.client import AsyncSheetsClient, SheetsClient
|
|
18
|
-
from .structured_data_extractor.client import AsyncStructuredDataExtractorClient, StructuredDataExtractorClient
|
|
19
|
-
from .tasks.client import AsyncTasksClient, TasksClient
|
|
20
16
|
from .types.tools_data_frame_request_columns_item import ToolsDataFrameRequestColumnsItem
|
|
21
17
|
|
|
18
|
+
if typing.TYPE_CHECKING:
|
|
19
|
+
from .calendar.client import AsyncCalendarClient, CalendarClient
|
|
20
|
+
from .email.client import AsyncEmailClient, EmailClient
|
|
21
|
+
from .sheets.client import AsyncSheetsClient, SheetsClient
|
|
22
|
+
from .structured_data_extractor.client import AsyncStructuredDataExtractorClient, StructuredDataExtractorClient
|
|
23
|
+
from .tasks.client import AsyncTasksClient, TasksClient
|
|
22
24
|
# this is used as the default value for optional parameters
|
|
23
25
|
OMIT = typing.cast(typing.Any, ...)
|
|
24
26
|
|
|
@@ -26,15 +28,12 @@ OMIT = typing.cast(typing.Any, ...)
|
|
|
26
28
|
class ToolsClient:
|
|
27
29
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
|
28
30
|
self._raw_client = RawToolsClient(client_wrapper=client_wrapper)
|
|
29
|
-
self.
|
|
30
|
-
|
|
31
|
-
self.
|
|
32
|
-
|
|
33
|
-
self.
|
|
34
|
-
|
|
35
|
-
self.structured_data_extractor = StructuredDataExtractorClient(client_wrapper=client_wrapper)
|
|
36
|
-
|
|
37
|
-
self.tasks = TasksClient(client_wrapper=client_wrapper)
|
|
31
|
+
self._client_wrapper = client_wrapper
|
|
32
|
+
self._calendar: typing.Optional[CalendarClient] = None
|
|
33
|
+
self._email: typing.Optional[EmailClient] = None
|
|
34
|
+
self._sheets: typing.Optional[SheetsClient] = None
|
|
35
|
+
self._structured_data_extractor: typing.Optional[StructuredDataExtractorClient] = None
|
|
36
|
+
self._tasks: typing.Optional[TasksClient] = None
|
|
38
37
|
|
|
39
38
|
@property
|
|
40
39
|
def with_raw_response(self) -> RawToolsClient:
|
|
@@ -49,7 +48,7 @@ class ToolsClient:
|
|
|
49
48
|
|
|
50
49
|
def get_asset_chunks(
|
|
51
50
|
self, *, asset_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
|
|
52
|
-
) ->
|
|
51
|
+
) -> typing.Optional[typing.Any]:
|
|
53
52
|
"""
|
|
54
53
|
Get the chunks of a file.
|
|
55
54
|
|
|
@@ -63,7 +62,7 @@ class ToolsClient:
|
|
|
63
62
|
|
|
64
63
|
Returns
|
|
65
64
|
-------
|
|
66
|
-
|
|
65
|
+
typing.Optional[typing.Any]
|
|
67
66
|
Successful Response
|
|
68
67
|
|
|
69
68
|
Examples
|
|
@@ -148,6 +147,7 @@ class ToolsClient:
|
|
|
148
147
|
)
|
|
149
148
|
client.tools.get_asset_screenshot(
|
|
150
149
|
asset_id="asset_id",
|
|
150
|
+
page_number=1,
|
|
151
151
|
)
|
|
152
152
|
"""
|
|
153
153
|
_response = self._raw_client.get_asset_screenshot(
|
|
@@ -192,7 +192,12 @@ class ToolsClient:
|
|
|
192
192
|
client = Athena(
|
|
193
193
|
api_key="YOUR_API_KEY",
|
|
194
194
|
)
|
|
195
|
-
client.tools.list_contents(
|
|
195
|
+
client.tools.list_contents(
|
|
196
|
+
asset_id="asset_id",
|
|
197
|
+
folder_id="folder_id",
|
|
198
|
+
include_asset_details=True,
|
|
199
|
+
include_system_files=True,
|
|
200
|
+
)
|
|
196
201
|
"""
|
|
197
202
|
_response = self._raw_client.list_contents(
|
|
198
203
|
asset_id=asset_id,
|
|
@@ -251,6 +256,10 @@ class ToolsClient:
|
|
|
251
256
|
)
|
|
252
257
|
client.tools.data_frame(
|
|
253
258
|
asset_id="asset_id",
|
|
259
|
+
row_limit=1,
|
|
260
|
+
index_column=1,
|
|
261
|
+
sheet_name="sheet_name",
|
|
262
|
+
separator="separator",
|
|
254
263
|
)
|
|
255
264
|
"""
|
|
256
265
|
_response = self._raw_client.data_frame(
|
|
@@ -281,6 +290,17 @@ class ToolsClient:
|
|
|
281
290
|
-------
|
|
282
291
|
typing.Iterator[bytes]
|
|
283
292
|
Stream the file in original format.
|
|
293
|
+
|
|
294
|
+
Examples
|
|
295
|
+
--------
|
|
296
|
+
from athena import Athena
|
|
297
|
+
|
|
298
|
+
client = Athena(
|
|
299
|
+
api_key="YOUR_API_KEY",
|
|
300
|
+
)
|
|
301
|
+
client.tools.raw_data(
|
|
302
|
+
asset_id="asset_id",
|
|
303
|
+
)
|
|
284
304
|
"""
|
|
285
305
|
with self._raw_client.raw_data(asset_id=asset_id, request_options=request_options) as r:
|
|
286
306
|
yield from r.data
|
|
@@ -316,26 +336,65 @@ class ToolsClient:
|
|
|
316
336
|
client = Athena(
|
|
317
337
|
api_key="YOUR_API_KEY",
|
|
318
338
|
)
|
|
319
|
-
client.tools.save_asset(
|
|
339
|
+
client.tools.save_asset(
|
|
340
|
+
parent_folder_id="parent_folder_id",
|
|
341
|
+
)
|
|
320
342
|
"""
|
|
321
343
|
_response = self._raw_client.save_asset(
|
|
322
344
|
file=file, parent_folder_id=parent_folder_id, request_options=request_options
|
|
323
345
|
)
|
|
324
346
|
return _response.data
|
|
325
347
|
|
|
348
|
+
@property
|
|
349
|
+
def calendar(self):
|
|
350
|
+
if self._calendar is None:
|
|
351
|
+
from .calendar.client import CalendarClient # noqa: E402
|
|
326
352
|
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
353
|
+
self._calendar = CalendarClient(client_wrapper=self._client_wrapper)
|
|
354
|
+
return self._calendar
|
|
355
|
+
|
|
356
|
+
@property
|
|
357
|
+
def email(self):
|
|
358
|
+
if self._email is None:
|
|
359
|
+
from .email.client import EmailClient # noqa: E402
|
|
360
|
+
|
|
361
|
+
self._email = EmailClient(client_wrapper=self._client_wrapper)
|
|
362
|
+
return self._email
|
|
363
|
+
|
|
364
|
+
@property
|
|
365
|
+
def sheets(self):
|
|
366
|
+
if self._sheets is None:
|
|
367
|
+
from .sheets.client import SheetsClient # noqa: E402
|
|
331
368
|
|
|
332
|
-
|
|
369
|
+
self._sheets = SheetsClient(client_wrapper=self._client_wrapper)
|
|
370
|
+
return self._sheets
|
|
333
371
|
|
|
334
|
-
|
|
372
|
+
@property
|
|
373
|
+
def structured_data_extractor(self):
|
|
374
|
+
if self._structured_data_extractor is None:
|
|
375
|
+
from .structured_data_extractor.client import StructuredDataExtractorClient # noqa: E402
|
|
376
|
+
|
|
377
|
+
self._structured_data_extractor = StructuredDataExtractorClient(client_wrapper=self._client_wrapper)
|
|
378
|
+
return self._structured_data_extractor
|
|
335
379
|
|
|
336
|
-
|
|
380
|
+
@property
|
|
381
|
+
def tasks(self):
|
|
382
|
+
if self._tasks is None:
|
|
383
|
+
from .tasks.client import TasksClient # noqa: E402
|
|
337
384
|
|
|
338
|
-
|
|
385
|
+
self._tasks = TasksClient(client_wrapper=self._client_wrapper)
|
|
386
|
+
return self._tasks
|
|
387
|
+
|
|
388
|
+
|
|
389
|
+
class AsyncToolsClient:
|
|
390
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
|
391
|
+
self._raw_client = AsyncRawToolsClient(client_wrapper=client_wrapper)
|
|
392
|
+
self._client_wrapper = client_wrapper
|
|
393
|
+
self._calendar: typing.Optional[AsyncCalendarClient] = None
|
|
394
|
+
self._email: typing.Optional[AsyncEmailClient] = None
|
|
395
|
+
self._sheets: typing.Optional[AsyncSheetsClient] = None
|
|
396
|
+
self._structured_data_extractor: typing.Optional[AsyncStructuredDataExtractorClient] = None
|
|
397
|
+
self._tasks: typing.Optional[AsyncTasksClient] = None
|
|
339
398
|
|
|
340
399
|
@property
|
|
341
400
|
def with_raw_response(self) -> AsyncRawToolsClient:
|
|
@@ -350,7 +409,7 @@ class AsyncToolsClient:
|
|
|
350
409
|
|
|
351
410
|
async def get_asset_chunks(
|
|
352
411
|
self, *, asset_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
|
|
353
|
-
) ->
|
|
412
|
+
) -> typing.Optional[typing.Any]:
|
|
354
413
|
"""
|
|
355
414
|
Get the chunks of a file.
|
|
356
415
|
|
|
@@ -364,7 +423,7 @@ class AsyncToolsClient:
|
|
|
364
423
|
|
|
365
424
|
Returns
|
|
366
425
|
-------
|
|
367
|
-
|
|
426
|
+
typing.Optional[typing.Any]
|
|
368
427
|
Successful Response
|
|
369
428
|
|
|
370
429
|
Examples
|
|
@@ -470,6 +529,7 @@ class AsyncToolsClient:
|
|
|
470
529
|
async def main() -> None:
|
|
471
530
|
await client.tools.get_asset_screenshot(
|
|
472
531
|
asset_id="asset_id",
|
|
532
|
+
page_number=1,
|
|
473
533
|
)
|
|
474
534
|
|
|
475
535
|
|
|
@@ -522,7 +582,12 @@ class AsyncToolsClient:
|
|
|
522
582
|
|
|
523
583
|
|
|
524
584
|
async def main() -> None:
|
|
525
|
-
await client.tools.list_contents(
|
|
585
|
+
await client.tools.list_contents(
|
|
586
|
+
asset_id="asset_id",
|
|
587
|
+
folder_id="folder_id",
|
|
588
|
+
include_asset_details=True,
|
|
589
|
+
include_system_files=True,
|
|
590
|
+
)
|
|
526
591
|
|
|
527
592
|
|
|
528
593
|
asyncio.run(main())
|
|
@@ -589,6 +654,10 @@ class AsyncToolsClient:
|
|
|
589
654
|
async def main() -> None:
|
|
590
655
|
await client.tools.data_frame(
|
|
591
656
|
asset_id="asset_id",
|
|
657
|
+
row_limit=1,
|
|
658
|
+
index_column=1,
|
|
659
|
+
sheet_name="sheet_name",
|
|
660
|
+
separator="separator",
|
|
592
661
|
)
|
|
593
662
|
|
|
594
663
|
|
|
@@ -622,6 +691,25 @@ class AsyncToolsClient:
|
|
|
622
691
|
-------
|
|
623
692
|
typing.AsyncIterator[bytes]
|
|
624
693
|
Stream the file in original format.
|
|
694
|
+
|
|
695
|
+
Examples
|
|
696
|
+
--------
|
|
697
|
+
import asyncio
|
|
698
|
+
|
|
699
|
+
from athena import AsyncAthena
|
|
700
|
+
|
|
701
|
+
client = AsyncAthena(
|
|
702
|
+
api_key="YOUR_API_KEY",
|
|
703
|
+
)
|
|
704
|
+
|
|
705
|
+
|
|
706
|
+
async def main() -> None:
|
|
707
|
+
await client.tools.raw_data(
|
|
708
|
+
asset_id="asset_id",
|
|
709
|
+
)
|
|
710
|
+
|
|
711
|
+
|
|
712
|
+
asyncio.run(main())
|
|
625
713
|
"""
|
|
626
714
|
async with self._raw_client.raw_data(asset_id=asset_id, request_options=request_options) as r:
|
|
627
715
|
async for _chunk in r.data:
|
|
@@ -663,7 +751,9 @@ class AsyncToolsClient:
|
|
|
663
751
|
|
|
664
752
|
|
|
665
753
|
async def main() -> None:
|
|
666
|
-
await client.tools.save_asset(
|
|
754
|
+
await client.tools.save_asset(
|
|
755
|
+
parent_folder_id="parent_folder_id",
|
|
756
|
+
)
|
|
667
757
|
|
|
668
758
|
|
|
669
759
|
asyncio.run(main())
|
|
@@ -672,3 +762,43 @@ class AsyncToolsClient:
|
|
|
672
762
|
file=file, parent_folder_id=parent_folder_id, request_options=request_options
|
|
673
763
|
)
|
|
674
764
|
return _response.data
|
|
765
|
+
|
|
766
|
+
@property
|
|
767
|
+
def calendar(self):
|
|
768
|
+
if self._calendar is None:
|
|
769
|
+
from .calendar.client import AsyncCalendarClient # noqa: E402
|
|
770
|
+
|
|
771
|
+
self._calendar = AsyncCalendarClient(client_wrapper=self._client_wrapper)
|
|
772
|
+
return self._calendar
|
|
773
|
+
|
|
774
|
+
@property
|
|
775
|
+
def email(self):
|
|
776
|
+
if self._email is None:
|
|
777
|
+
from .email.client import AsyncEmailClient # noqa: E402
|
|
778
|
+
|
|
779
|
+
self._email = AsyncEmailClient(client_wrapper=self._client_wrapper)
|
|
780
|
+
return self._email
|
|
781
|
+
|
|
782
|
+
@property
|
|
783
|
+
def sheets(self):
|
|
784
|
+
if self._sheets is None:
|
|
785
|
+
from .sheets.client import AsyncSheetsClient # noqa: E402
|
|
786
|
+
|
|
787
|
+
self._sheets = AsyncSheetsClient(client_wrapper=self._client_wrapper)
|
|
788
|
+
return self._sheets
|
|
789
|
+
|
|
790
|
+
@property
|
|
791
|
+
def structured_data_extractor(self):
|
|
792
|
+
if self._structured_data_extractor is None:
|
|
793
|
+
from .structured_data_extractor.client import AsyncStructuredDataExtractorClient # noqa: E402
|
|
794
|
+
|
|
795
|
+
self._structured_data_extractor = AsyncStructuredDataExtractorClient(client_wrapper=self._client_wrapper)
|
|
796
|
+
return self._structured_data_extractor
|
|
797
|
+
|
|
798
|
+
@property
|
|
799
|
+
def tasks(self):
|
|
800
|
+
if self._tasks is None:
|
|
801
|
+
from .tasks.client import AsyncTasksClient # noqa: E402
|
|
802
|
+
|
|
803
|
+
self._tasks = AsyncTasksClient(client_wrapper=self._client_wrapper)
|
|
804
|
+
return self._tasks
|
athena/tools/raw_client.py
CHANGED
|
@@ -21,7 +21,6 @@ from ..types.asset_content_request_out import AssetContentRequestOut
|
|
|
21
21
|
from ..types.asset_screenshot_response_out import AssetScreenshotResponseOut
|
|
22
22
|
from ..types.data_frame_request_out import DataFrameRequestOut
|
|
23
23
|
from ..types.data_frame_unknown_format_error import DataFrameUnknownFormatError
|
|
24
|
-
from ..types.file_chunk_request_out import FileChunkRequestOut
|
|
25
24
|
from ..types.file_too_large_error import FileTooLargeError
|
|
26
25
|
from ..types.folder_response import FolderResponse
|
|
27
26
|
from ..types.save_asset_request_out import SaveAssetRequestOut
|
|
@@ -37,7 +36,7 @@ class RawToolsClient:
|
|
|
37
36
|
|
|
38
37
|
def get_asset_chunks(
|
|
39
38
|
self, *, asset_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
|
|
40
|
-
) -> HttpResponse[
|
|
39
|
+
) -> HttpResponse[typing.Optional[typing.Any]]:
|
|
41
40
|
"""
|
|
42
41
|
Get the chunks of a file.
|
|
43
42
|
|
|
@@ -51,7 +50,7 @@ class RawToolsClient:
|
|
|
51
50
|
|
|
52
51
|
Returns
|
|
53
52
|
-------
|
|
54
|
-
HttpResponse[
|
|
53
|
+
HttpResponse[typing.Optional[typing.Any]]
|
|
55
54
|
Successful Response
|
|
56
55
|
"""
|
|
57
56
|
_response = self._client_wrapper.httpx_client.request(
|
|
@@ -67,11 +66,13 @@ class RawToolsClient:
|
|
|
67
66
|
omit=OMIT,
|
|
68
67
|
)
|
|
69
68
|
try:
|
|
69
|
+
if _response is None or not _response.text.strip():
|
|
70
|
+
return HttpResponse(response=_response, data=None)
|
|
70
71
|
if 200 <= _response.status_code < 300:
|
|
71
72
|
_data = typing.cast(
|
|
72
|
-
|
|
73
|
+
typing.Optional[typing.Any],
|
|
73
74
|
parse_obj_as(
|
|
74
|
-
type_=
|
|
75
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
75
76
|
object_=_response.json(),
|
|
76
77
|
),
|
|
77
78
|
)
|
|
@@ -684,7 +685,7 @@ class AsyncRawToolsClient:
|
|
|
684
685
|
|
|
685
686
|
async def get_asset_chunks(
|
|
686
687
|
self, *, asset_ids: typing.Sequence[str], request_options: typing.Optional[RequestOptions] = None
|
|
687
|
-
) -> AsyncHttpResponse[
|
|
688
|
+
) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
|
|
688
689
|
"""
|
|
689
690
|
Get the chunks of a file.
|
|
690
691
|
|
|
@@ -698,7 +699,7 @@ class AsyncRawToolsClient:
|
|
|
698
699
|
|
|
699
700
|
Returns
|
|
700
701
|
-------
|
|
701
|
-
AsyncHttpResponse[
|
|
702
|
+
AsyncHttpResponse[typing.Optional[typing.Any]]
|
|
702
703
|
Successful Response
|
|
703
704
|
"""
|
|
704
705
|
_response = await self._client_wrapper.httpx_client.request(
|
|
@@ -714,11 +715,13 @@ class AsyncRawToolsClient:
|
|
|
714
715
|
omit=OMIT,
|
|
715
716
|
)
|
|
716
717
|
try:
|
|
718
|
+
if _response is None or not _response.text.strip():
|
|
719
|
+
return AsyncHttpResponse(response=_response, data=None)
|
|
717
720
|
if 200 <= _response.status_code < 300:
|
|
718
721
|
_data = typing.cast(
|
|
719
|
-
|
|
722
|
+
typing.Optional[typing.Any],
|
|
720
723
|
parse_obj_as(
|
|
721
|
-
type_=
|
|
724
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
|
722
725
|
object_=_response.json(),
|
|
723
726
|
),
|
|
724
727
|
)
|
athena/tools/sheets/__init__.py
CHANGED
|
@@ -2,6 +2,33 @@
|
|
|
2
2
|
|
|
3
3
|
# isort: skip_file
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
import typing
|
|
6
|
+
from importlib import import_module
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
if typing.TYPE_CHECKING:
|
|
9
|
+
from .types import UpdateSheetRangeRequestValuesItemItem
|
|
10
|
+
_dynamic_imports: typing.Dict[str, str] = {"UpdateSheetRangeRequestValuesItemItem": ".types"}
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def __getattr__(attr_name: str) -> typing.Any:
|
|
14
|
+
module_name = _dynamic_imports.get(attr_name)
|
|
15
|
+
if module_name is None:
|
|
16
|
+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
|
|
17
|
+
try:
|
|
18
|
+
module = import_module(module_name, __package__)
|
|
19
|
+
if module_name == f".{attr_name}":
|
|
20
|
+
return module
|
|
21
|
+
else:
|
|
22
|
+
return getattr(module, attr_name)
|
|
23
|
+
except ImportError as e:
|
|
24
|
+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
|
|
25
|
+
except AttributeError as e:
|
|
26
|
+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
def __dir__():
|
|
30
|
+
lazy_attrs = list(_dynamic_imports.keys())
|
|
31
|
+
return sorted(lazy_attrs)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
__all__ = ["UpdateSheetRangeRequestValuesItemItem"]
|