athena-intelligence 0.1.124__py3-none-any.whl → 0.1.126__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.
Files changed (58) hide show
  1. athena/__init__.py +3 -0
  2. athena/agents/client.py +88 -36
  3. athena/agents/drive/client.py +80 -32
  4. athena/agents/general/client.py +222 -91
  5. athena/agents/research/client.py +80 -32
  6. athena/agents/sql/client.py +80 -32
  7. athena/base_client.py +13 -11
  8. athena/client.py +191 -80
  9. athena/core/__init__.py +21 -4
  10. athena/core/client_wrapper.py +9 -10
  11. athena/core/file.py +37 -8
  12. athena/core/http_client.py +97 -41
  13. athena/core/jsonable_encoder.py +33 -31
  14. athena/core/pydantic_utilities.py +272 -4
  15. athena/core/query_encoder.py +38 -13
  16. athena/core/request_options.py +5 -2
  17. athena/core/serialization.py +272 -0
  18. athena/errors/internal_server_error.py +2 -3
  19. athena/errors/unauthorized_error.py +2 -3
  20. athena/errors/unprocessable_entity_error.py +2 -3
  21. athena/query/client.py +208 -58
  22. athena/tools/calendar/client.py +82 -30
  23. athena/tools/client.py +576 -184
  24. athena/tools/email/client.py +117 -43
  25. athena/tools/structured_data_extractor/client.py +118 -67
  26. athena/tools/tasks/client.py +41 -17
  27. athena/types/asset_node.py +14 -24
  28. athena/types/asset_not_found_error.py +11 -21
  29. athena/types/chunk.py +11 -21
  30. athena/types/chunk_content_item.py +21 -41
  31. athena/types/chunk_result.py +13 -23
  32. athena/types/custom_agent_response.py +12 -22
  33. athena/types/data_frame_request_out.py +11 -21
  34. athena/types/data_frame_unknown_format_error.py +11 -21
  35. athena/types/document_chunk.py +12 -22
  36. athena/types/drive_agent_response.py +12 -22
  37. athena/types/file_chunk_request_out.py +11 -21
  38. athena/types/file_too_large_error.py +11 -21
  39. athena/types/folder_response.py +11 -21
  40. athena/types/general_agent_config.py +11 -21
  41. athena/types/general_agent_config_enabled_tools_item.py +0 -1
  42. athena/types/general_agent_request.py +13 -23
  43. athena/types/general_agent_response.py +12 -22
  44. athena/types/image_url_content.py +11 -21
  45. athena/types/parent_folder_error.py +11 -21
  46. athena/types/prompt_message.py +12 -22
  47. athena/types/research_agent_response.py +12 -22
  48. athena/types/save_asset_request_out.py +11 -21
  49. athena/types/sql_agent_response.py +13 -23
  50. athena/types/structured_data_extractor_response.py +15 -25
  51. athena/types/text_content.py +11 -21
  52. athena/types/tool.py +1 -13
  53. athena/types/type.py +1 -21
  54. athena/version.py +0 -1
  55. {athena_intelligence-0.1.124.dist-info → athena_intelligence-0.1.126.dist-info}/METADATA +12 -4
  56. athena_intelligence-0.1.126.dist-info/RECORD +87 -0
  57. {athena_intelligence-0.1.124.dist-info → athena_intelligence-0.1.126.dist-info}/WHEEL +1 -1
  58. athena_intelligence-0.1.124.dist-info/RECORD +0 -86
@@ -1,10 +1,9 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import typing
4
-
5
3
  from ..core.api_error import ApiError
4
+ import typing
6
5
 
7
6
 
8
7
  class UnauthorizedError(ApiError):
9
- def __init__(self, body: typing.Any):
8
+ def __init__(self, body: typing.Optional[typing.Any]):
10
9
  super().__init__(status_code=401, body=body)
@@ -1,10 +1,9 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
- import typing
4
-
5
3
  from ..core.api_error import ApiError
4
+ import typing
6
5
 
7
6
 
8
7
  class UnprocessableEntityError(ApiError):
9
- def __init__(self, body: typing.Any):
8
+ def __init__(self, body: typing.Optional[typing.Any]):
10
9
  super().__init__(status_code=422, body=body)
