aiinbx 0.3.0__py3-none-any.whl → 0.5.0__py3-none-any.whl
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.
Potentially problematic release.
This version of aiinbx might be problematic. Click here for more details.
- aiinbx/__init__.py +3 -1
- aiinbx/_base_client.py +12 -12
- aiinbx/_client.py +29 -9
- aiinbx/_compat.py +48 -48
- aiinbx/_models.py +50 -44
- aiinbx/_qs.py +7 -7
- aiinbx/_types.py +53 -12
- aiinbx/_utils/__init__.py +9 -2
- aiinbx/_utils/_compat.py +45 -0
- aiinbx/_utils/_datetime_parse.py +136 -0
- aiinbx/_utils/_transform.py +13 -3
- aiinbx/_utils/_typing.py +6 -1
- aiinbx/_utils/_utils.py +4 -5
- aiinbx/_version.py +1 -1
- aiinbx/resources/__init__.py +31 -0
- aiinbx/resources/domains.py +455 -0
- aiinbx/resources/emails.py +44 -44
- aiinbx/resources/meta.py +147 -0
- aiinbx/resources/threads.py +56 -56
- aiinbx/resources/webhooks.py +34 -0
- aiinbx/types/__init__.py +21 -0
- aiinbx/types/domain_create_params.py +11 -0
- aiinbx/types/domain_create_response.py +26 -0
- aiinbx/types/domain_delete_response.py +11 -0
- aiinbx/types/domain_list_response.py +48 -0
- aiinbx/types/domain_retrieve_response.py +44 -0
- aiinbx/types/domain_verify_response.py +147 -0
- aiinbx/types/email_reply_params.py +5 -4
- aiinbx/types/email_send_params.py +7 -6
- aiinbx/types/inbound_email_received_webhook_event.py +113 -0
- aiinbx/types/meta_webhooks_schema_response.py +298 -0
- aiinbx/types/outbound_email_bounced_webhook_event.py +44 -0
- aiinbx/types/outbound_email_clicked_webhook_event.py +36 -0
- aiinbx/types/outbound_email_complained_webhook_event.py +36 -0
- aiinbx/types/outbound_email_delivered_webhook_event.py +36 -0
- aiinbx/types/outbound_email_opened_webhook_event.py +32 -0
- aiinbx/types/outbound_email_rejected_webhook_event.py +30 -0
- aiinbx/types/thread_forward_params.py +5 -4
- aiinbx/types/thread_search_params.py +2 -2
- aiinbx/types/unwrap_webhook_event.py +24 -0
- {aiinbx-0.3.0.dist-info → aiinbx-0.5.0.dist-info}/METADATA +1 -1
- aiinbx-0.5.0.dist-info/RECORD +64 -0
- aiinbx-0.3.0.dist-info/RECORD +0 -44
- {aiinbx-0.3.0.dist-info → aiinbx-0.5.0.dist-info}/WHEEL +0 -0
- {aiinbx-0.3.0.dist-info → aiinbx-0.5.0.dist-info}/licenses/LICENSE +0 -0
aiinbx/resources/meta.py
ADDED
|
@@ -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
|
+
)
|
aiinbx/resources/threads.py
CHANGED
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
|
-
from typing import
|
|
5
|
+
from typing import Union
|
|
6
6
|
from typing_extensions import Literal
|
|
7
7
|
|
|
8
8
|
import httpx
|
|
9
9
|
|
|
10
10
|
from ..types import thread_search_params, thread_forward_params
|
|
11
|
-
from .._types import
|
|
11
|
+
from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
|
|
12
12
|
from .._utils import maybe_transform, async_maybe_transform
|
|
13
13
|
from .._compat import cached_property
|
|
14
14
|
from .._resource import SyncAPIResource, AsyncAPIResource
|
|
@@ -55,7 +55,7 @@ class ThreadsResource(SyncAPIResource):
|
|
|
55
55
|
extra_headers: Headers | None = None,
|
|
56
56
|
extra_query: Query | None = None,
|
|
57
57
|
extra_body: Body | None = None,
|
|
58
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
58
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
59
59
|
) -> ThreadRetrieveResponse:
|
|
60
60
|
"""
|
|
61
61
|
Retrieve a specific thread with all its emails by thread ID using API key
|
|
@@ -84,20 +84,20 @@ class ThreadsResource(SyncAPIResource):
|
|
|
84
84
|
self,
|
|
85
85
|
thread_id: str,
|
|
86
86
|
*,
|
|
87
|
-
to: Union[str,
|
|
88
|
-
bcc: Union[str,
|
|
89
|
-
cc: Union[str,
|
|
90
|
-
from_: str |
|
|
91
|
-
from_name: str |
|
|
92
|
-
include_attachments: bool |
|
|
93
|
-
is_draft: bool |
|
|
94
|
-
note: str |
|
|
87
|
+
to: Union[str, SequenceNotStr[str]],
|
|
88
|
+
bcc: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
89
|
+
cc: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
90
|
+
from_: str | Omit = omit,
|
|
91
|
+
from_name: str | Omit = omit,
|
|
92
|
+
include_attachments: bool | Omit = omit,
|
|
93
|
+
is_draft: bool | Omit = omit,
|
|
94
|
+
note: str | Omit = omit,
|
|
95
95
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
96
96
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
97
97
|
extra_headers: Headers | None = None,
|
|
98
98
|
extra_query: Query | None = None,
|
|
99
99
|
extra_body: Body | None = None,
|
|
100
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
100
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
101
101
|
) -> ThreadForwardResponse:
|
|
102
102
|
"""
|
|
103
103
|
Forward the entire thread as a readable transcript.
|
|
@@ -137,17 +137,17 @@ class ThreadsResource(SyncAPIResource):
|
|
|
137
137
|
def search(
|
|
138
138
|
self,
|
|
139
139
|
*,
|
|
140
|
-
conversation_state: Literal["awaiting_reply", "needs_reply", "active", "stale"] |
|
|
141
|
-
created_after: str |
|
|
142
|
-
created_before: str |
|
|
143
|
-
has_email_from_address: str |
|
|
144
|
-
has_email_to_address: str |
|
|
145
|
-
has_participant_emails:
|
|
146
|
-
last_email_after: str |
|
|
147
|
-
last_email_before: str |
|
|
148
|
-
limit: float |
|
|
149
|
-
offset: float |
|
|
150
|
-
some_email_has_direction: Literal["INBOUND", "OUTBOUND"] |
|
|
140
|
+
conversation_state: Literal["awaiting_reply", "needs_reply", "active", "stale"] | Omit = omit,
|
|
141
|
+
created_after: str | Omit = omit,
|
|
142
|
+
created_before: str | Omit = omit,
|
|
143
|
+
has_email_from_address: str | Omit = omit,
|
|
144
|
+
has_email_to_address: str | Omit = omit,
|
|
145
|
+
has_participant_emails: SequenceNotStr[str] | Omit = omit,
|
|
146
|
+
last_email_after: str | Omit = omit,
|
|
147
|
+
last_email_before: str | Omit = omit,
|
|
148
|
+
limit: float | Omit = omit,
|
|
149
|
+
offset: float | Omit = omit,
|
|
150
|
+
some_email_has_direction: Literal["INBOUND", "OUTBOUND"] | Omit = omit,
|
|
151
151
|
some_email_has_status: Literal[
|
|
152
152
|
"DRAFT",
|
|
153
153
|
"QUEUED",
|
|
@@ -161,17 +161,17 @@ class ThreadsResource(SyncAPIResource):
|
|
|
161
161
|
"READ",
|
|
162
162
|
"ARCHIVED",
|
|
163
163
|
]
|
|
164
|
-
|
|
|
165
|
-
sort_by: Literal["createdAt", "lastEmailAt", "subject"] |
|
|
166
|
-
sort_order: Literal["asc", "desc"] |
|
|
167
|
-
stale_threshold_days: float |
|
|
168
|
-
subject_contains: str |
|
|
164
|
+
| Omit = omit,
|
|
165
|
+
sort_by: Literal["createdAt", "lastEmailAt", "subject"] | Omit = omit,
|
|
166
|
+
sort_order: Literal["asc", "desc"] | Omit = omit,
|
|
167
|
+
stale_threshold_days: float | Omit = omit,
|
|
168
|
+
subject_contains: str | Omit = omit,
|
|
169
169
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
170
170
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
171
171
|
extra_headers: Headers | None = None,
|
|
172
172
|
extra_query: Query | None = None,
|
|
173
173
|
extra_body: Body | None = None,
|
|
174
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
174
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
175
175
|
) -> ThreadSearchResponse:
|
|
176
176
|
"""
|
|
177
177
|
Search threads with various filtering options optimized for AI agents
|
|
@@ -244,7 +244,7 @@ class AsyncThreadsResource(AsyncAPIResource):
|
|
|
244
244
|
extra_headers: Headers | None = None,
|
|
245
245
|
extra_query: Query | None = None,
|
|
246
246
|
extra_body: Body | None = None,
|
|
247
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
247
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
248
248
|
) -> ThreadRetrieveResponse:
|
|
249
249
|
"""
|
|
250
250
|
Retrieve a specific thread with all its emails by thread ID using API key
|
|
@@ -273,20 +273,20 @@ class AsyncThreadsResource(AsyncAPIResource):
|
|
|
273
273
|
self,
|
|
274
274
|
thread_id: str,
|
|
275
275
|
*,
|
|
276
|
-
to: Union[str,
|
|
277
|
-
bcc: Union[str,
|
|
278
|
-
cc: Union[str,
|
|
279
|
-
from_: str |
|
|
280
|
-
from_name: str |
|
|
281
|
-
include_attachments: bool |
|
|
282
|
-
is_draft: bool |
|
|
283
|
-
note: str |
|
|
276
|
+
to: Union[str, SequenceNotStr[str]],
|
|
277
|
+
bcc: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
278
|
+
cc: Union[str, SequenceNotStr[str]] | Omit = omit,
|
|
279
|
+
from_: str | Omit = omit,
|
|
280
|
+
from_name: str | Omit = omit,
|
|
281
|
+
include_attachments: bool | Omit = omit,
|
|
282
|
+
is_draft: bool | Omit = omit,
|
|
283
|
+
note: str | Omit = omit,
|
|
284
284
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
285
285
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
286
286
|
extra_headers: Headers | None = None,
|
|
287
287
|
extra_query: Query | None = None,
|
|
288
288
|
extra_body: Body | None = None,
|
|
289
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
289
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
290
290
|
) -> ThreadForwardResponse:
|
|
291
291
|
"""
|
|
292
292
|
Forward the entire thread as a readable transcript.
|
|
@@ -326,17 +326,17 @@ class AsyncThreadsResource(AsyncAPIResource):
|
|
|
326
326
|
async def search(
|
|
327
327
|
self,
|
|
328
328
|
*,
|
|
329
|
-
conversation_state: Literal["awaiting_reply", "needs_reply", "active", "stale"] |
|
|
330
|
-
created_after: str |
|
|
331
|
-
created_before: str |
|
|
332
|
-
has_email_from_address: str |
|
|
333
|
-
has_email_to_address: str |
|
|
334
|
-
has_participant_emails:
|
|
335
|
-
last_email_after: str |
|
|
336
|
-
last_email_before: str |
|
|
337
|
-
limit: float |
|
|
338
|
-
offset: float |
|
|
339
|
-
some_email_has_direction: Literal["INBOUND", "OUTBOUND"] |
|
|
329
|
+
conversation_state: Literal["awaiting_reply", "needs_reply", "active", "stale"] | Omit = omit,
|
|
330
|
+
created_after: str | Omit = omit,
|
|
331
|
+
created_before: str | Omit = omit,
|
|
332
|
+
has_email_from_address: str | Omit = omit,
|
|
333
|
+
has_email_to_address: str | Omit = omit,
|
|
334
|
+
has_participant_emails: SequenceNotStr[str] | Omit = omit,
|
|
335
|
+
last_email_after: str | Omit = omit,
|
|
336
|
+
last_email_before: str | Omit = omit,
|
|
337
|
+
limit: float | Omit = omit,
|
|
338
|
+
offset: float | Omit = omit,
|
|
339
|
+
some_email_has_direction: Literal["INBOUND", "OUTBOUND"] | Omit = omit,
|
|
340
340
|
some_email_has_status: Literal[
|
|
341
341
|
"DRAFT",
|
|
342
342
|
"QUEUED",
|
|
@@ -350,17 +350,17 @@ class AsyncThreadsResource(AsyncAPIResource):
|
|
|
350
350
|
"READ",
|
|
351
351
|
"ARCHIVED",
|
|
352
352
|
]
|
|
353
|
-
|
|
|
354
|
-
sort_by: Literal["createdAt", "lastEmailAt", "subject"] |
|
|
355
|
-
sort_order: Literal["asc", "desc"] |
|
|
356
|
-
stale_threshold_days: float |
|
|
357
|
-
subject_contains: str |
|
|
353
|
+
| Omit = omit,
|
|
354
|
+
sort_by: Literal["createdAt", "lastEmailAt", "subject"] | Omit = omit,
|
|
355
|
+
sort_order: Literal["asc", "desc"] | Omit = omit,
|
|
356
|
+
stale_threshold_days: float | Omit = omit,
|
|
357
|
+
subject_contains: str | Omit = omit,
|
|
358
358
|
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
|
|
359
359
|
# The extra values given here take precedence over values defined on the client or passed to this method.
|
|
360
360
|
extra_headers: Headers | None = None,
|
|
361
361
|
extra_query: Query | None = None,
|
|
362
362
|
extra_body: Body | None = None,
|
|
363
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
363
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
364
364
|
) -> ThreadSearchResponse:
|
|
365
365
|
"""
|
|
366
366
|
Search threads with various filtering options optimized for AI agents
|
|
@@ -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
|
+
)
|
aiinbx/types/__init__.py
CHANGED
|
@@ -5,10 +5,31 @@ from __future__ import annotations
|
|
|
5
5
|
from .email_send_params import EmailSendParams as EmailSendParams
|
|
6
6
|
from .email_reply_params import EmailReplyParams as EmailReplyParams
|
|
7
7
|
from .email_send_response import EmailSendResponse as EmailSendResponse
|
|
8
|
+
from .domain_create_params import DomainCreateParams as DomainCreateParams
|
|
9
|
+
from .domain_list_response import DomainListResponse as DomainListResponse
|
|
8
10
|
from .email_reply_response import EmailReplyResponse as EmailReplyResponse
|
|
9
11
|
from .thread_search_params import ThreadSearchParams as ThreadSearchParams
|
|
12
|
+
from .unwrap_webhook_event import UnwrapWebhookEvent as UnwrapWebhookEvent
|
|
10
13
|
from .thread_forward_params import ThreadForwardParams as ThreadForwardParams
|
|
14
|
+
from .domain_create_response import DomainCreateResponse as DomainCreateResponse
|
|
15
|
+
from .domain_delete_response import DomainDeleteResponse as DomainDeleteResponse
|
|
16
|
+
from .domain_verify_response import DomainVerifyResponse as DomainVerifyResponse
|
|
11
17
|
from .thread_search_response import ThreadSearchResponse as ThreadSearchResponse
|
|
12
18
|
from .email_retrieve_response import EmailRetrieveResponse as EmailRetrieveResponse
|
|
13
19
|
from .thread_forward_response import ThreadForwardResponse as ThreadForwardResponse
|
|
20
|
+
from .domain_retrieve_response import DomainRetrieveResponse as DomainRetrieveResponse
|
|
14
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,11 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing_extensions import Required, TypedDict
|
|
6
|
+
|
|
7
|
+
__all__ = ["DomainCreateParams"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DomainCreateParams(TypedDict, total=False):
|
|
11
|
+
domain: Required[str]
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from pydantic import Field as FieldInfo
|
|
7
|
+
|
|
8
|
+
from .._models import BaseModel
|
|
9
|
+
|
|
10
|
+
__all__ = ["DomainCreateResponse", "Record"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class Record(BaseModel):
|
|
14
|
+
name: str
|
|
15
|
+
|
|
16
|
+
type: Literal["TXT", "CNAME", "MX"]
|
|
17
|
+
|
|
18
|
+
value: str
|
|
19
|
+
|
|
20
|
+
priority: Optional[float] = None
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
class DomainCreateResponse(BaseModel):
|
|
24
|
+
domain_id: str = FieldInfo(alias="domainId")
|
|
25
|
+
|
|
26
|
+
records: List[Record]
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing_extensions import Literal
|
|
4
|
+
|
|
5
|
+
from .._models import BaseModel
|
|
6
|
+
|
|
7
|
+
__all__ = ["DomainDeleteResponse"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
class DomainDeleteResponse(BaseModel):
|
|
11
|
+
success: Literal[True]
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from pydantic import Field as FieldInfo
|
|
7
|
+
|
|
8
|
+
from .._models import BaseModel
|
|
9
|
+
|
|
10
|
+
__all__ = ["DomainListResponse", "Domain", "DomainDNSRecord"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class DomainDNSRecord(BaseModel):
|
|
14
|
+
name: str
|
|
15
|
+
|
|
16
|
+
type: Literal["TXT", "CNAME", "MX"]
|
|
17
|
+
|
|
18
|
+
value: str
|
|
19
|
+
|
|
20
|
+
is_verified: Optional[bool] = FieldInfo(alias="isVerified", default=None)
|
|
21
|
+
|
|
22
|
+
last_checked_at: Optional[str] = FieldInfo(alias="lastCheckedAt", default=None)
|
|
23
|
+
|
|
24
|
+
priority: Optional[float] = None
|
|
25
|
+
|
|
26
|
+
verification_status: Optional[Literal["verified", "missing", "pending"]] = FieldInfo(
|
|
27
|
+
alias="verificationStatus", default=None
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class Domain(BaseModel):
|
|
32
|
+
id: str
|
|
33
|
+
|
|
34
|
+
created_at: str = FieldInfo(alias="createdAt")
|
|
35
|
+
|
|
36
|
+
domain: str
|
|
37
|
+
|
|
38
|
+
status: Literal["VERIFIED", "PENDING_VERIFICATION", "NOT_REGISTERED"]
|
|
39
|
+
|
|
40
|
+
updated_at: str = FieldInfo(alias="updatedAt")
|
|
41
|
+
|
|
42
|
+
verified_at: Optional[str] = FieldInfo(alias="verifiedAt", default=None)
|
|
43
|
+
|
|
44
|
+
dns_records: Optional[List[DomainDNSRecord]] = FieldInfo(alias="dnsRecords", default=None)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class DomainListResponse(BaseModel):
|
|
48
|
+
domains: List[Domain]
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
from typing import List, Optional
|
|
4
|
+
from typing_extensions import Literal
|
|
5
|
+
|
|
6
|
+
from pydantic import Field as FieldInfo
|
|
7
|
+
|
|
8
|
+
from .._models import BaseModel
|
|
9
|
+
|
|
10
|
+
__all__ = ["DomainRetrieveResponse", "DNSRecord"]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class DNSRecord(BaseModel):
|
|
14
|
+
name: str
|
|
15
|
+
|
|
16
|
+
type: Literal["TXT", "CNAME", "MX"]
|
|
17
|
+
|
|
18
|
+
value: str
|
|
19
|
+
|
|
20
|
+
is_verified: Optional[bool] = FieldInfo(alias="isVerified", default=None)
|
|
21
|
+
|
|
22
|
+
last_checked_at: Optional[str] = FieldInfo(alias="lastCheckedAt", default=None)
|
|
23
|
+
|
|
24
|
+
priority: Optional[float] = None
|
|
25
|
+
|
|
26
|
+
verification_status: Optional[Literal["verified", "missing", "pending"]] = FieldInfo(
|
|
27
|
+
alias="verificationStatus", default=None
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
class DomainRetrieveResponse(BaseModel):
|
|
32
|
+
id: str
|
|
33
|
+
|
|
34
|
+
created_at: str = FieldInfo(alias="createdAt")
|
|
35
|
+
|
|
36
|
+
domain: str
|
|
37
|
+
|
|
38
|
+
status: Literal["VERIFIED", "PENDING_VERIFICATION", "NOT_REGISTERED"]
|
|
39
|
+
|
|
40
|
+
updated_at: str = FieldInfo(alias="updatedAt")
|
|
41
|
+
|
|
42
|
+
verified_at: Optional[str] = FieldInfo(alias="verifiedAt", default=None)
|
|
43
|
+
|
|
44
|
+
dns_records: Optional[List[DNSRecord]] = FieldInfo(alias="dnsRecords", default=None)
|