Skip to content

Commit 5792e1d

Browse files
committed
Release 0.0.22
1 parent 3c310b7 commit 5792e1d

File tree

12 files changed

+373
-16
lines changed

12 files changed

+373
-16
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name = "agentmail"
33

44
[tool.poetry]
55
name = "agentmail"
6-
version = "0.0.21"
6+
version = "0.0.22"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

Lines changed: 77 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,73 @@ client.inboxes.drafts.create(inbox_id='inbox_id', )
534534
</dl>
535535

536536

537+
</dd>
538+
</dl>
539+
</details>
540+
541+
<details><summary><code>client.inboxes.drafts.<a href="src/agentmail/inboxes/drafts/client.py">send</a>(...)</code></summary>
542+
<dl>
543+
<dd>
544+
545+
#### 🔌 Usage
546+
547+
<dl>
548+
<dd>
549+
550+
<dl>
551+
<dd>
552+
553+
```python
554+
from agentmail import AgentMail
555+
client = AgentMail(api_key="YOUR_API_KEY", )
556+
client.inboxes.drafts.send(inbox_id='inbox_id', draft_id='draft_id', )
557+
558+
```
559+
</dd>
560+
</dl>
561+
</dd>
562+
</dl>
563+
564+
#### ⚙️ Parameters
565+
566+
<dl>
567+
<dd>
568+
569+
<dl>
570+
<dd>
571+
572+
**inbox_id:** `InboxId`
573+
574+
</dd>
575+
</dl>
576+
577+
<dl>
578+
<dd>
579+
580+
**draft_id:** `DraftId`
581+
582+
</dd>
583+
</dl>
584+
585+
<dl>
586+
<dd>
587+
588+
**labels:** `typing.Optional[DraftLabels]`
589+
590+
</dd>
591+
</dl>
592+
593+
<dl>
594+
<dd>
595+
596+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
597+
598+
</dd>
599+
</dl>
600+
</dd>
601+
</dl>
602+
603+
537604
</dd>
538605
</dl>
539606
</details>
@@ -688,7 +755,7 @@ client.inboxes.messages.get(inbox_id='inbox_id', message_id='message_id', )
688755
```python
689756
from agentmail import AgentMail
690757
client = AgentMail(api_key="YOUR_API_KEY", )
691-
client.inboxes.messages.send(inbox_id='inbox_id', to='to', )
758+
client.inboxes.messages.send(inbox_id='inbox_id', )
692759

693760
```
694761
</dd>
@@ -712,7 +779,15 @@ client.inboxes.messages.send(inbox_id='inbox_id', to='to', )
712779
<dl>
713780
<dd>
714781

715-
**to:** `SendMessageTo`
782+
**labels:** `typing.Optional[MessageLabels]`
783+
784+
</dd>
785+
</dl>
786+
787+
<dl>
788+
<dd>
789+
790+
**to:** `typing.Optional[SendMessageTo]`
716791

717792
</dd>
718793
</dl>

src/agentmail/core/client_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ def __init__(
2020

2121
def get_headers(self) -> typing.Dict[str, str]:
2222
headers: typing.Dict[str, str] = {
23-
"User-Agent": "agentmail/0.0.21",
23+
"User-Agent": "agentmail/0.0.22",
2424
"X-Fern-Language": "Python",
2525
"X-Fern-SDK-Name": "agentmail",
26-
"X-Fern-SDK-Version": "0.0.21",
26+
"X-Fern-SDK-Version": "0.0.22",
2727
}
2828
headers["Authorization"] = f"Bearer {self._get_api_key()}"
2929
return headers

src/agentmail/inboxes/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
DraftTo,
2525
DraftUpdatedAt,
2626
ListDraftsResponse,
27+
SendDraftRequest,
2728
)
2829
from .messages import (
2930
Addresses,
@@ -134,6 +135,7 @@
134135
"MessageTo",
135136
"ReplyToMessageRequest",
136137
"SendAttachment",
138+
"SendDraftRequest",
137139
"SendMessageAttachments",
138140
"SendMessageBcc",
139141
"SendMessageCc",

src/agentmail/inboxes/drafts/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
DraftTo,
2323
DraftUpdatedAt,
2424
ListDraftsResponse,
25+
SendDraftRequest,
2526
)
2627

2728
__all__ = [
@@ -44,4 +45,5 @@
4445
"DraftTo",
4546
"DraftUpdatedAt",
4647
"ListDraftsResponse",
48+
"SendDraftRequest",
4749
]

src/agentmail/inboxes/drafts/client.py

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
from ...types.labels import Labels
88
from ...types.last_key import LastKey
99
from ...types.limit import Limit
10+
from ..messages.types.send_message_response import SendMessageResponse
1011
from ..types.inbox_id import InboxId
1112
from .raw_client import AsyncRawDraftsClient, RawDraftsClient
1213
from .types.draft import Draft
@@ -161,6 +162,39 @@ def create(
161162
)
162163
return _response.data
163164

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+
164198

165199
class AsyncDraftsClient:
166200
def __init__(self, *, client_wrapper: AsyncClientWrapper):
@@ -307,3 +341,39 @@ async def main() -> None:
307341
request_options=request_options,
308342
)
309343
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

Comments
 (0)