Skip to content

Commit 320cf7f

Browse files
committed
Release 0.0.46
1 parent 61c6c30 commit 320cf7f

33 files changed

Lines changed: 1082 additions & 15 deletions

poetry.lock

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

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.45"
6+
version = "0.0.46"
77
description = ""
88
readme = "README.md"
99
authors = []

reference.md

Lines changed: 177 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1088,6 +1088,14 @@ client.inboxes.drafts.create(
10881088
<dl>
10891089
<dd>
10901090

1091+
**send_at:** `typing.Optional[DraftSendAt]`
1092+
1093+
</dd>
1094+
</dl>
1095+
1096+
<dl>
1097+
<dd>
1098+
10911099
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
10921100

10931101
</dd>
@@ -1669,6 +1677,95 @@ client.inboxes.messages.update(
16691677
</dl>
16701678

16711679

1680+
</dd>
1681+
</dl>
1682+
</details>
1683+
1684+
## Inboxes Metrics
1685+
<details><summary><code>client.inboxes.metrics.<a href="src/agentmail/inboxes/metrics/client.py">get</a>(...)</code></summary>
1686+
<dl>
1687+
<dd>
1688+
1689+
#### 🔌 Usage
1690+
1691+
<dl>
1692+
<dd>
1693+
1694+
<dl>
1695+
<dd>
1696+
1697+
```python
1698+
import datetime
1699+
1700+
from agentmail import AgentMail
1701+
1702+
client = AgentMail(
1703+
api_key="YOUR_API_KEY",
1704+
)
1705+
client.inboxes.metrics.get(
1706+
inbox_id="inbox_id",
1707+
start_timestamp=datetime.datetime.fromisoformat(
1708+
"2024-01-15 09:30:00+00:00",
1709+
),
1710+
end_timestamp=datetime.datetime.fromisoformat(
1711+
"2024-01-15 09:30:00+00:00",
1712+
),
1713+
)
1714+
1715+
```
1716+
</dd>
1717+
</dl>
1718+
</dd>
1719+
</dl>
1720+
1721+
#### ⚙️ Parameters
1722+
1723+
<dl>
1724+
<dd>
1725+
1726+
<dl>
1727+
<dd>
1728+
1729+
**inbox_id:** `InboxId`
1730+
1731+
</dd>
1732+
</dl>
1733+
1734+
<dl>
1735+
<dd>
1736+
1737+
**start_timestamp:** `MetricStartTimestamp`
1738+
1739+
</dd>
1740+
</dl>
1741+
1742+
<dl>
1743+
<dd>
1744+
1745+
**end_timestamp:** `MetricEndTimestamp`
1746+
1747+
</dd>
1748+
</dl>
1749+
1750+
<dl>
1751+
<dd>
1752+
1753+
**event_types:** `typing.Optional[MetricEventTypes]`
1754+
1755+
</dd>
1756+
</dl>
1757+
1758+
<dl>
1759+
<dd>
1760+
1761+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
1762+
1763+
</dd>
1764+
</dl>
1765+
</dd>
1766+
</dl>
1767+
1768+
16721769
</dd>
16731770
</dl>
16741771
</details>
@@ -1823,6 +1920,86 @@ client.inboxes.threads.get(
18231920
</dl>
18241921

18251922

1923+
</dd>
1924+
</dl>
1925+
</details>
1926+
1927+
## Metrics
1928+
<details><summary><code>client.metrics.<a href="src/agentmail/metrics/client.py">list</a>(...)</code></summary>
1929+
<dl>
1930+
<dd>
1931+
1932+
#### 🔌 Usage
1933+
1934+
<dl>
1935+
<dd>
1936+
1937+
<dl>
1938+
<dd>
1939+
1940+
```python
1941+
import datetime
1942+
1943+
from agentmail import AgentMail
1944+
1945+
client = AgentMail(
1946+
api_key="YOUR_API_KEY",
1947+
)
1948+
client.metrics.list(
1949+
start_timestamp=datetime.datetime.fromisoformat(
1950+
"2024-01-15 09:30:00+00:00",
1951+
),
1952+
end_timestamp=datetime.datetime.fromisoformat(
1953+
"2024-01-15 09:30:00+00:00",
1954+
),
1955+
)
1956+
1957+
```
1958+
</dd>
1959+
</dl>
1960+
</dd>
1961+
</dl>
1962+
1963+
#### ⚙️ Parameters
1964+
1965+
<dl>
1966+
<dd>
1967+
1968+
<dl>
1969+
<dd>
1970+
1971+
**start_timestamp:** `MetricStartTimestamp`
1972+
1973+
</dd>
1974+
</dl>
1975+
1976+
<dl>
1977+
<dd>
1978+
1979+
**end_timestamp:** `MetricEndTimestamp`
1980+
1981+
</dd>
1982+
</dl>
1983+
1984+
<dl>
1985+
<dd>
1986+
1987+
**event_types:** `typing.Optional[MetricEventTypes]`
1988+
1989+
</dd>
1990+
</dl>
1991+
1992+
<dl>
1993+
<dd>
1994+
1995+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
1996+
1997+
</dd>
1998+
</dl>
1999+
</dd>
2000+
</dl>
2001+
2002+
18262003
</dd>
18272004
</dl>
18282005
</details>

src/agentmail/__init__.py

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
ValidationErrorResponse,
1515
)
1616
from .errors import IsTakenError, NotFoundError, ValidationError
17-
from . import attachments, domains, drafts, inboxes, messages, threads, webhooks, websockets
17+
from . import attachments, domains, drafts, inboxes, messages, metrics, threads, webhooks, websockets
1818
from .attachments import (
1919
Attachment,
2020
AttachmentContent,
@@ -51,6 +51,8 @@
5151
DraftLabels,
5252
DraftPreview,
5353
DraftReplyTo,
54+
DraftSendAt,
55+
DraftSendStatus,
5456
DraftSubject,
5557
DraftText,
5658
DraftTo,
@@ -86,6 +88,15 @@
8688
SendMessageTo,
8789
UpdateMessageRequest,
8890
)
91+
from .metrics import (
92+
ListMetricsResponse,
93+
MessageMetrics,
94+
MetricEndTimestamp,
95+
MetricEventType,
96+
MetricEventTypes,
97+
MetricStartTimestamp,
98+
MetricTimestamp,
99+
)
89100
from .threads import (
90101
ListThreadsResponse,
91102
Thread,
@@ -134,6 +145,8 @@
134145
"DraftLabels",
135146
"DraftPreview",
136147
"DraftReplyTo",
148+
"DraftSendAt",
149+
"DraftSendStatus",
137150
"DraftSubject",
138151
"DraftText",
139152
"DraftTo",
@@ -147,6 +160,7 @@
147160
"ListDomainsResponse",
148161
"ListDraftsResponse",
149162
"ListMessagesResponse",
163+
"ListMetricsResponse",
150164
"ListThreadsResponse",
151165
"Message",
152166
"MessageAttachments",
@@ -157,13 +171,19 @@
157171
"MessageId",
158172
"MessageItem",
159173
"MessageLabels",
174+
"MessageMetrics",
160175
"MessagePreview",
161176
"MessageReceived",
162177
"MessageRejectedError",
163178
"MessageSubject",
164179
"MessageText",
165180
"MessageTimestamp",
166181
"MessageTo",
182+
"MetricEndTimestamp",
183+
"MetricEventType",
184+
"MetricEventTypes",
185+
"MetricStartTimestamp",
186+
"MetricTimestamp",
167187
"NotFoundError",
168188
"OrganizationId",
169189
"PageToken",
@@ -202,6 +222,7 @@
202222
"drafts",
203223
"inboxes",
204224
"messages",
225+
"metrics",
205226
"threads",
206227
"webhooks",
207228
"websockets",

src/agentmail/client.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .drafts.client import AsyncDraftsClient, DraftsClient
1111
from .environment import AgentMailEnvironment
1212
from .inboxes.client import AsyncInboxesClient, InboxesClient
13+
from .metrics.client import AsyncMetricsClient, MetricsClient
1314
from .threads.client import AsyncThreadsClient, ThreadsClient
1415
from .webhooks.client import AsyncWebhooksClient, WebhooksClient
1516
from .websockets.client import AsyncWebsocketsClient, WebsocketsClient
@@ -84,6 +85,7 @@ def __init__(
8485
self.webhooks = WebhooksClient(client_wrapper=self._client_wrapper)
8586
self.domains = DomainsClient(client_wrapper=self._client_wrapper)
8687
self.drafts = DraftsClient(client_wrapper=self._client_wrapper)
88+
self.metrics = MetricsClient(client_wrapper=self._client_wrapper)
8789
self.threads = ThreadsClient(client_wrapper=self._client_wrapper)
8890
self.websockets = WebsocketsClient(client_wrapper=self._client_wrapper)
8991

@@ -157,5 +159,6 @@ def __init__(
157159
self.webhooks = AsyncWebhooksClient(client_wrapper=self._client_wrapper)
158160
self.domains = AsyncDomainsClient(client_wrapper=self._client_wrapper)
159161
self.drafts = AsyncDraftsClient(client_wrapper=self._client_wrapper)
162+
self.metrics = AsyncMetricsClient(client_wrapper=self._client_wrapper)
160163
self.threads = AsyncThreadsClient(client_wrapper=self._client_wrapper)
161164
self.websockets = AsyncWebsocketsClient(client_wrapper=self._client_wrapper)

src/agentmail/core/client_wrapper.py

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

2424
def get_headers(self) -> typing.Dict[str, str]:
2525
headers: typing.Dict[str, str] = {
26-
"User-Agent": "agentmail/0.0.45",
26+
"User-Agent": "agentmail/0.0.46",
2727
"X-Fern-Language": "Python",
2828
"X-Fern-SDK-Name": "agentmail",
29-
"X-Fern-SDK-Version": "0.0.45",
29+
"X-Fern-SDK-Version": "0.0.46",
3030
**(self.get_custom_headers() or {}),
3131
}
3232
headers["Authorization"] = f"Bearer {self._get_api_key()}"

src/agentmail/drafts/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@
1414
DraftLabels,
1515
DraftPreview,
1616
DraftReplyTo,
17+
DraftSendAt,
18+
DraftSendStatus,
1719
DraftSubject,
1820
DraftText,
1921
DraftTo,
@@ -33,6 +35,8 @@
3335
"DraftLabels",
3436
"DraftPreview",
3537
"DraftReplyTo",
38+
"DraftSendAt",
39+
"DraftSendStatus",
3640
"DraftSubject",
3741
"DraftText",
3842
"DraftTo",

src/agentmail/drafts/types/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
from .draft_labels import DraftLabels
1414
from .draft_preview import DraftPreview
1515
from .draft_reply_to import DraftReplyTo
16+
from .draft_send_at import DraftSendAt
17+
from .draft_send_status import DraftSendStatus
1618
from .draft_subject import DraftSubject
1719
from .draft_text import DraftText
1820
from .draft_to import DraftTo
@@ -31,6 +33,8 @@
3133
"DraftLabels",
3234
"DraftPreview",
3335
"DraftReplyTo",
36+
"DraftSendAt",
37+
"DraftSendStatus",
3438
"DraftSubject",
3539
"DraftText",
3640
"DraftTo",

src/agentmail/drafts/types/create_draft_request.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
from .draft_html import DraftHtml
1111
from .draft_labels import DraftLabels
1212
from .draft_reply_to import DraftReplyTo
13+
from .draft_send_at import DraftSendAt
1314
from .draft_subject import DraftSubject
1415
from .draft_text import DraftText
1516
from .draft_to import DraftTo
@@ -24,6 +25,7 @@ class CreateDraftRequest(UncheckedBaseModel):
2425
subject: typing.Optional[DraftSubject] = None
2526
text: typing.Optional[DraftText] = None
2627
html: typing.Optional[DraftHtml] = None
28+
send_at: typing.Optional[DraftSendAt] = None
2729

2830
if IS_PYDANTIC_V2:
2931
model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True) # type: ignore # Pydantic v2

0 commit comments

Comments
 (0)