aiinbx 0.4.0__tar.gz → 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- aiinbx-0.5.0/.release-please-manifest.json +3 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/CHANGELOG.md +13 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/PKG-INFO +1 -1
- {aiinbx-0.4.0 → aiinbx-0.5.0}/api.md +29 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/pyproject.toml +5 -1
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_client.py +13 -1
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_version.py +1 -1
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/resources/__init__.py +17 -0
- aiinbx-0.5.0/src/aiinbx/resources/meta.py +147 -0
- aiinbx-0.5.0/src/aiinbx/resources/webhooks.py +34 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/__init__.py +15 -0
- aiinbx-0.5.0/src/aiinbx/types/inbound_email_received_webhook_event.py +113 -0
- aiinbx-0.5.0/src/aiinbx/types/meta_webhooks_schema_response.py +298 -0
- aiinbx-0.5.0/src/aiinbx/types/outbound_email_bounced_webhook_event.py +44 -0
- aiinbx-0.5.0/src/aiinbx/types/outbound_email_clicked_webhook_event.py +36 -0
- aiinbx-0.5.0/src/aiinbx/types/outbound_email_complained_webhook_event.py +36 -0
- aiinbx-0.5.0/src/aiinbx/types/outbound_email_delivered_webhook_event.py +36 -0
- aiinbx-0.5.0/src/aiinbx/types/outbound_email_opened_webhook_event.py +32 -0
- aiinbx-0.5.0/src/aiinbx/types/outbound_email_rejected_webhook_event.py +30 -0
- aiinbx-0.5.0/src/aiinbx/types/unwrap_webhook_event.py +24 -0
- aiinbx-0.5.0/tests/api_resources/test_meta.py +80 -0
- aiinbx-0.5.0/tests/api_resources/test_webhooks.py +19 -0
- aiinbx-0.4.0/.release-please-manifest.json +0 -3
- {aiinbx-0.4.0 → aiinbx-0.5.0}/.gitignore +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/CONTRIBUTING.md +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/LICENSE +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/README.md +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/SECURITY.md +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/bin/check-release-environment +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/bin/publish-pypi +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/examples/.keep +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/noxfile.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/release-please-config.json +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/requirements-dev.lock +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/requirements.lock +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/ai_inbx/lib/.keep +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/__init__.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_base_client.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_compat.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_constants.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_exceptions.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_files.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_models.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_qs.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_resource.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_response.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_streaming.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_types.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_utils/__init__.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_utils/_compat.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_utils/_datetime_parse.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_utils/_logs.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_utils/_proxy.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_utils/_reflection.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_utils/_resources_proxy.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_utils/_streams.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_utils/_sync.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_utils/_transform.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_utils/_typing.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/_utils/_utils.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/lib/.keep +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/py.typed +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/resources/domains.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/resources/emails.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/resources/threads.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/domain_create_params.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/domain_create_response.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/domain_delete_response.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/domain_list_response.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/domain_retrieve_response.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/domain_verify_response.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/email_reply_params.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/email_reply_response.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/email_retrieve_response.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/email_send_params.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/email_send_response.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/thread_forward_params.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/thread_forward_response.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/thread_retrieve_response.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/thread_search_params.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/src/aiinbx/types/thread_search_response.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/__init__.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/api_resources/__init__.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/api_resources/test_domains.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/api_resources/test_emails.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/api_resources/test_threads.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/conftest.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/sample_file.txt +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/test_client.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/test_deepcopy.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/test_extract_files.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/test_files.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/test_models.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/test_qs.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/test_required_args.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/test_response.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/test_streaming.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/test_transform.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/test_utils/test_datetime_parse.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/test_utils/test_proxy.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/test_utils/test_typing.py +0 -0
- {aiinbx-0.4.0 → aiinbx-0.5.0}/tests/utils.py +0 -0
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.0 (2025-10-15)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v0.4.0...v0.5.0](https://github.com/aiinbx/aiinbx-py/compare/v0.4.0...v0.5.0)
|
|
6
|
+
|
|
7
|
+
### Features
|
|
8
|
+
|
|
9
|
+
* **api:** manual updates ([ddacc81](https://github.com/aiinbx/aiinbx-py/commit/ddacc8158fd4079c1ee4b8ae04f89f22e2fcd46a))
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
### Chores
|
|
13
|
+
|
|
14
|
+
* **internal:** detect missing future annotations with ruff ([6f6a3da](https://github.com/aiinbx/aiinbx-py/commit/6f6a3da5978b34e1a2959b38715d4311474f1c5e))
|
|
15
|
+
|
|
3
16
|
## 0.4.0 (2025-10-05)
|
|
4
17
|
|
|
5
18
|
Full Changelog: [v0.3.0...v0.4.0](https://github.com/aiinbx/aiinbx-py/compare/v0.3.0...v0.4.0)
|
|
@@ -47,3 +47,32 @@ Methods:
|
|
|
47
47
|
- <code title="get /domains">client.domains.<a href="./src/aiinbx/resources/domains.py">list</a>() -> <a href="./src/aiinbx/types/domain_list_response.py">DomainListResponse</a></code>
|
|
48
48
|
- <code title="delete /domains/{domainId}">client.domains.<a href="./src/aiinbx/resources/domains.py">delete</a>(domain_id) -> <a href="./src/aiinbx/types/domain_delete_response.py">DomainDeleteResponse</a></code>
|
|
49
49
|
- <code title="post /domains/{domainId}/verify">client.domains.<a href="./src/aiinbx/resources/domains.py">verify</a>(domain_id) -> <a href="./src/aiinbx/types/domain_verify_response.py">DomainVerifyResponse</a></code>
|
|
50
|
+
|
|
51
|
+
# Webhooks
|
|
52
|
+
|
|
53
|
+
Types:
|
|
54
|
+
|
|
55
|
+
```python
|
|
56
|
+
from aiinbx.types import (
|
|
57
|
+
InboundEmailReceivedWebhookEvent,
|
|
58
|
+
OutboundEmailDeliveredWebhookEvent,
|
|
59
|
+
OutboundEmailBouncedWebhookEvent,
|
|
60
|
+
OutboundEmailComplainedWebhookEvent,
|
|
61
|
+
OutboundEmailRejectedWebhookEvent,
|
|
62
|
+
OutboundEmailOpenedWebhookEvent,
|
|
63
|
+
OutboundEmailClickedWebhookEvent,
|
|
64
|
+
UnwrapWebhookEvent,
|
|
65
|
+
)
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
# Meta
|
|
69
|
+
|
|
70
|
+
Types:
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
from aiinbx.types import MetaWebhooksSchemaResponse
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Methods:
|
|
77
|
+
|
|
78
|
+
- <code title="get /_meta/webhooks">client.meta.<a href="./src/aiinbx/resources/meta.py">webhooks_schema</a>() -> <a href="./src/aiinbx/types/meta_webhooks_schema_response.py">MetaWebhooksSchemaResponse</a></code>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "aiinbx"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.5.0"
|
|
4
4
|
description = "The official Python library for the AIInbx API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -224,6 +224,8 @@ select = [
|
|
|
224
224
|
"B",
|
|
225
225
|
# remove unused imports
|
|
226
226
|
"F401",
|
|
227
|
+
# check for missing future annotations
|
|
228
|
+
"FA102",
|
|
227
229
|
# bare except statements
|
|
228
230
|
"E722",
|
|
229
231
|
# unused arguments
|
|
@@ -246,6 +248,8 @@ unfixable = [
|
|
|
246
248
|
"T203",
|
|
247
249
|
]
|
|
248
250
|
|
|
251
|
+
extend-safe-fixes = ["FA102"]
|
|
252
|
+
|
|
249
253
|
[tool.ruff.lint.flake8-tidy-imports.banned-api]
|
|
250
254
|
"functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead"
|
|
251
255
|
|
|
@@ -21,7 +21,7 @@ from ._types import (
|
|
|
21
21
|
)
|
|
22
22
|
from ._utils import is_given, get_async_library
|
|
23
23
|
from ._version import __version__
|
|
24
|
-
from .resources import emails, domains, threads
|
|
24
|
+
from .resources import meta, emails, domains, threads, webhooks
|
|
25
25
|
from ._streaming import Stream as Stream, AsyncStream as AsyncStream
|
|
26
26
|
from ._exceptions import AIInbxError, APIStatusError
|
|
27
27
|
from ._base_client import (
|
|
@@ -37,6 +37,8 @@ class AIInbx(SyncAPIClient):
|
|
|
37
37
|
threads: threads.ThreadsResource
|
|
38
38
|
emails: emails.EmailsResource
|
|
39
39
|
domains: domains.DomainsResource
|
|
40
|
+
webhooks: webhooks.WebhooksResource
|
|
41
|
+
meta: meta.MetaResource
|
|
40
42
|
with_raw_response: AIInbxWithRawResponse
|
|
41
43
|
with_streaming_response: AIInbxWithStreamedResponse
|
|
42
44
|
|
|
@@ -97,6 +99,8 @@ class AIInbx(SyncAPIClient):
|
|
|
97
99
|
self.threads = threads.ThreadsResource(self)
|
|
98
100
|
self.emails = emails.EmailsResource(self)
|
|
99
101
|
self.domains = domains.DomainsResource(self)
|
|
102
|
+
self.webhooks = webhooks.WebhooksResource(self)
|
|
103
|
+
self.meta = meta.MetaResource(self)
|
|
100
104
|
self.with_raw_response = AIInbxWithRawResponse(self)
|
|
101
105
|
self.with_streaming_response = AIInbxWithStreamedResponse(self)
|
|
102
106
|
|
|
@@ -209,6 +213,8 @@ class AsyncAIInbx(AsyncAPIClient):
|
|
|
209
213
|
threads: threads.AsyncThreadsResource
|
|
210
214
|
emails: emails.AsyncEmailsResource
|
|
211
215
|
domains: domains.AsyncDomainsResource
|
|
216
|
+
webhooks: webhooks.AsyncWebhooksResource
|
|
217
|
+
meta: meta.AsyncMetaResource
|
|
212
218
|
with_raw_response: AsyncAIInbxWithRawResponse
|
|
213
219
|
with_streaming_response: AsyncAIInbxWithStreamedResponse
|
|
214
220
|
|
|
@@ -269,6 +275,8 @@ class AsyncAIInbx(AsyncAPIClient):
|
|
|
269
275
|
self.threads = threads.AsyncThreadsResource(self)
|
|
270
276
|
self.emails = emails.AsyncEmailsResource(self)
|
|
271
277
|
self.domains = domains.AsyncDomainsResource(self)
|
|
278
|
+
self.webhooks = webhooks.AsyncWebhooksResource(self)
|
|
279
|
+
self.meta = meta.AsyncMetaResource(self)
|
|
272
280
|
self.with_raw_response = AsyncAIInbxWithRawResponse(self)
|
|
273
281
|
self.with_streaming_response = AsyncAIInbxWithStreamedResponse(self)
|
|
274
282
|
|
|
@@ -382,6 +390,7 @@ class AIInbxWithRawResponse:
|
|
|
382
390
|
self.threads = threads.ThreadsResourceWithRawResponse(client.threads)
|
|
383
391
|
self.emails = emails.EmailsResourceWithRawResponse(client.emails)
|
|
384
392
|
self.domains = domains.DomainsResourceWithRawResponse(client.domains)
|
|
393
|
+
self.meta = meta.MetaResourceWithRawResponse(client.meta)
|
|
385
394
|
|
|
386
395
|
|
|
387
396
|
class AsyncAIInbxWithRawResponse:
|
|
@@ -389,6 +398,7 @@ class AsyncAIInbxWithRawResponse:
|
|
|
389
398
|
self.threads = threads.AsyncThreadsResourceWithRawResponse(client.threads)
|
|
390
399
|
self.emails = emails.AsyncEmailsResourceWithRawResponse(client.emails)
|
|
391
400
|
self.domains = domains.AsyncDomainsResourceWithRawResponse(client.domains)
|
|
401
|
+
self.meta = meta.AsyncMetaResourceWithRawResponse(client.meta)
|
|
392
402
|
|
|
393
403
|
|
|
394
404
|
class AIInbxWithStreamedResponse:
|
|
@@ -396,6 +406,7 @@ class AIInbxWithStreamedResponse:
|
|
|
396
406
|
self.threads = threads.ThreadsResourceWithStreamingResponse(client.threads)
|
|
397
407
|
self.emails = emails.EmailsResourceWithStreamingResponse(client.emails)
|
|
398
408
|
self.domains = domains.DomainsResourceWithStreamingResponse(client.domains)
|
|
409
|
+
self.meta = meta.MetaResourceWithStreamingResponse(client.meta)
|
|
399
410
|
|
|
400
411
|
|
|
401
412
|
class AsyncAIInbxWithStreamedResponse:
|
|
@@ -403,6 +414,7 @@ class AsyncAIInbxWithStreamedResponse:
|
|
|
403
414
|
self.threads = threads.AsyncThreadsResourceWithStreamingResponse(client.threads)
|
|
404
415
|
self.emails = emails.AsyncEmailsResourceWithStreamingResponse(client.emails)
|
|
405
416
|
self.domains = domains.AsyncDomainsResourceWithStreamingResponse(client.domains)
|
|
417
|
+
self.meta = meta.AsyncMetaResourceWithStreamingResponse(client.meta)
|
|
406
418
|
|
|
407
419
|
|
|
408
420
|
Client = AIInbx
|
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
+
from .meta import (
|
|
4
|
+
MetaResource,
|
|
5
|
+
AsyncMetaResource,
|
|
6
|
+
MetaResourceWithRawResponse,
|
|
7
|
+
AsyncMetaResourceWithRawResponse,
|
|
8
|
+
MetaResourceWithStreamingResponse,
|
|
9
|
+
AsyncMetaResourceWithStreamingResponse,
|
|
10
|
+
)
|
|
3
11
|
from .emails import (
|
|
4
12
|
EmailsResource,
|
|
5
13
|
AsyncEmailsResource,
|
|
@@ -24,6 +32,7 @@ from .threads import (
|
|
|
24
32
|
ThreadsResourceWithStreamingResponse,
|
|
25
33
|
AsyncThreadsResourceWithStreamingResponse,
|
|
26
34
|
)
|
|
35
|
+
from .webhooks import WebhooksResource, AsyncWebhooksResource
|
|
27
36
|
|
|
28
37
|
__all__ = [
|
|
29
38
|
"ThreadsResource",
|
|
@@ -44,4 +53,12 @@ __all__ = [
|
|
|
44
53
|
"AsyncDomainsResourceWithRawResponse",
|
|
45
54
|
"DomainsResourceWithStreamingResponse",
|
|
46
55
|
"AsyncDomainsResourceWithStreamingResponse",
|
|
56
|
+
"WebhooksResource",
|
|
57
|
+
"AsyncWebhooksResource",
|
|
58
|
+
"MetaResource",
|
|
59
|
+
"AsyncMetaResource",
|
|
60
|
+
"MetaResourceWithRawResponse",
|
|
61
|
+
"AsyncMetaResourceWithRawResponse",
|
|
62
|
+
"MetaResourceWithStreamingResponse",
|
|
63
|
+
"AsyncMetaResourceWithStreamingResponse",
|
|
47
64
|
]
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import Any, cast
|
|
6
|
+
|
|
7
|
+
import httpx
|
|
8
|
+
|
|
9
|
+
from .._types import Body, Query, Headers, NotGiven, not_given
|
|
10
|
+
from .._compat import cached_property
|
|
11
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
12
|
+
from .._response import (
|
|
13
|
+
to_raw_response_wrapper,
|
|
14
|
+
to_streamed_response_wrapper,
|
|
15
|
+
async_to_raw_response_wrapper,
|
|
16
|
+
async_to_streamed_response_wrapper,
|
|
17
|
+
)
|
|
18
|
+
from .._base_client import make_request_options
|
|
19
|
+
from ..types.meta_webhooks_schema_response import MetaWebhooksSchemaResponse
|
|
20
|
+
|
|
21
|
+
__all__ = ["MetaResource", "AsyncMetaResource"]
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class MetaResource(SyncAPIResource):
|
|
25
|
+
@cached_property
|
|
26
|
+
def with_raw_response(self) -> MetaResourceWithRawResponse:
|
|
27
|
+
"""
|
|
28
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
29
|
+
the raw response object instead of the parsed content.
|
|
30
|
+
|
|
31
|
+
For more information, see https://www.github.com/aiinbx/aiinbx-py#accessing-raw-response-data-eg-headers
|
|
32
|
+
"""
|
|
33
|
+
return MetaResourceWithRawResponse(self)
|
|
34
|
+
|
|
35
|
+
@cached_property
|
|
36
|
+
def with_streaming_response(self) -> MetaResourceWithStreamingResponse:
|
|
37
|
+
"""
|
|
38
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
39
|
+
|
|
40
|
+
For more information, see https://www.github.com/aiinbx/aiinbx-py#with_streaming_response
|
|
41
|
+
"""
|
|
42
|
+
return MetaResourceWithStreamingResponse(self)
|
|
43
|
+
|
|
44
|
+
def webhooks_schema(
|
|
45
|
+
self,
|
|
46
|
+
*,
|
|
47
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
48
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
49
|
+
extra_headers: Headers | None = None,
|
|
50
|
+
extra_query: Query | None = None,
|
|
51
|
+
extra_body: Body | None = None,
|
|
52
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
53
|
+
) -> MetaWebhooksSchemaResponse:
|
|
54
|
+
"""Internal endpoint to expose webhook event schemas to SDK generators."""
|
|
55
|
+
return cast(
|
|
56
|
+
MetaWebhooksSchemaResponse,
|
|
57
|
+
self._get(
|
|
58
|
+
"/_meta/webhooks",
|
|
59
|
+
options=make_request_options(
|
|
60
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
61
|
+
),
|
|
62
|
+
cast_to=cast(
|
|
63
|
+
Any, MetaWebhooksSchemaResponse
|
|
64
|
+
), # Union types cannot be passed in as arguments in the type system
|
|
65
|
+
),
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
class AsyncMetaResource(AsyncAPIResource):
|
|
70
|
+
@cached_property
|
|
71
|
+
def with_raw_response(self) -> AsyncMetaResourceWithRawResponse:
|
|
72
|
+
"""
|
|
73
|
+
This property can be used as a prefix for any HTTP method call to return
|
|
74
|
+
the raw response object instead of the parsed content.
|
|
75
|
+
|
|
76
|
+
For more information, see https://www.github.com/aiinbx/aiinbx-py#accessing-raw-response-data-eg-headers
|
|
77
|
+
"""
|
|
78
|
+
return AsyncMetaResourceWithRawResponse(self)
|
|
79
|
+
|
|
80
|
+
@cached_property
|
|
81
|
+
def with_streaming_response(self) -> AsyncMetaResourceWithStreamingResponse:
|
|
82
|
+
"""
|
|
83
|
+
An alternative to `.with_raw_response` that doesn't eagerly read the response body.
|
|
84
|
+
|
|
85
|
+
For more information, see https://www.github.com/aiinbx/aiinbx-py#with_streaming_response
|
|
86
|
+
"""
|
|
87
|
+
return AsyncMetaResourceWithStreamingResponse(self)
|
|
88
|
+
|
|
89
|
+
async def webhooks_schema(
|
|
90
|
+
self,
|
|
91
|
+
*,
|
|
92
|
+
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
93
|
+
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
94
|
+
extra_headers: Headers | None = None,
|
|
95
|
+
extra_query: Query | None = None,
|
|
96
|
+
extra_body: Body | None = None,
|
|
97
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
98
|
+
) -> MetaWebhooksSchemaResponse:
|
|
99
|
+
"""Internal endpoint to expose webhook event schemas to SDK generators."""
|
|
100
|
+
return cast(
|
|
101
|
+
MetaWebhooksSchemaResponse,
|
|
102
|
+
await self._get(
|
|
103
|
+
"/_meta/webhooks",
|
|
104
|
+
options=make_request_options(
|
|
105
|
+
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
|
|
106
|
+
),
|
|
107
|
+
cast_to=cast(
|
|
108
|
+
Any, MetaWebhooksSchemaResponse
|
|
109
|
+
), # Union types cannot be passed in as arguments in the type system
|
|
110
|
+
),
|
|
111
|
+
)
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
class MetaResourceWithRawResponse:
|
|
115
|
+
def __init__(self, meta: MetaResource) -> None:
|
|
116
|
+
self._meta = meta
|
|
117
|
+
|
|
118
|
+
self.webhooks_schema = to_raw_response_wrapper(
|
|
119
|
+
meta.webhooks_schema,
|
|
120
|
+
)
|
|
121
|
+
|
|
122
|
+
|
|
123
|
+
class AsyncMetaResourceWithRawResponse:
|
|
124
|
+
def __init__(self, meta: AsyncMetaResource) -> None:
|
|
125
|
+
self._meta = meta
|
|
126
|
+
|
|
127
|
+
self.webhooks_schema = async_to_raw_response_wrapper(
|
|
128
|
+
meta.webhooks_schema,
|
|
129
|
+
)
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
class MetaResourceWithStreamingResponse:
|
|
133
|
+
def __init__(self, meta: MetaResource) -> None:
|
|
134
|
+
self._meta = meta
|
|
135
|
+
|
|
136
|
+
self.webhooks_schema = to_streamed_response_wrapper(
|
|
137
|
+
meta.webhooks_schema,
|
|
138
|
+
)
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
class AsyncMetaResourceWithStreamingResponse:
|
|
142
|
+
def __init__(self, meta: AsyncMetaResource) -> None:
|
|
143
|
+
self._meta = meta
|
|
144
|
+
|
|
145
|
+
self.webhooks_schema = async_to_streamed_response_wrapper(
|
|
146
|
+
meta.webhooks_schema,
|
|
147
|
+
)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import json
|
|
6
|
+
from typing import cast
|
|
7
|
+
|
|
8
|
+
from .._models import construct_type
|
|
9
|
+
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
10
|
+
from ..types.unwrap_webhook_event import UnwrapWebhookEvent
|
|
11
|
+
|
|
12
|
+
__all__ = ["WebhooksResource", "AsyncWebhooksResource"]
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
class WebhooksResource(SyncAPIResource):
|
|
16
|
+
def unwrap(self, payload: str) -> UnwrapWebhookEvent:
|
|
17
|
+
return cast(
|
|
18
|
+
UnwrapWebhookEvent,
|
|
19
|
+
construct_type(
|
|
20
|
+
type_=UnwrapWebhookEvent,
|
|
21
|
+
value=json.loads(payload),
|
|
22
|
+
),
|
|
23
|
+
)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
class AsyncWebhooksResource(AsyncAPIResource):
|
|
27
|
+
def unwrap(self, payload: str) -> UnwrapWebhookEvent:
|
|
28
|
+
return cast(
|
|
29
|
+
UnwrapWebhookEvent,
|
|
30
|
+
construct_type(
|
|
31
|
+
type_=UnwrapWebhookEvent,
|
|
32
|
+
value=json.loads(payload),
|
|
33
|
+
),
|
|
34
|
+
)
|
|
@@ -9,6 +9,7 @@ from .domain_create_params import DomainCreateParams as DomainCreateParams
|
|
|
9
9
|
from .domain_list_response import DomainListResponse as DomainListResponse
|
|
10
10
|
from .email_reply_response import EmailReplyResponse as EmailReplyResponse
|
|
11
11
|
from .thread_search_params import ThreadSearchParams as ThreadSearchParams
|
|
12
|
+
from .unwrap_webhook_event import UnwrapWebhookEvent as UnwrapWebhookEvent
|
|
12
13
|
from .thread_forward_params import ThreadForwardParams as ThreadForwardParams
|
|
13
14
|
from .domain_create_response import DomainCreateResponse as DomainCreateResponse
|
|
14
15
|
from .domain_delete_response import DomainDeleteResponse as DomainDeleteResponse
|
|
@@ -18,3 +19,17 @@ from .email_retrieve_response import EmailRetrieveResponse as EmailRetrieveRespo
|
|
|
18
19
|
from .thread_forward_response import ThreadForwardResponse as ThreadForwardResponse
|
|
19
20
|
from .domain_retrieve_response import DomainRetrieveResponse as DomainRetrieveResponse
|
|
20
21
|
from .thread_retrieve_response import ThreadRetrieveResponse as ThreadRetrieveResponse
|
|
22
|
+
from .meta_webhooks_schema_response import MetaWebhooksSchemaResponse as MetaWebhooksSchemaResponse
|
|
23
|
+
from .outbound_email_opened_webhook_event import OutboundEmailOpenedWebhookEvent as OutboundEmailOpenedWebhookEvent
|
|
24
|
+
from .inbound_email_received_webhook_event import InboundEmailReceivedWebhookEvent as InboundEmailReceivedWebhookEvent
|
|
25
|
+
from .outbound_email_bounced_webhook_event import OutboundEmailBouncedWebhookEvent as OutboundEmailBouncedWebhookEvent
|
|
26
|
+
from .outbound_email_clicked_webhook_event import OutboundEmailClickedWebhookEvent as OutboundEmailClickedWebhookEvent
|
|
27
|
+
from .outbound_email_rejected_webhook_event import (
|
|
28
|
+
OutboundEmailRejectedWebhookEvent as OutboundEmailRejectedWebhookEvent,
|
|
29
|
+
)
|
|
30
|
+
from .outbound_email_delivered_webhook_event import (
|
|
31
|
+
OutboundEmailDeliveredWebhookEvent as OutboundEmailDeliveredWebhookEvent,
|
|
32
|
+
)
|
|
33
|
+
from .outbound_email_complained_webhook_event import (
|
|
34
|
+
OutboundEmailComplainedWebhookEvent as OutboundEmailComplainedWebhookEvent,
|
|
35
|
+
)
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
from datetime import datetime
|
|
5
|
+
from typing_extensions import Literal
|
|
6
|
+
|
|
7
|
+
from pydantic import Field as FieldInfo
|
|
8
|
+
|
|
9
|
+
from .._models import BaseModel
|
|
10
|
+
|
|
11
|
+
__all__ = ["InboundEmailReceivedWebhookEvent", "Data", "DataEmail", "DataEmailAttachment", "DataOrganization"]
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
class DataEmailAttachment(BaseModel):
|
|
15
|
+
id: str
|
|
16
|
+
|
|
17
|
+
content_type: str = FieldInfo(alias="contentType")
|
|
18
|
+
|
|
19
|
+
created_at: datetime = FieldInfo(alias="createdAt")
|
|
20
|
+
|
|
21
|
+
expires_at: datetime = FieldInfo(alias="expiresAt")
|
|
22
|
+
|
|
23
|
+
file_name: str = FieldInfo(alias="fileName")
|
|
24
|
+
|
|
25
|
+
signed_url: str = FieldInfo(alias="signedUrl")
|
|
26
|
+
|
|
27
|
+
size_in_bytes: float = FieldInfo(alias="sizeInBytes")
|
|
28
|
+
|
|
29
|
+
cid: Optional[str] = None
|
|
30
|
+
|
|
31
|
+
disposition: Optional[str] = None
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class DataEmail(BaseModel):
|
|
35
|
+
id: str
|
|
36
|
+
|
|
37
|
+
attachments: List[DataEmailAttachment]
|
|
38
|
+
|
|
39
|
+
bcc_addresses: List[str] = FieldInfo(alias="bccAddresses")
|
|
40
|
+
|
|
41
|
+
cc_addresses: List[str] = FieldInfo(alias="ccAddresses")
|
|
42
|
+
|
|
43
|
+
created_at: datetime = FieldInfo(alias="createdAt")
|
|
44
|
+
|
|
45
|
+
direction: Literal["INBOUND", "OUTBOUND"]
|
|
46
|
+
|
|
47
|
+
from_address: str = FieldInfo(alias="fromAddress")
|
|
48
|
+
|
|
49
|
+
message_id: str = FieldInfo(alias="messageId")
|
|
50
|
+
|
|
51
|
+
references: List[str]
|
|
52
|
+
|
|
53
|
+
reply_to_addresses: List[str] = FieldInfo(alias="replyToAddresses")
|
|
54
|
+
|
|
55
|
+
status: Literal[
|
|
56
|
+
"DRAFT",
|
|
57
|
+
"QUEUED",
|
|
58
|
+
"ACCEPTED",
|
|
59
|
+
"SENT",
|
|
60
|
+
"RECEIVED",
|
|
61
|
+
"FAILED",
|
|
62
|
+
"BOUNCED",
|
|
63
|
+
"COMPLAINED",
|
|
64
|
+
"REJECTED",
|
|
65
|
+
"READ",
|
|
66
|
+
"ARCHIVED",
|
|
67
|
+
]
|
|
68
|
+
|
|
69
|
+
thread_id: str = FieldInfo(alias="threadId")
|
|
70
|
+
|
|
71
|
+
to_addresses: List[str] = FieldInfo(alias="toAddresses")
|
|
72
|
+
|
|
73
|
+
from_name: Optional[str] = FieldInfo(alias="fromName", default=None)
|
|
74
|
+
|
|
75
|
+
html: Optional[str] = None
|
|
76
|
+
|
|
77
|
+
in_reply_to_id: Optional[str] = FieldInfo(alias="inReplyToId", default=None)
|
|
78
|
+
|
|
79
|
+
received_at: Optional[datetime] = FieldInfo(alias="receivedAt", default=None)
|
|
80
|
+
|
|
81
|
+
sent_at: Optional[datetime] = FieldInfo(alias="sentAt", default=None)
|
|
82
|
+
|
|
83
|
+
snippet: Optional[str] = None
|
|
84
|
+
|
|
85
|
+
stripped_html: Optional[str] = FieldInfo(alias="strippedHtml", default=None)
|
|
86
|
+
|
|
87
|
+
stripped_text: Optional[str] = FieldInfo(alias="strippedText", default=None)
|
|
88
|
+
|
|
89
|
+
subject: Optional[str] = None
|
|
90
|
+
|
|
91
|
+
text: Optional[str] = None
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class DataOrganization(BaseModel):
|
|
95
|
+
id: str
|
|
96
|
+
|
|
97
|
+
slug: str
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
class Data(BaseModel):
|
|
101
|
+
email: DataEmail
|
|
102
|
+
|
|
103
|
+
organization: DataOrganization
|
|
104
|
+
|
|
105
|
+
|
|
106
|
+
class InboundEmailReceivedWebhookEvent(BaseModel):
|
|
107
|
+
attempt: int
|
|
108
|
+
|
|
109
|
+
data: Data
|
|
110
|
+
|
|
111
|
+
event: Literal["inbound.email.received"]
|
|
112
|
+
|
|
113
|
+
timestamp: int
|