athena/query/client.py CHANGED
@@ -1,18 +1,18 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
+ from ..core.client_wrapper import SyncClientWrapper
4
+ from .types.query_execute_request_database_asset_ids import QueryExecuteRequestDatabaseAssetIds
3
5
  import typing
4
- from json.decoder import JSONDecodeError
5
-
6
- from ..core.api_error import ApiError
7
- from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
- from ..core.jsonable_encoder import jsonable_encoder
9
- from ..core.pydantic_utilities import pydantic_v1
10
6
  from ..core.request_options import RequestOptions
11
- from ..errors.internal_server_error import InternalServerError
7
+ from ..types.data_frame_request_out import DataFrameRequestOut
8
+ from ..core.serialization import convert_and_respect_annotation_metadata
9
+ from ..core.pydantic_utilities import parse_obj_as
12
10
  from ..errors.unauthorized_error import UnauthorizedError
13
11
  from ..errors.unprocessable_entity_error import UnprocessableEntityError
14
- from ..types.data_frame_request_out import DataFrameRequestOut
15
- from .types.query_execute_request_database_asset_ids import QueryExecuteRequestDatabaseAssetIds
12
+ from ..errors.internal_server_error import InternalServerError
13
+ from json.decoder import JSONDecodeError
14
+ from ..core.api_error import ApiError
15
+ from ..core.client_wrapper import AsyncClientWrapper
16
16
 
17
17
 
18
18
  class QueryClient:
@@ -24,7 +24,7 @@ class QueryClient:
24
24
  *,
25
25
  sql_command: str,
26
26
  database_asset_ids: QueryExecuteRequestDatabaseAssetIds,
27
- request_options: typing.Optional[RequestOptions] = None
27
+ request_options: typing.Optional[RequestOptions] = None,
28
28
  ) -> DataFrameRequestOut:
