Skip to content

Commit 939d1cb

Browse files
Release 0.1.16
1 parent 25a2021 commit 939d1cb

11 files changed

Lines changed: 402 additions & 6 deletions

File tree

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

reference.md

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3335,6 +3335,67 @@ client.metrics.list(
33353335
</dl>
33363336

33373337

3338+
</dd>
3339+
</dl>
3340+
</details>
3341+
3342+
## Organizations
3343+
<details><summary><code>client.organizations.<a href="src/agentmail/organizations/client.py">get</a>()</code></summary>
3344+
<dl>
3345+
<dd>
3346+
3347+
#### 📝 Description
3348+
3349+
<dl>
3350+
<dd>
3351+
3352+
<dl>
3353+
<dd>
3354+
3355+
Get the current organization.
3356+
</dd>
3357+
</dl>
3358+
</dd>
3359+
</dl>
3360+
3361+
#### 🔌 Usage
3362+
3363+
<dl>
3364+
<dd>
3365+
3366+
<dl>
3367+
<dd>
3368+
3369+
```python
3370+
from agentmail import AgentMail
3371+
3372+
client = AgentMail(
3373+
api_key="YOUR_API_KEY",
3374+
)
3375+
client.organizations.get()
3376+
3377+
```
3378+
</dd>
3379+
</dl>
3380+
</dd>
3381+
</dl>
3382+
3383+
#### ⚙️ Parameters
3384+
3385+
<dl>
3386+
<dd>
3387+
3388+
<dl>
3389+
<dd>
3390+
3391+
**request_options:** `typing.Optional[RequestOptions]` — Request-specific configuration.
3392+
3393+
</dd>
3394+
</dl>
3395+
</dd>
3396+
</dl>
3397+
3398+
33383399
</dd>
33393400
</dl>
33403401
</details>

src/agentmail/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
inboxes,
3131
messages,
3232
metrics,
33+
organizations,
3334
pods,
3435
threads,
3536
webhooks,
@@ -162,6 +163,7 @@
162163
MetricStartTimestamp,
163164
MetricTimestamp,
164165
)
166+
from .organizations import Organization
165167
from .threads import (
166168
ListThreadsResponse,
167169
Thread,
@@ -287,6 +289,7 @@
287289
"MetricTimestamp": ".metrics",
288290
"Name": ".api_keys",
289291
"NotFoundError": ".errors",
292+
"Organization": ".organizations",
290293
"OrganizationId": ".types",
291294
"PageToken": ".types",
292295
"PodIds": ".events",
@@ -343,6 +346,7 @@
343346
"inboxes": ".inboxes",
344347
"messages": ".messages",
345348
"metrics": ".metrics",
349+
"organizations": ".organizations",
346350
"pods": ".pods",
347351
"threads": ".threads",
348352
"webhooks": ".webhooks",
@@ -474,6 +478,7 @@ def __dir__():
474478
"MetricTimestamp",
475479
"Name",
476480
"NotFoundError",
481+
"Organization",
477482
"OrganizationId",
478483
"PageToken",
479484
"PodIds",
@@ -530,6 +535,7 @@ def __dir__():
530535
"inboxes",
531536
"messages",
532537
"metrics",
538+
"organizations",
533539
"pods",
534540
"threads",
535541
"webhooks",

src/agentmail/client.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from .drafts.client import AsyncDraftsClient, DraftsClient
1717
from .inboxes.client import AsyncInboxesClient, InboxesClient
1818
from .metrics.client import AsyncMetricsClient, MetricsClient
19+
from .organizations.client import AsyncOrganizationsClient, OrganizationsClient
1920
from .pods.client import AsyncPodsClient, PodsClient
2021
from .threads.client import AsyncThreadsClient, ThreadsClient
2122
from .webhooks.client import AsyncWebhooksClient, WebhooksClient
@@ -94,6 +95,7 @@ def __init__(
9495
self._domains: typing.Optional[DomainsClient] = None
9596
self._drafts: typing.Optional[DraftsClient] = None
9697
self._metrics: typing.Optional[MetricsClient] = None
98+
self._organizations: typing.Optional[OrganizationsClient] = None
9799
self._threads: typing.Optional[ThreadsClient] = None
98100
self._websockets: typing.Optional[WebsocketsClient] = None
99101

@@ -153,6 +155,14 @@ def metrics(self):
153155
self._metrics = MetricsClient(client_wrapper=self._client_wrapper)
154156
return self._metrics
155157

158+
@property
159+
def organizations(self):
160+
if self._organizations is None:
161+
from .organizations.client import OrganizationsClient # noqa: E402
162+
163+
self._organizations = OrganizationsClient(client_wrapper=self._client_wrapper)
164+
return self._organizations
165+
156166
@property
157167
def threads(self):
158168
if self._threads is None:
@@ -242,6 +252,7 @@ def __init__(
242252
self._domains: typing.Optional[AsyncDomainsClient] = None
243253
self._drafts: typing.Optional[AsyncDraftsClient] = None
244254
self._metrics: typing.Optional[AsyncMetricsClient] = None
255+
self._organizations: typing.Optional[AsyncOrganizationsClient] = None
245256
self._threads: typing.Optional[AsyncThreadsClient] = None
246257
self._websockets: typing.Optional[AsyncWebsocketsClient] = None
247258

@@ -301,6 +312,14 @@ def metrics(self):
301312
self._metrics = AsyncMetricsClient(client_wrapper=self._client_wrapper)
302313
return self._metrics
303314

315+
@property
316+
def organizations(self):
317+
if self._organizations is None:
318+
from .organizations.client import AsyncOrganizationsClient # noqa: E402
319+
320+
self._organizations = AsyncOrganizationsClient(client_wrapper=self._client_wrapper)
321+
return self._organizations
322+
304323
@property
305324
def threads(self):
306325
if self._threads is None:

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.1.15",
26+
"User-Agent": "agentmail/0.1.16",
2727
"X-Fern-Language": "Python",
2828
"X-Fern-SDK-Name": "agentmail",
29-
"X-Fern-SDK-Version": "0.1.15",
29+
"X-Fern-SDK-Version": "0.1.16",
3030
**(self.get_custom_headers() or {}),
3131
}
3232
headers["Authorization"] = f"Bearer {self._get_api_key()}"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
# isort: skip_file
4+
5+
import typing
6+
from importlib import import_module
7+
8+
if typing.TYPE_CHECKING:
9+
from .types import Organization
10+
_dynamic_imports: typing.Dict[str, str] = {"Organization": ".types"}
11+
12+
13+
def __getattr__(attr_name: str) -> typing.Any:
14+
module_name = _dynamic_imports.get(attr_name)
15+
if module_name is None:
16+
raise AttributeError(f"No {attr_name} found in _dynamic_imports for module name -> {__name__}")
17+
try:
18+
module = import_module(module_name, __package__)
19+
if module_name == f".{attr_name}":
20+
return module
21+
else:
22+
return getattr(module, attr_name)
23+
except ImportError as e:
24+
raise ImportError(f"Failed to import {attr_name} from {module_name}: {e}") from e
25+
except AttributeError as e:
26+
raise AttributeError(f"Failed to get {attr_name} from {module_name}: {e}") from e
27+
28+
29+
def __dir__():
30+
lazy_attrs = list(_dynamic_imports.keys())
31+
return sorted(lazy_attrs)
32+
33+
34+
__all__ = ["Organization"]
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
# This file was auto-generated by Fern from our API Definition.
2+
3+
import typing
4+
5+
from ..core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
6+
from ..core.request_options import RequestOptions
7+
from .raw_client import AsyncRawOrganizationsClient, RawOrganizationsClient
8+
from .types.organization import Organization
9+
10+
11+
class OrganizationsClient:
12+
def __init__(self, *, client_wrapper: SyncClientWrapper):
13+
self._raw_client = RawOrganizationsClient(client_wrapper=client_wrapper)
14+
15+
@property
16+
def with_raw_response(self) -> RawOrganizationsClient:
17+
"""
18+
Retrieves a raw implementation of this client that returns raw responses.
19+
20+
Returns
21+
-------
22+
RawOrganizationsClient
23+
"""
24+
return self._raw_client
25+
26+
def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> Organization:
27+
"""
28+
Get the current organization.
29+
30+
Parameters
31+
----------
32+
request_options : typing.Optional[RequestOptions]
33+
Request-specific configuration.
34+
35+
Returns
36+
-------
37+
Organization
38+
39+
Examples
40+
--------
41+
from agentmail import AgentMail
42+
43+
client = AgentMail(
44+
api_key="YOUR_API_KEY",
45+
)
46+
client.organizations.get()
47+
"""
48+
_response = self._raw_client.get(request_options=request_options)
49+
return _response.data
50+
51+
52+
class AsyncOrganizationsClient:
53+
def __init__(self, *, client_wrapper: AsyncClientWrapper):
54+
self._raw_client = AsyncRawOrganizationsClient(client_wrapper=client_wrapper)
55+
56+
@property
57+
def with_raw_response(self) -> AsyncRawOrganizationsClient:
58+
"""
59+
Retrieves a raw implementation of this client that returns raw responses.
60+
61+
Returns
62+
-------
63+
AsyncRawOrganizationsClient
64+
"""
65+
return self._raw_client
66+
67+
async def get(self, *, request_options: typing.Optional[RequestOptions] = None) -> Organization:
68+
"""
69+
Get the current organization.
70+
71+
Parameters
72+
----------
73+
request_options : typing.Optional[RequestOptions]
74+
Request-specific configuration.
75+
76+
Returns
77+
-------
78+
Organization
79+
80+
Examples
81+
--------
82+
import asyncio
83+
84+
from agentmail import AsyncAgentMail
85+
86+
client = AsyncAgentMail(
87+
api_key="YOUR_API_KEY",
88+
)
89+
90+
91+
async def main() -> None:
92+
await client.organizations.get()
93+
94+
95+
asyncio.run(main())
96+
"""
97+
_response = await self._raw_client.get(request_options=request_options)
98+
return _response.data

0 commit comments

Comments
 (0)