Skip to content

Commit 3190d9b

Browse files
Release 0.2.8
1 parent 07badee commit 3190d9b

9 files changed

Lines changed: 440 additions & 6 deletions

File tree

.fern/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@
99
},
1010
"should_generate_websocket_clients": true
1111
},
12-
"sdkVersion": "0.2.6"
12+
"sdkVersion": "0.2.8"
1313
}

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ dynamic = ["version"]
44

55
[tool.poetry]
66
name = "agentmail"
7-
version = "0.2.6"
7+
version = "0.2.8"
88
description = ""
99
readme = "README.md"
1010
authors = []

reference.md

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -645,6 +645,94 @@ client.webhooks.get(
645645
</dl>
646646

647647

648+
</dd>
649+
</dl>
650+
</details>
651+
652+
<details><summary><code>client.webhooks.<a href="src/agentmail/webhooks/client.py">update</a>(...) -&gt; AsyncHttpResponse[Webhook]</code></summary>
653+
<dl>
654+
<dd>
655+
656+
#### 🔌 Usage
657+
658+
<dl>
659+
<dd>
660+
661+
<dl>
662+
<dd>
663+
664+
```python
665+
from agentmail import AgentMail
666+
667+
client = AgentMail(
668+
api_key="YOUR_API_KEY",
669+
)
670+
client.webhooks.update(
671+
webhook_id="webhook_id",
672+
)
673+
674+
```
675+
</dd>
676+
</dl>
677+
</dd>
678+
</dl>
679+
680+
#### ⚙️ Parameters
681+
682+
<dl>
683+
<dd>
684+
685+
<dl>
686+
<dd>
687+
688+
**webhook_id:** `WebhookId`
689+
690+
</dd>
691+
</dl>
692+
693+
<dl>
694+
<dd>
695+
696+
**add_inbox_ids:** `typing.Optional[InboxIds]` — Inbox IDs to subscribe to the webhook.
697+
698+
</dd>
699+
</dl>
700+
701+
<dl>
702+
<dd>
703+
704+
**remove_inbox_ids:** `typing.Optional[InboxIds]` — Inbox IDs to unsubscribe from the webhook.
705+
706+
</dd>
707+
</dl>
708+
709+
<dl>
710+
<dd>
711+
712+
**add_pod_ids:** `typing.Optional[PodIds]` — Pod IDs to subscribe to the webhook.
713+
714+
</dd>
715+
</dl>
716+
717+
<dl>
718+
<dd>
719+
720+
**remove_pod_ids:** `typing.Optional[PodIds]` — Pod IDs to unsubscribe from the webhook.
721+
722+
</dd>
723+
</dl>
724+
725+
<dl>
726+
<dd>
727+
728+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
729+
730+
</dd>
731+
</dl>
732+
</dd>
733+
</dl>
734+
735+
648736
</dd>
649737
</dl>
650738
</details>

src/agentmail/core/client_wrapper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@ def get_headers(self) -> typing.Dict[str, str]:
2525
import platform
2626

2727
headers: typing.Dict[str, str] = {
28-
"User-Agent": "agentmail/0.2.6",
28+
"User-Agent": "agentmail/0.2.8",
2929
"X-Fern-Language": "Python",
3030
"X-Fern-Runtime": f"python/{platform.python_version()}",
3131
"X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}",
3232
"X-Fern-SDK-Name": "agentmail",
33-
"X-Fern-SDK-Version": "0.2.6",
33+
"X-Fern-SDK-Version": "0.2.8",
3434
**(self.get_custom_headers() or {}),
3535
}
3636
headers["Authorization"] = f"Bearer {self._get_api_key()}"

src/agentmail/webhooks/__init__.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@
66
from importlib import import_module
77

88
if typing.TYPE_CHECKING:
9-
from .types import ClientId, CreateWebhookRequest, ListWebhooksResponse, Url, Webhook, WebhookId
9+
from .types import (
10+
ClientId,
11+
CreateWebhookRequest,
12+
ListWebhooksResponse,
13+
UpdateWebhookRequest,
14+
Url,
15+
Webhook,
16+
WebhookId,
17+
)
1018
from . import events
1119
from .events import SvixId, SvixSignature, SvixTimestamp
1220
_dynamic_imports: typing.Dict[str, str] = {
@@ -16,6 +24,7 @@
1624
"SvixId": ".events",
1725
"SvixSignature": ".events",
1826
"SvixTimestamp": ".events",
27+
"UpdateWebhookRequest": ".types",
1928
"Url": ".types",
2029
"Webhook": ".types",
2130
"WebhookId": ".types",
@@ -51,6 +60,7 @@ def __dir__():
5160
"SvixId",
5261
"SvixSignature",
5362
"SvixTimestamp",
63+
"UpdateWebhookRequest",
5464
"Url",
5565
"Webhook",
5666
"WebhookId",

src/agentmail/webhooks/client.py

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,61 @@ def get(self, webhook_id: WebhookId, *, request_options: typing.Optional[Request
9595
_response = self._raw_client.get(webhook_id, request_options=request_options)
9696
return _response.data
9797

98+
def update(
99+
self,
100+
webhook_id: WebhookId,
101+
*,
102+
add_inbox_ids: typing.Optional[InboxIds] = OMIT,
103+
remove_inbox_ids: typing.Optional[InboxIds] = OMIT,
104+
add_pod_ids: typing.Optional[PodIds] = OMIT,
105+
remove_pod_ids: typing.Optional[PodIds] = OMIT,
106+
request_options: typing.Optional[RequestOptions] = None,
107+
) -> Webhook:
108+
"""
109+
Parameters
110+
----------
111+
webhook_id : WebhookId
112+
113+
add_inbox_ids : typing.Optional[InboxIds]
114+
Inbox IDs to subscribe to the webhook.
115+
116+
remove_inbox_ids : typing.Optional[InboxIds]
117+
Inbox IDs to unsubscribe from the webhook.
118+
119+
add_pod_ids : typing.Optional[PodIds]
120+
Pod IDs to subscribe to the webhook.
121+
122+
remove_pod_ids : typing.Optional[PodIds]
123+
Pod IDs to unsubscribe from the webhook.
124+
125+
request_options : typing.Optional[RequestOptions]
126+
Request-specific configuration.
127+
128+
Returns
129+
-------
130+
Webhook
131+
132+
Examples
133+
--------
134+
from agentmail import AgentMail
135+
136+
client = AgentMail(
137+
api_key="YOUR_API_KEY",
138+
)
139+
client.webhooks.update(
140+
webhook_id="webhook_id",
141+
)
142+
"""
143+
_response = self._raw_client.update(
144+
webhook_id,
145+
add_inbox_ids=add_inbox_ids,
146+
remove_inbox_ids=remove_inbox_ids,
147+
add_pod_ids=add_pod_ids,
148+
remove_pod_ids=remove_pod_ids,
149+
request_options=request_options,
150+
)
151+
return _response.data
152+
98153
def create(
99154
self,
100155
*,
@@ -266,6 +321,69 @@ async def main() -> None:
266321
_response = await self._raw_client.get(webhook_id, request_options=request_options)
267322
return _response.data
268323

324+
async def update(
325+
self,
326+
webhook_id: WebhookId,
327+
*,
328+
add_inbox_ids: typing.Optional[InboxIds] = OMIT,
329+
remove_inbox_ids: typing.Optional[InboxIds] = OMIT,
330+
add_pod_ids: typing.Optional[PodIds] = OMIT,
331+
remove_pod_ids: typing.Optional[PodIds] = OMIT,
332+
request_options: typing.Optional[RequestOptions] = None,
333+
) -> Webhook:
334+
"""
335+
Parameters
336+
----------
337+
webhook_id : WebhookId
338+
339+
add_inbox_ids : typing.Optional[InboxIds]
340+
Inbox IDs to subscribe to the webhook.
341+
342+
remove_inbox_ids : typing.Optional[InboxIds]
343+
Inbox IDs to unsubscribe from the webhook.
344+
345+
add_pod_ids : typing.Optional[PodIds]
346+
Pod IDs to subscribe to the webhook.
347+
348+
remove_pod_ids : typing.Optional[PodIds]
349+
Pod IDs to unsubscribe from the webhook.
350+
351+
request_options : typing.Optional[RequestOptions]
352+
Request-specific configuration.
353+
354+
Returns
355+
-------
356+
Webhook
357+
358+
Examples
359+
--------
360+
import asyncio
361+
362+
from agentmail import AsyncAgentMail
363+
364+
client = AsyncAgentMail(
365+
api_key="YOUR_API_KEY",
366+
)
367+
368+
369+
async def main() -> None:
370+
await client.webhooks.update(
371+
webhook_id="webhook_id",
372+
)
373+
374+
375+
asyncio.run(main())
376+
"""
377+
_response = await self._raw_client.update(
378+
webhook_id,
379+
add_inbox_ids=add_inbox_ids,
380+
remove_inbox_ids=remove_inbox_ids,
381+
add_pod_ids=add_pod_ids,
382+
remove_pod_ids=remove_pod_ids,
383+
request_options=request_options,
384+
)
385+
return _response.data
386+
269387
async def create(
270388
self,
271389
*,

0 commit comments

Comments
 (0)