29
29
  """
30
30
  Get the result of an SQL query over given assets.
@@ -47,7 +47,7 @@ class QueryClient:
47
47
 
48
48
  Examples
49
49
  --------
50
- from athena.client import Athena
50
+ from athena import Athena
51
51
 
52
52
  client = Athena(
53
53
  api_key="YOUR_API_KEY",
@@ -60,18 +60,53 @@ class QueryClient:
60
60
  _response = self._client_wrapper.httpx_client.request(
61
61
  "api/v0/query/sql/code/execute",
62
62
  method="GET",
63
- params={"sql_command": sql_command, "database_asset_ids": jsonable_encoder(database_asset_ids)},
63
+ params={
64
+ "sql_command": sql_command,
65
+ "database_asset_ids": convert_and_respect_annotation_metadata(
66
+ object_=database_asset_ids, annotation=QueryExecuteRequestDatabaseAssetIds, direction="write"
67
+ ),
68
+ },
64
69
  request_options=request_options,
65
70
  )
66
- if 200 <= _response.status_code < 300:
67
- return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
68
- if _response.status_code == 401:
69
- raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
70
- if _response.status_code == 422:
71
- raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
72
- if _response.status_code == 500:
73
- raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
74
71
  try:
72
+ if 200 <= _response.status_code < 300:
73
+ return typing.cast(
74
+ DataFrameRequestOut,
75
+ parse_obj_as(
76
+ type_=DataFrameRequestOut, # type: ignore
77
+ object_=_response.json(),
78
+ ),
79
+ )
80
+ if _response.status_code == 401:
81
+ raise UnauthorizedError(
82
+ typing.cast(
83
+ typing.Optional[typing.Any],
84
+ parse_obj_as(
85
+ type_=typing.Optional[typing.Any], # type: ignore
86
+ object_=_response.json(),
87
+ ),
88
+ )
89
+ )
90
+ if _response.status_code == 422:
91
+ raise UnprocessableEntityError(
92
+ typing.cast(
93
+ typing.Optional[typing.Any],
94
+ parse_obj_as(
95
+ type_=typing.Optional[typing.Any], # type: ignore
96
+ object_=_response.json(),
97
+ ),
98
+ )
99
+ )
100
+ if _response.status_code == 500:
101
+ raise InternalServerError(
102
+ typing.cast(
103
+ typing.Optional[typing.Any],
104
+ parse_obj_as(
105
+ type_=typing.Optional[typing.Any], # type: ignore
106
+ object_=_response.json(),
107
+ ),
108
+ )
109
+ )
75
110
  _response_json = _response.json()
76
111
  except JSONDecodeError:
77
112
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -97,7 +132,7 @@ class QueryClient:
97
132
 
98
133
  Examples
99
134
  --------
100
- from athena.client import Athena
135
+ from athena import Athena
101
136
 
102
137
  client = Athena(
103
138
  api_key="YOUR_API_KEY",
@@ -109,18 +144,50 @@ class QueryClient:
109
144
  _response = self._client_wrapper.httpx_client.request(
110
145
  "api/v0/query/sql/snippet/execute",
111
146
  method="GET",
112
- params={"snippet_asset_id": snippet_asset_id},
147
+ params={
148
+ "snippet_asset_id": snippet_asset_id,
149
+ },
113
150
  request_options=request_options,
114
151
  )
115
- if 200 <= _response.status_code < 300:
116
- return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
117
- if _response.status_code == 401:
118
- raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
119
- if _response.status_code == 422:
120
- raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
121
- if _response.status_code == 500:
122
- raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
123
152
  try:
153
+ if 200 <= _response.status_code < 300:
154
+ return typing.cast(
155
+ DataFrameRequestOut,
156
+ parse_obj_as(
157
+ type_=DataFrameRequestOut, # type: ignore
158
+ object_=_response.json(),
159
+ ),
160
+ )
161
+ if _response.status_code == 401:
162
+ raise UnauthorizedError(
163
+ typing.cast(
164
+ typing.Optional[typing.Any],
165
+ parse_obj_as(
166
+ type_=typing.Optional[typing.Any], # type: ignore
167
+ object_=_response.json(),
168
+ ),
169
+ )
170
+ )
171
+ if _response.status_code == 422:
172
+ raise UnprocessableEntityError(
173
+ typing.cast(
174
+ typing.Optional[typing.Any],
175
+ parse_obj_as(
176
+ type_=typing.Optional[typing.Any], # type: ignore
177
+ object_=_response.json(),
178
+ ),
179
+ )
180
+ )
181
+ if _response.status_code == 500:
182
+ raise InternalServerError(
183
+ typing.cast(
184
+ typing.Optional[typing.Any],
185
+ parse_obj_as(
186
+ type_=typing.Optional[typing.Any], # type: ignore
187
+ object_=_response.json(),
188
+ ),
189
+ )
190
+ )
124
191
  _response_json = _response.json()
125
192
  except JSONDecodeError:
126
193
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -136,7 +203,7 @@ class AsyncQueryClient:
136
203
  *,
137
204
  sql_command: str,
138
205
  database_asset_ids: QueryExecuteRequestDatabaseAssetIds,
139
- request_options: typing.Optional[RequestOptions] = None
206
+ request_options: typing.Optional[RequestOptions] = None,
140
207
  ) -> DataFrameRequestOut:
141
208
  """
142
209
  Get the result of an SQL query over given assets.
@@ -159,31 +226,74 @@ class AsyncQueryClient:
159
226
 
160
227
  Examples
161
228
  --------
162
- from athena.client import AsyncAthena
229
+ import asyncio
230
+
231
+ from athena import AsyncAthena
163
232
 
164
233
  client = AsyncAthena(
165
234
  api_key="YOUR_API_KEY",
166
235
  )
