athena-intelligence 0.1.127__py3-none-any.whl → 0.1.184__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.
- athena/__init__.py +24 -3
- athena/agents/__init__.py +2 -0
- athena/agents/client.py +51 -95
- athena/agents/drive/__init__.py +2 -0
- athena/agents/drive/client.py +31 -80
- athena/agents/drive/raw_client.py +155 -0
- athena/agents/general/__init__.py +2 -0
- athena/agents/general/client.py +91 -238
- athena/agents/general/raw_client.py +369 -0
- athena/agents/raw_client.py +176 -0
- athena/agents/research/__init__.py +2 -0
- athena/agents/research/client.py +31 -80
- athena/agents/research/raw_client.py +155 -0
- athena/agents/sql/__init__.py +2 -0
- athena/agents/sql/client.py +31 -80
- athena/agents/sql/raw_client.py +155 -0
- athena/assets/__init__.py +4 -0
- athena/assets/client.py +144 -0
- athena/assets/raw_client.py +164 -0
- athena/base_client.py +25 -11
- athena/client.py +1 -1
- athena/core/__init__.py +5 -0
- athena/core/api_error.py +13 -5
- athena/core/client_wrapper.py +33 -8
- athena/core/force_multipart.py +16 -0
- athena/core/http_client.py +70 -26
- athena/core/http_response.py +55 -0
- athena/core/jsonable_encoder.py +0 -1
- athena/core/pydantic_utilities.py +70 -111
- athena/core/serialization.py +7 -3
- athena/errors/__init__.py +2 -0
- athena/errors/bad_request_error.py +4 -2
- athena/errors/content_too_large_error.py +4 -2
- athena/errors/internal_server_error.py +4 -3
- athena/errors/not_found_error.py +4 -2
- athena/errors/unauthorized_error.py +4 -3
- athena/errors/unprocessable_entity_error.py +4 -3
- athena/errors/unsupported_media_type_error.py +4 -2
- athena/query/__init__.py +2 -0
- athena/query/client.py +39 -219
- athena/query/raw_client.py +344 -0
- athena/query/types/__init__.py +2 -0
- athena/tools/__init__.py +2 -0
- athena/tools/calendar/__init__.py +2 -0
- athena/tools/calendar/client.py +35 -79
- athena/tools/calendar/raw_client.py +172 -0
- athena/tools/client.py +114 -876
- athena/tools/email/__init__.py +2 -0
- athena/tools/email/client.py +39 -115
- athena/tools/email/raw_client.py +248 -0
- athena/tools/raw_client.py +1328 -0
- athena/tools/structured_data_extractor/__init__.py +2 -0
- athena/tools/structured_data_extractor/client.py +42 -96
- athena/tools/structured_data_extractor/raw_client.py +240 -0
- athena/tools/tasks/__init__.py +2 -0
- athena/tools/tasks/client.py +31 -43
- athena/tools/tasks/raw_client.py +96 -0
- athena/tools/types/__init__.py +2 -0
- athena/types/__init__.py +24 -2
- athena/types/asset_content_request_out.py +3 -3
- athena/types/asset_node.py +3 -3
- athena/types/asset_not_found_error.py +2 -2
- athena/types/asset_screenshot_response_out.py +4 -4
- athena/types/chunk.py +3 -3
- athena/types/chunk_content_item.py +3 -2
- athena/types/chunk_result.py +3 -3
- athena/types/content.py +7 -0
- athena/types/custom_agent_response.py +2 -2
- athena/types/data_frame_request_out.py +3 -3
- athena/types/data_frame_unknown_format_error.py +2 -2
- athena/types/document_chunk.py +2 -2
- athena/types/drive_agent_response.py +2 -2
- athena/types/file_chunk_request_out.py +3 -3
- athena/types/file_too_large_error.py +2 -2
- athena/types/folder_response.py +10 -4
- athena/types/general_agent_config.py +3 -3
- athena/types/general_agent_config_enabled_tools_item.py +1 -2
- athena/types/general_agent_request.py +15 -4
- athena/types/general_agent_response.py +4 -3
- athena/types/general_agent_response_message.py +100 -0
- athena/types/general_agent_response_message_kwargs.py +74 -0
- athena/types/{tool.py → id.py} +1 -1
- athena/types/image_url_content.py +2 -2
- athena/types/input_message.py +29 -0
- athena/types/input_message_content_item.py +39 -0
- athena/types/paginated_assets_out.py +52 -0
- athena/types/parent_folder_error.py +2 -2
- athena/types/prompt_message.py +3 -3
- athena/types/public_asset_out.py +97 -0
- athena/types/research_agent_response.py +2 -2
- athena/types/save_asset_request_out.py +2 -2
- athena/types/sql_agent_response.py +2 -2
- athena/types/structured_data_extractor_response.py +3 -3
- athena/types/text_content.py +2 -2
- athena/types/type.py +1 -1
- {athena_intelligence-0.1.127.dist-info → athena_intelligence-0.1.184.dist-info}/METADATA +3 -7
- athena_intelligence-0.1.184.dist-info/RECORD +112 -0
- {athena_intelligence-0.1.127.dist-info → athena_intelligence-0.1.184.dist-info}/WHEEL +1 -1
- athena_intelligence-0.1.127.dist-info/RECORD +0 -89
athena/tools/email/__init__.py
CHANGED
athena/tools/email/client.py
CHANGED
@@ -1,17 +1,26 @@
|
|
1
1
|
# This file was auto-generated by Fern from our API Definition.
|
2
2
|
|
3
|
-
from ...core.client_wrapper import SyncClientWrapper
|
4
3
|
import typing
|
4
|
+
|
5
|
+
from ...core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
|
5
6
|
from ...core.request_options import RequestOptions
|
6
|
-
from
|
7
|
-
from json.decoder import JSONDecodeError
|
8
|
-
from ...core.api_error import ApiError
|
9
|
-
from ...core.client_wrapper import AsyncClientWrapper
|
7
|
+
from .raw_client import AsyncRawEmailClient, RawEmailClient
|
10
8
|
|
11
9
|
|
12
10
|
class EmailClient:
|
13
11
|
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
14
|
-
self.
|
12
|
+
self._raw_client = RawEmailClient(client_wrapper=client_wrapper)
|
13
|
+
|
14
|
+
@property
|
15
|
+
def with_raw_response(self) -> RawEmailClient:
|
16
|
+
"""
|
17
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
18
|
+
|
19
|
+
Returns
|
20
|
+
-------
|
21
|
+
RawEmailClient
|
22
|
+
"""
|
23
|
+
return self._raw_client
|
15
24
|
|
16
25
|
def create_draft(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]:
|
17
26
|
"""
|
@@ -36,24 +45,8 @@ class EmailClient:
|
|
36
45
|
)
|
37
46
|
client.tools.email.create_draft()
|
38
47
|
"""
|
39
|
-
_response = self.
|
40
|
-
|
41
|
-
method="POST",
|
42
|
-
request_options=request_options,
|
43
|
-
)
|
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
|
-
)
|
53
|
-
_response_json = _response.json()
|
54
|
-
except JSONDecodeError:
|
55
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
56
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
48
|
+
_response = self._raw_client.create_draft(request_options=request_options)
|
49
|
+
return _response.data
|
57
50
|
|
58
51
|
def search(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]:
|
59
52
|
"""
|
@@ -78,24 +71,8 @@ class EmailClient:
|
|
78
71
|
)
|
79
72
|
client.tools.email.search()
|
80
73
|
"""
|
81
|
-
_response = self.
|
82
|
-
|
83
|
-
method="GET",
|
84
|
-
request_options=request_options,
|
85
|
-
)
|
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
|
-
)
|
95
|
-
_response_json = _response.json()
|
96
|
-
except JSONDecodeError:
|
97
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
98
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
74
|
+
_response = self._raw_client.search(request_options=request_options)
|
75
|
+
return _response.data
|
99
76
|
|
100
77
|
def send(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]:
|
101
78
|
"""
|
@@ -120,29 +97,24 @@ class EmailClient:
|
|
120
97
|
)
|
121
98
|
client.tools.email.send()
|
122
99
|
"""
|
123
|
-
_response = self.
|
124
|
-
|
125
|
-
method="POST",
|
126
|
-
request_options=request_options,
|
127
|
-
)
|
128
|
-
try:
|
129
|
-
if 200 <= _response.status_code < 300:
|
130
|
-
return typing.cast(
|
131
|
-
typing.Optional[typing.Any],
|
132
|
-
parse_obj_as(
|
133
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
134
|
-
object_=_response.json(),
|
135
|
-
),
|
136
|
-
)
|
137
|
-
_response_json = _response.json()
|
138
|
-
except JSONDecodeError:
|
139
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
140
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
100
|
+
_response = self._raw_client.send(request_options=request_options)
|
101
|
+
return _response.data
|
141
102
|
|
142
103
|
|
143
104
|
class AsyncEmailClient:
|
144
105
|
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
145
|
-
self.
|
106
|
+
self._raw_client = AsyncRawEmailClient(client_wrapper=client_wrapper)
|
107
|
+
|
108
|
+
@property
|
109
|
+
def with_raw_response(self) -> AsyncRawEmailClient:
|
110
|
+
"""
|
111
|
+
Retrieves a raw implementation of this client that returns raw responses.
|
112
|
+
|
113
|
+
Returns
|
114
|
+
-------
|
115
|
+
AsyncRawEmailClient
|
116
|
+
"""
|
117
|
+
return self._raw_client
|
146
118
|
|
147
119
|
async def create_draft(
|
148
120
|
self, *, request_options: typing.Optional[RequestOptions] = None
|
@@ -177,24 +149,8 @@ class AsyncEmailClient:
|
|
177
149
|
|
178
150
|
asyncio.run(main())
|
179
151
|
"""
|
180
|
-
_response = await self.
|
181
|
-
|
182
|
-
method="POST",
|
183
|
-
request_options=request_options,
|
184
|
-
)
|
185
|
-
try:
|
186
|
-
if 200 <= _response.status_code < 300:
|
187
|
-
return typing.cast(
|
188
|
-
typing.Optional[typing.Any],
|
189
|
-
parse_obj_as(
|
190
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
191
|
-
object_=_response.json(),
|
192
|
-
),
|
193
|
-
)
|
194
|
-
_response_json = _response.json()
|
195
|
-
except JSONDecodeError:
|
196
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
197
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
152
|
+
_response = await self._raw_client.create_draft(request_options=request_options)
|
153
|
+
return _response.data
|
198
154
|
|
199
155
|
async def search(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]:
|
200
156
|
"""
|
@@ -227,24 +183,8 @@ class AsyncEmailClient:
|
|
227
183
|
|
228
184
|
asyncio.run(main())
|
229
185
|
"""
|
230
|
-
_response = await self.
|
231
|
-
|
232
|
-
method="GET",
|
233
|
-
request_options=request_options,
|
234
|
-
)
|
235
|
-
try:
|
236
|
-
if 200 <= _response.status_code < 300:
|
237
|
-
return typing.cast(
|
238
|
-
typing.Optional[typing.Any],
|
239
|
-
parse_obj_as(
|
240
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
241
|
-
object_=_response.json(),
|
242
|
-
),
|
243
|
-
)
|
244
|
-
_response_json = _response.json()
|
245
|
-
except JSONDecodeError:
|
246
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
247
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
186
|
+
_response = await self._raw_client.search(request_options=request_options)
|
187
|
+
return _response.data
|
248
188
|
|
249
189
|
async def send(self, *, request_options: typing.Optional[RequestOptions] = None) -> typing.Optional[typing.Any]:
|
250
190
|
"""
|
@@ -277,21 +217,5 @@ class AsyncEmailClient:
|
|
277
217
|
|
278
218
|
asyncio.run(main())
|
279
219
|
"""
|
280
|
-
_response = await self.
|
281
|
-
|
282
|
-
method="POST",
|
283
|
-
request_options=request_options,
|
284
|
-
)
|
285
|
-
try:
|
286
|
-
if 200 <= _response.status_code < 300:
|
287
|
-
return typing.cast(
|
288
|
-
typing.Optional[typing.Any],
|
289
|
-
parse_obj_as(
|
290
|
-
type_=typing.Optional[typing.Any], # type: ignore
|
291
|
-
object_=_response.json(),
|
292
|
-
),
|
293
|
-
)
|
294
|
-
_response_json = _response.json()
|
295
|
-
except JSONDecodeError:
|
296
|
-
raise ApiError(status_code=_response.status_code, body=_response.text)
|
297
|
-
raise ApiError(status_code=_response.status_code, body=_response_json)
|
220
|
+
_response = await self._raw_client.send(request_options=request_options)
|
221
|
+
return _response.data
|
@@ -0,0 +1,248 @@
|
|
1
|
+
# This file was auto-generated by Fern from our API Definition.
|
2
|
+
|
3
|
+
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.http_response import AsyncHttpResponse, HttpResponse
|
9
|
+
from ...core.pydantic_utilities import parse_obj_as
|
10
|
+
from ...core.request_options import RequestOptions
|
11
|
+
|
12
|
+
|
13
|
+
class RawEmailClient:
|
14
|
+
def __init__(self, *, client_wrapper: SyncClientWrapper):
|
15
|
+
self._client_wrapper = client_wrapper
|
16
|
+
|
17
|
+
def create_draft(
|
18
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
19
|
+
) -> HttpResponse[typing.Optional[typing.Any]]:
|
20
|
+
"""
|
21
|
+
Coming soon! Create email drafts with specified content and recipients.
|
22
|
+
|
23
|
+
Parameters
|
24
|
+
----------
|
25
|
+
request_options : typing.Optional[RequestOptions]
|
26
|
+
Request-specific configuration.
|
27
|
+
|
28
|
+
Returns
|
29
|
+
-------
|
30
|
+
HttpResponse[typing.Optional[typing.Any]]
|
31
|
+
Successful Response
|
32
|
+
"""
|
33
|
+
_response = self._client_wrapper.httpx_client.request(
|
34
|
+
"api/v0/tools/email/draft",
|
35
|
+
method="POST",
|
36
|
+
request_options=request_options,
|
37
|
+
)
|
38
|
+
try:
|
39
|
+
if _response is None or not _response.text.strip():
|
40
|
+
return HttpResponse(response=_response, data=None)
|
41
|
+
if 200 <= _response.status_code < 300:
|
42
|
+
_data = typing.cast(
|
43
|
+
typing.Optional[typing.Any],
|
44
|
+
parse_obj_as(
|
45
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
46
|
+
object_=_response.json(),
|
47
|
+
),
|
48
|
+
)
|
49
|
+
return HttpResponse(response=_response, data=_data)
|
50
|
+
_response_json = _response.json()
|
51
|
+
except JSONDecodeError:
|
52
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
53
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
54
|
+
|
55
|
+
def search(
|
56
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
57
|
+
) -> HttpResponse[typing.Optional[typing.Any]]:
|
58
|
+
"""
|
59
|
+
Coming soon! Search through emails with configurable filters.
|
60
|
+
|
61
|
+
Parameters
|
62
|
+
----------
|
63
|
+
request_options : typing.Optional[RequestOptions]
|
64
|
+
Request-specific configuration.
|
65
|
+
|
66
|
+
Returns
|
67
|
+
-------
|
68
|
+
HttpResponse[typing.Optional[typing.Any]]
|
69
|
+
Successful Response
|
70
|
+
"""
|
71
|
+
_response = self._client_wrapper.httpx_client.request(
|
72
|
+
"api/v0/tools/email/search",
|
73
|
+
method="GET",
|
74
|
+
request_options=request_options,
|
75
|
+
)
|
76
|
+
try:
|
77
|
+
if _response is None or not _response.text.strip():
|
78
|
+
return HttpResponse(response=_response, data=None)
|
79
|
+
if 200 <= _response.status_code < 300:
|
80
|
+
_data = typing.cast(
|
81
|
+
typing.Optional[typing.Any],
|
82
|
+
parse_obj_as(
|
83
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
84
|
+
object_=_response.json(),
|
85
|
+
),
|
86
|
+
)
|
87
|
+
return HttpResponse(response=_response, data=_data)
|
88
|
+
_response_json = _response.json()
|
89
|
+
except JSONDecodeError:
|
90
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
91
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
92
|
+
|
93
|
+
def send(
|
94
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
95
|
+
) -> HttpResponse[typing.Optional[typing.Any]]:
|
96
|
+
"""
|
97
|
+
Coming soon! Send emails to specified recipients.
|
98
|
+
|
99
|
+
Parameters
|
100
|
+
----------
|
101
|
+
request_options : typing.Optional[RequestOptions]
|
102
|
+
Request-specific configuration.
|
103
|
+
|
104
|
+
Returns
|
105
|
+
-------
|
106
|
+
HttpResponse[typing.Optional[typing.Any]]
|
107
|
+
Successful Response
|
108
|
+
"""
|
109
|
+
_response = self._client_wrapper.httpx_client.request(
|
110
|
+
"api/v0/tools/email/send",
|
111
|
+
method="POST",
|
112
|
+
request_options=request_options,
|
113
|
+
)
|
114
|
+
try:
|
115
|
+
if _response is None or not _response.text.strip():
|
116
|
+
return HttpResponse(response=_response, data=None)
|
117
|
+
if 200 <= _response.status_code < 300:
|
118
|
+
_data = typing.cast(
|
119
|
+
typing.Optional[typing.Any],
|
120
|
+
parse_obj_as(
|
121
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
122
|
+
object_=_response.json(),
|
123
|
+
),
|
124
|
+
)
|
125
|
+
return HttpResponse(response=_response, data=_data)
|
126
|
+
_response_json = _response.json()
|
127
|
+
except JSONDecodeError:
|
128
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
129
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
130
|
+
|
131
|
+
|
132
|
+
class AsyncRawEmailClient:
|
133
|
+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
|
134
|
+
self._client_wrapper = client_wrapper
|
135
|
+
|
136
|
+
async def create_draft(
|
137
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
138
|
+
) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
|
139
|
+
"""
|
140
|
+
Coming soon! Create email drafts with specified content and recipients.
|
141
|
+
|
142
|
+
Parameters
|
143
|
+
----------
|
144
|
+
request_options : typing.Optional[RequestOptions]
|
145
|
+
Request-specific configuration.
|
146
|
+
|
147
|
+
Returns
|
148
|
+
-------
|
149
|
+
AsyncHttpResponse[typing.Optional[typing.Any]]
|
150
|
+
Successful Response
|
151
|
+
"""
|
152
|
+
_response = await self._client_wrapper.httpx_client.request(
|
153
|
+
"api/v0/tools/email/draft",
|
154
|
+
method="POST",
|
155
|
+
request_options=request_options,
|
156
|
+
)
|
157
|
+
try:
|
158
|
+
if _response is None or not _response.text.strip():
|
159
|
+
return AsyncHttpResponse(response=_response, data=None)
|
160
|
+
if 200 <= _response.status_code < 300:
|
161
|
+
_data = typing.cast(
|
162
|
+
typing.Optional[typing.Any],
|
163
|
+
parse_obj_as(
|
164
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
165
|
+
object_=_response.json(),
|
166
|
+
),
|
167
|
+
)
|
168
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
169
|
+
_response_json = _response.json()
|
170
|
+
except JSONDecodeError:
|
171
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
172
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
173
|
+
|
174
|
+
async def search(
|
175
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
176
|
+
) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
|
177
|
+
"""
|
178
|
+
Coming soon! Search through emails with configurable filters.
|
179
|
+
|
180
|
+
Parameters
|
181
|
+
----------
|
182
|
+
request_options : typing.Optional[RequestOptions]
|
183
|
+
Request-specific configuration.
|
184
|
+
|
185
|
+
Returns
|
186
|
+
-------
|
187
|
+
AsyncHttpResponse[typing.Optional[typing.Any]]
|
188
|
+
Successful Response
|
189
|
+
"""
|
190
|
+
_response = await self._client_wrapper.httpx_client.request(
|
191
|
+
"api/v0/tools/email/search",
|
192
|
+
method="GET",
|
193
|
+
request_options=request_options,
|
194
|
+
)
|
195
|
+
try:
|
196
|
+
if _response is None or not _response.text.strip():
|
197
|
+
return AsyncHttpResponse(response=_response, data=None)
|
198
|
+
if 200 <= _response.status_code < 300:
|
199
|
+
_data = typing.cast(
|
200
|
+
typing.Optional[typing.Any],
|
201
|
+
parse_obj_as(
|
202
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
203
|
+
object_=_response.json(),
|
204
|
+
),
|
205
|
+
)
|
206
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
207
|
+
_response_json = _response.json()
|
208
|
+
except JSONDecodeError:
|
209
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
210
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|
211
|
+
|
212
|
+
async def send(
|
213
|
+
self, *, request_options: typing.Optional[RequestOptions] = None
|
214
|
+
) -> AsyncHttpResponse[typing.Optional[typing.Any]]:
|
215
|
+
"""
|
216
|
+
Coming soon! Send emails to specified recipients.
|
217
|
+
|
218
|
+
Parameters
|
219
|
+
----------
|
220
|
+
request_options : typing.Optional[RequestOptions]
|
221
|
+
Request-specific configuration.
|
222
|
+
|
223
|
+
Returns
|
224
|
+
-------
|
225
|
+
AsyncHttpResponse[typing.Optional[typing.Any]]
|
226
|
+
Successful Response
|
227
|
+
"""
|
228
|
+
_response = await self._client_wrapper.httpx_client.request(
|
229
|
+
"api/v0/tools/email/send",
|
230
|
+
method="POST",
|
231
|
+
request_options=request_options,
|
232
|
+
)
|
233
|
+
try:
|
234
|
+
if _response is None or not _response.text.strip():
|
235
|
+
return AsyncHttpResponse(response=_response, data=None)
|
236
|
+
if 200 <= _response.status_code < 300:
|
237
|
+
_data = typing.cast(
|
238
|
+
typing.Optional[typing.Any],
|
239
|
+
parse_obj_as(
|
240
|
+
type_=typing.Optional[typing.Any], # type: ignore
|
241
|
+
object_=_response.json(),
|
242
|
+
),
|
243
|
+
)
|
244
|
+
return AsyncHttpResponse(response=_response, data=_data)
|
245
|
+
_response_json = _response.json()
|
246
|
+
except JSONDecodeError:
|
247
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)
|
248
|
+
raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response_json)
|