|
7 | 7 | from ...types.labels import Labels |
8 | 8 | from ...types.last_key import LastKey |
9 | 9 | from ...types.limit import Limit |
| 10 | +from ..messages.types.send_message_response import SendMessageResponse |
10 | 11 | from ..types.inbox_id import InboxId |
11 | 12 | from .raw_client import AsyncRawDraftsClient, RawDraftsClient |
12 | 13 | from .types.draft import Draft |
@@ -161,6 +162,39 @@ def create( |
161 | 162 | ) |
162 | 163 | return _response.data |
163 | 164 |
|
| 165 | + def send( |
| 166 | + self, |
| 167 | + inbox_id: InboxId, |
| 168 | + draft_id: DraftId, |
| 169 | + *, |
| 170 | + labels: typing.Optional[DraftLabels] = OMIT, |
| 171 | + request_options: typing.Optional[RequestOptions] = None, |
| 172 | + ) -> SendMessageResponse: |
| 173 | + """ |
| 174 | + Parameters |
| 175 | + ---------- |
| 176 | + inbox_id : InboxId |
| 177 | +
|
| 178 | + draft_id : DraftId |
| 179 | +
|
| 180 | + labels : typing.Optional[DraftLabels] |
| 181 | +
|
| 182 | + request_options : typing.Optional[RequestOptions] |
| 183 | + Request-specific configuration. |
| 184 | +
|
| 185 | + Returns |
| 186 | + ------- |
| 187 | + SendMessageResponse |
| 188 | +
|
| 189 | + Examples |
| 190 | + -------- |
| 191 | + from agentmail import AgentMail |
| 192 | + client = AgentMail(api_key="YOUR_API_KEY", ) |
| 193 | + client.inboxes.drafts.send(inbox_id='inbox_id', draft_id='draft_id', ) |
| 194 | + """ |
| 195 | + _response = self._raw_client.send(inbox_id, draft_id, labels=labels, request_options=request_options) |
| 196 | + return _response.data |
| 197 | + |
164 | 198 |
|
165 | 199 | class AsyncDraftsClient: |
166 | 200 | def __init__(self, *, client_wrapper: AsyncClientWrapper): |
@@ -307,3 +341,39 @@ async def main() -> None: |
307 | 341 | request_options=request_options, |
308 | 342 | ) |
309 | 343 | return _response.data |
| 344 | + |
| 345 | + async def send( |
| 346 | + self, |
| 347 | + inbox_id: InboxId, |
| 348 | + draft_id: DraftId, |
| 349 | + *, |
| 350 | + labels: typing.Optional[DraftLabels] = OMIT, |
| 351 | + request_options: typing.Optional[RequestOptions] = None, |
| 352 | + ) -> SendMessageResponse: |
| 353 | + """ |
| 354 | + Parameters |
| 355 | + ---------- |
| 356 | + inbox_id : InboxId |
| 357 | +
|
| 358 | + draft_id : DraftId |
| 359 | +
|
| 360 | + labels : typing.Optional[DraftLabels] |
| 361 | +
|
| 362 | + request_options : typing.Optional[RequestOptions] |
| 363 | + Request-specific configuration. |
| 364 | +
|
| 365 | + Returns |
| 366 | + ------- |
| 367 | + SendMessageResponse |
| 368 | +
|
| 369 | + Examples |
| 370 | + -------- |
| 371 | + from agentmail import AsyncAgentMail |
| 372 | + import asyncio |
| 373 | + client = AsyncAgentMail(api_key="YOUR_API_KEY", ) |
| 374 | + async def main() -> None: |
| 375 | + await client.inboxes.drafts.send(inbox_id='inbox_id', draft_id='draft_id', ) |
| 376 | + asyncio.run(main()) |
| 377 | + """ |
| 378 | + _response = await self._raw_client.send(inbox_id, draft_id, labels=labels, request_options=request_options) |
| 379 | + return _response.data |
0 commit comments