167
- await client.query.execute(
168
- sql_command="sql_command",
169
- database_asset_ids="database_asset_ids",
170
- )
236
+
237
+
238
+ async def main() -> None:
239
+ await client.query.execute(
240
+ sql_command="sql_command",
241
+ database_asset_ids="database_asset_ids",
242
+ )
243
+
244
+
245
+ asyncio.run(main())
171
246
  """
172
247
  _response = await self._client_wrapper.httpx_client.request(
173
248
  "api/v0/query/sql/code/execute",
174
249
  method="GET",
175
- params={"sql_command": sql_command, "database_asset_ids": jsonable_encoder(database_asset_ids)},
250
+ params={
251
+ "sql_command": sql_command,
252
+ "database_asset_ids": convert_and_respect_annotation_metadata(
253
+ object_=database_asset_ids, annotation=QueryExecuteRequestDatabaseAssetIds, direction="write"
254
+ ),
255
+ },
176
256
  request_options=request_options,
177
257
  )
178
- if 200 <= _response.status_code < 300:
179
- return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
180
- if _response.status_code == 401:
181
- raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
182
- if _response.status_code == 422:
183
- raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
184
- if _response.status_code == 500:
185
- raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
186
258
  try:
259
+ if 200 <= _response.status_code < 300:
260
+ return typing.cast(
261
+ DataFrameRequestOut,
262
+ parse_obj_as(
263
+ type_=DataFrameRequestOut, # type: ignore
264
+ object_=_response.json(),
265
+ ),
266
+ )
267
+ if _response.status_code == 401:
268
+ raise UnauthorizedError(
269
+ typing.cast(
270
+ typing.Optional[typing.Any],
271
+ parse_obj_as(
272
+ type_=typing.Optional[typing.Any], # type: ignore
273
+ object_=_response.json(),
274
+ ),
275
+ )
276
+ )
277
+ if _response.status_code == 422:
278
+ raise UnprocessableEntityError(
279
+ typing.cast(
280
+ typing.Optional[typing.Any],
281
+ parse_obj_as(
282
+ type_=typing.Optional[typing.Any], # type: ignore
283
+ object_=_response.json(),
284
+ ),
285
+ )
286
+ )
287
+ if _response.status_code == 500:
288
+ raise InternalServerError(
289
+ typing.cast(
290
+ typing.Optional[typing.Any],
291
+ parse_obj_as(
292
+ type_=typing.Optional[typing.Any], # type: ignore
293
+ object_=_response.json(),
294
+ ),
295
+ )
296
+ )
187
297
  _response_json = _response.json()
188
298
  except JSONDecodeError:
189
299
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -209,30 +319,70 @@ class AsyncQueryClient:
209
319
 
210
320
  Examples
211
321
  --------
212
- from athena.client import AsyncAthena
322
+ import asyncio
323
+
324
+ from athena import AsyncAthena
213
325
 
214
326
  client = AsyncAthena(
215
327
  api_key="YOUR_API_KEY",
216
328
  )
217
- await client.query.execute_snippet(
218
- snippet_asset_id="snippet_asset_id",
219
- )
329
+
330
+
331
+ async def main() -> None:
332
+ await client.query.execute_snippet(
333
+ snippet_asset_id="snippet_asset_id",
334
+ )
335
+
336
+
337
+ asyncio.run(main())
220
338
  """
221
339
  _response = await self._client_wrapper.httpx_client.request(
222
340
  "api/v0/query/sql/snippet/execute",
223
341
  method="GET",
224
- params={"snippet_asset_id": snippet_asset_id},
342
+ params={
343
+ "snippet_asset_id": snippet_asset_id,
344
+ },
225
345
  request_options=request_options,
226
346
  )
227
- if 200 <= _response.status_code < 300:
228
- return pydantic_v1.parse_obj_as(DataFrameRequestOut, _response.json()) # type: ignore
229
- if _response.status_code == 401:
230
- raise UnauthorizedError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
231
- if _response.status_code == 422:
232
- raise UnprocessableEntityError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
233
- if _response.status_code == 500:
234
- raise InternalServerError(pydantic_v1.parse_obj_as(typing.Any, _response.json())) # type: ignore
235
347
  try:
348
+ if 200 <= _response.status_code < 300:
349
+ return typing.cast(
350
+ DataFrameRequestOut,
351
+ parse_obj_as(
352
+ type_=DataFrameRequestOut, # type: ignore
353
+ object_=_response.json(),
354
+ ),
355
+ )
356
+ if _response.status_code == 401:
357
+ raise UnauthorizedError(
358
+ typing.cast(
359
+ typing.Optional[typing.Any],
360
+ parse_obj_as(
361
+ type_=typing.Optional[typing.Any], # type: ignore
362
+ object_=_response.json(),
363
+ ),
364
+ )
365
+ )
366
+ if _response.status_code == 422:
367
+ raise UnprocessableEntityError(
368
+ typing.cast(
369
+ typing.Optional[typing.Any],
370
+ parse_obj_as(
371
+ type_=typing.Optional[typing.Any], # type: ignore
372
+ object_=_response.json(),
373
+ ),
374
+ )
375
+ )
376
+ if _response.status_code == 500:
377
+ raise InternalServerError(
378
+ typing.cast(
379
+ typing.Optional[typing.Any],
380
+ parse_obj_as(
381
+ type_=typing.Optional[typing.Any], # type: ignore
382
+ object_=_response.json(),
383
+ ),
384
+ )
385
+ )
236
386
  _response_json = _response.json()
237
387
  except JSONDecodeError:
238
388
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -1,19 +1,19 @@
1
1
  # This file was auto-generated by Fern from our API Definition.
2
2
 
3
+ from ...core.client_wrapper import SyncClientWrapper
3
4
  import typing
5
+ from ...core.request_options import RequestOptions
6
+ from ...core.pydantic_utilities import parse_obj_as
4
7
  from json.decoder import JSONDecodeError
5
-
6
8
  from ...core.api_error import ApiError
7
- from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
8
- from ...core.pydantic_utilities import pydantic_v1
9
- from ...core.request_options import RequestOptions
9
+ from ...core.client_wrapper import AsyncClientWrapper
10
10
 
11
11
 
12
12
  class CalendarClient:
13
13
  def __init__(self, *, client_wrapper: SyncClientWrapper):
14
14
  self._client_wrapper = client_wrapper
15
15
 
16
- def list_events(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
16
+ def list_events(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]:
17
17
  """
18
18
  Coming soon! List calendar events with optional filtering.
19
19
 
@@ -24,12 +24,12 @@ class CalendarClient:
24
24
 
25
25
  Returns
26
26
  -------
27
- typing.Any
27
+ typing.Optional[typing.Any]
28
28
  Successful Response
29
29
 
30
30
  Examples
31
31
  --------
32
- from athena.client import Athena
32
+ from athena import Athena
33
33
 
34
34
  client = Athena(
35
35
  api_key="YOUR_API_KEY",
@@ -37,17 +37,25 @@ class CalendarClient:
37
37
  client.tools.calendar.list_events()
38
38
  """
39
39
  _response = self._client_wrapper.httpx_client.request(
40
- "api/v0/tools/calendar/events", method="GET", request_options=request_options
40
+ "api/v0/tools/calendar/events",
41
+ method="GET",
42
+ request_options=request_options,
41
43
  )
42
- if 200 <= _response.status_code < 300:
43
- return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
44
44
  try:
45
+ if 200 <= _response.status_code < 300:
46
+ return typing.cast(
47
+ typing.Optional[typing.Any],
48
+ parse_obj_as(
49
+ type_=typing.Optional[typing.Any], # type: ignore
50
+ object_=_response.json(),
51
+ ),
52
+ )
45
53
  _response_json = _response.json()
46
54
  except JSONDecodeError:
47
55
  raise ApiError(status_code=_response.status_code, body=_response.text)
48
56
  raise ApiError(status_code=_response.status_code, body=_response_json)
49
57
 
50
- def create_event(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
58
+ def create_event(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]:
51
59
  """
52
60
  Coming soon! Create new calendar events.
53
61
 
@@ -58,12 +66,12 @@ class CalendarClient:
58
66
 
59
67
  Returns
60
68
  -------
61
- typing.Any
69
+ typing.Optional[typing.Any]
62
70
  Successful Response
63
71
 
64
72
  Examples
65
73
  --------
66
- from athena.client import Athena
74
+ from athena import Athena
67
75
 
68
76
  client = Athena(
69
77
  api_key="YOUR_API_KEY",
@@ -71,11 +79,19 @@ class CalendarClient:
71
79
  client.tools.calendar.create_event()
72
80
  """
73
81
  _response = self._client_wrapper.httpx_client.request(
74
- "api/v0/tools/calendar/events", method="POST", request_options=request_options
82
+ "api/v0/tools/calendar/events",
83
+ method="POST",
84
+ request_options=request_options,
75
85
  )
76
- if 200 <= _response.status_code < 300:
77
- return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
78
86
  try:
87
+ if 200 <= _response.status_code < 300:
88
+ return typing.cast(
89
+ typing.Optional[typing.Any],
90
+ parse_obj_as(
91
+ type_=typing.Optional[typing.Any], # type: ignore
92
+ object_=_response.json(),
93
+ ),
94
+ )
79
95
  _response_json = _response.json()
80
96
  except JSONDecodeError:
81
97
  raise ApiError(status_code=_response.status_code, body=_response.text)
@@ -86,7 +102,9 @@ class AsyncCalendarClient:
86
102
  def __init__(self, *, client_wrapper: AsyncClientWrapper):
87
103
  self._client_wrapper = client_wrapper
88
104
 
89
- async def list_events(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
105
+ async def list_events(
106
+ self, *, request_options: typing.Optional[RequestOptions] = None
107
+ ) -> typing.Optional[typing.Any]:
90
108
  """
91
109
  Coming soon! List calendar events with optional filtering.
92
110
 
@@ -97,30 +115,48 @@ class AsyncCalendarClient:
97
115
 
98
116
  Returns
99
117
  -------
100
- typing.Any
118
+ typing.Optional[typing.Any]
101
119
  Successful Response
102
120
 
103
121
  Examples
104
122
  --------
105
- from athena.client import AsyncAthena
123
+ import asyncio
124
+
125
+ from athena import AsyncAthena
106
126
 
107
127
  client = AsyncAthena(
108
128
  api_key="YOUR_API_KEY",
109
129
  )
110
- await client.tools.calendar.list_events()
130
+
131
+
132
+ async def main() -> None:
133
+ await client.tools.calendar.list_events()
134
+
135
+
136
+ asyncio.run(main())
111
137
  """
112
138
  _response = await self._client_wrapper.httpx_client.request(
113
- "api/v0/tools/calendar/events", method="GET", request_options=request_options
139
+ "api/v0/tools/calendar/events",
140
+ method="GET",
141
+ request_options=request_options,
114
142
  )
115
- if 200 <= _response.status_code < 300:
116
- return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
117
143
  try:
144
+ if 200 <= _response.status_code < 300:
145
+ return typing.cast(
146
+ typing.Optional[typing.Any],
147
+ parse_obj_as(
148
+ type_=typing.Optional[typing.Any], # type: ignore
149
+ object_=_response.json(),
150
+ ),
151
+ )
118
152
  _response_json = _response.json()
119
153
  except JSONDecodeError:
120
154
  raise ApiError(status_code=_response.status_code, body=_response.text)
121
155
  raise ApiError(status_code=_response.status_code, body=_response_json)
122
156
 
123
- async def create_event(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Any:
157
+ async def create_event(
158
+ self, *, request_options: typing.Optional[RequestOptions] = None
159
+ ) -> typing.Optional[typing.Any]:
124
160
  """
125
161
  Coming soon! Create new calendar events.
126
162
 
@@ -131,24 +167,40 @@ class AsyncCalendarClient:
131
167
 
132
168
  Returns
133
169
  -------
134
- typing.Any
170
+ typing.Optional[typing.Any]
135
171
  Successful Response
136
172
 
137
173
  Examples
138
174
  --------
139
- from athena.client import AsyncAthena
175
+ import asyncio
176
+
177
+ from athena import AsyncAthena
140
178
 
141
179
  client = AsyncAthena(
142
180
  api_key="YOUR_API_KEY",
143
181
  )
144
- await client.tools.calendar.create_event()
182
+
183
+
184
+ async def main() -> None:
185
+ await client.tools.calendar.create_event()
186
+
187
+
188
+ asyncio.run(main())
145
189
  """
146
190
  _response = await self._client_wrapper.httpx_client.request(
147
- "api/v0/tools/calendar/events", method="POST", request_options=request_options
191
+ "api/v0/tools/calendar/events",
192
+ method="POST",
193
+ request_options=request_options,
148
194
  )
149
- if 200 <= _response.status_code < 300:
150
- return pydantic_v1.parse_obj_as(typing.Any, _response.json()) # type: ignore
151
195
  try:
196
+ if 200 <= _response.status_code < 300:
197
+ return typing.cast(
198
+ typing.Optional[typing.Any],
199
+ parse_obj_as(
200
+ type_=typing.Optional[typing.Any], # type: ignore
201
+ object_=_response.json(),
202
+ ),
203
+ )
152
204
  _response_json = _response.json()
153
205
  except JSONDecodeError:
154
206
  raise ApiError(status_code=_response.status_code, body=_response.text)