aiinbx 0.7.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.

Files changed (64) hide show
  1. aiinbx/__init__.py +92 -0
  2. aiinbx/_base_client.py +1995 -0
  3. aiinbx/_client.py +422 -0
  4. aiinbx/_compat.py +219 -0
  5. aiinbx/_constants.py +14 -0
  6. aiinbx/_exceptions.py +108 -0
  7. aiinbx/_files.py +123 -0
  8. aiinbx/_models.py +835 -0
  9. aiinbx/_qs.py +150 -0
  10. aiinbx/_resource.py +43 -0
  11. aiinbx/_response.py +830 -0
  12. aiinbx/_streaming.py +331 -0
  13. aiinbx/_types.py +260 -0
  14. aiinbx/_utils/__init__.py +64 -0
  15. aiinbx/_utils/_compat.py +45 -0
  16. aiinbx/_utils/_datetime_parse.py +136 -0
  17. aiinbx/_utils/_logs.py +25 -0
  18. aiinbx/_utils/_proxy.py +65 -0
  19. aiinbx/_utils/_reflection.py +42 -0
  20. aiinbx/_utils/_resources_proxy.py +24 -0
  21. aiinbx/_utils/_streams.py +12 -0
  22. aiinbx/_utils/_sync.py +86 -0
  23. aiinbx/_utils/_transform.py +457 -0
  24. aiinbx/_utils/_typing.py +156 -0
  25. aiinbx/_utils/_utils.py +421 -0
  26. aiinbx/_version.py +4 -0
  27. aiinbx/lib/.keep +4 -0
  28. aiinbx/py.typed +0 -0
  29. aiinbx/resources/__init__.py +64 -0
  30. aiinbx/resources/domains.py +455 -0
  31. aiinbx/resources/emails.py +451 -0
  32. aiinbx/resources/meta.py +147 -0
  33. aiinbx/resources/threads.py +468 -0
  34. aiinbx/resources/webhooks.py +34 -0
  35. aiinbx/types/__init__.py +35 -0
  36. aiinbx/types/domain_create_params.py +11 -0
  37. aiinbx/types/domain_create_response.py +26 -0
  38. aiinbx/types/domain_delete_response.py +11 -0
  39. aiinbx/types/domain_list_response.py +50 -0
  40. aiinbx/types/domain_retrieve_response.py +46 -0
  41. aiinbx/types/domain_verify_response.py +149 -0
  42. aiinbx/types/email_reply_params.py +47 -0
  43. aiinbx/types/email_reply_response.py +15 -0
  44. aiinbx/types/email_retrieve_response.py +90 -0
  45. aiinbx/types/email_send_params.py +53 -0
  46. aiinbx/types/email_send_response.py +15 -0
  47. aiinbx/types/inbound_email_received_webhook_event.py +113 -0
  48. aiinbx/types/meta_webhooks_schema_response.py +298 -0
  49. aiinbx/types/outbound_email_bounced_webhook_event.py +44 -0
  50. aiinbx/types/outbound_email_clicked_webhook_event.py +36 -0
  51. aiinbx/types/outbound_email_complained_webhook_event.py +36 -0
  52. aiinbx/types/outbound_email_delivered_webhook_event.py +36 -0
  53. aiinbx/types/outbound_email_opened_webhook_event.py +32 -0
  54. aiinbx/types/outbound_email_rejected_webhook_event.py +30 -0
  55. aiinbx/types/thread_forward_params.py +43 -0
  56. aiinbx/types/thread_forward_response.py +15 -0
  57. aiinbx/types/thread_retrieve_response.py +100 -0
  58. aiinbx/types/thread_search_params.py +61 -0
  59. aiinbx/types/thread_search_response.py +43 -0
  60. aiinbx/types/unwrap_webhook_event.py +24 -0
  61. aiinbx-0.7.0.dist-info/METADATA +398 -0
  62. aiinbx-0.7.0.dist-info/RECORD +64 -0
  63. aiinbx-0.7.0.dist-info/WHEEL +4 -0
  64. aiinbx-0.7.0.dist-info/licenses/LICENSE +201 -0
@@ -0,0 +1,451 @@
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 Union, Iterable
6
+
7
+ import httpx
8
+
9
+ from ..types import email_send_params, email_reply_params
10
+ from .._types import Body, Omit, Query, Headers, NotGiven, SequenceNotStr, omit, not_given
11
+ from .._utils import maybe_transform, async_maybe_transform
12
+ from .._compat import cached_property
13
+ from .._resource import SyncAPIResource, AsyncAPIResource
14
+ from .._response import (
15
+ to_raw_response_wrapper,
16
+ to_streamed_response_wrapper,
17
+ async_to_raw_response_wrapper,
18
+ async_to_streamed_response_wrapper,
19
+ )
20
+ from .._base_client import make_request_options
21
+ from ..types.email_send_response import EmailSendResponse
22
+ from ..types.email_reply_response import EmailReplyResponse
23
+ from ..types.email_retrieve_response import EmailRetrieveResponse
24
+
25
+ __all__ = ["EmailsResource", "AsyncEmailsResource"]
26
+
27
+
28
+ class EmailsResource(SyncAPIResource):
29
+ @cached_property
30
+ def with_raw_response(self) -> EmailsResourceWithRawResponse:
31
+ """
32
+ This property can be used as a prefix for any HTTP method call to return
33
+ the raw response object instead of the parsed content.
34
+
35
+ For more information, see https://www.github.com/aiinbx/aiinbx-py#accessing-raw-response-data-eg-headers
36
+ """
37
+ return EmailsResourceWithRawResponse(self)
38
+
39
+ @cached_property
40
+ def with_streaming_response(self) -> EmailsResourceWithStreamingResponse:
41
+ """
42
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
43
+
44
+ For more information, see https://www.github.com/aiinbx/aiinbx-py#with_streaming_response
45
+ """
46
+ return EmailsResourceWithStreamingResponse(self)
47
+
48
+ def retrieve(
49
+ self,
50
+ email_id: str,
51
+ *,
52
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
53
+ # The extra values given here take precedence over values defined on the client or passed to this method.
54
+ extra_headers: Headers | None = None,
55
+ extra_query: Query | None = None,
56
+ extra_body: Body | None = None,
57
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
58
+ ) -> EmailRetrieveResponse:
59
+ """
60
+ Retrieve a specific email by its ID using API key authentication
61
+
62
+ Args:
63
+ extra_headers: Send extra headers
64
+
65
+ extra_query: Add additional query parameters to the request
66
+
67
+ extra_body: Add additional JSON properties to the request
68
+
69
+ timeout: Override the client-level default timeout for this request, in seconds
70
+ """
71
+ if not email_id:
72
+ raise ValueError(f"Expected a non-empty value for `email_id` but received {email_id!r}")
73
+ return self._get(
74
+ f"/emails/{email_id}",
75
+ options=make_request_options(
76
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
77
+ ),
78
+ cast_to=EmailRetrieveResponse,
79
+ )
80
+
81
+ def reply(
82
+ self,
83
+ email_id: str,
84
+ *,
85
+ from_: str,
86
+ html: str,
87
+ attachments: Iterable[email_reply_params.Attachment] | Omit = omit,
88
+ bcc: Union[str, SequenceNotStr[str]] | Omit = omit,
89
+ cc: Union[str, SequenceNotStr[str]] | Omit = omit,
90
+ from_name: str | Omit = omit,
91
+ is_draft: bool | Omit = omit,
92
+ reply_all: bool | Omit = omit,
93
+ subject: str | Omit = omit,
94
+ text: str | Omit = omit,
95
+ to: Union[str, SequenceNotStr[str]] | Omit = omit,
96
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
97
+ # The extra values given here take precedence over values defined on the client or passed to this method.
98
+ extra_headers: Headers | None = None,
99
+ extra_query: Query | None = None,
100
+ extra_body: Body | None = None,
101
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
102
+ ) -> EmailReplyResponse:
103
+ """Reply to an existing email.
104
+
105
+ Automatically handles reply headers (In-Reply-To,
106
+ References) and thread association. The reply will be sent from a verified
107
+ domain belonging to the organization.
108
+
109
+ Args:
110
+ extra_headers: Send extra headers
111
+
112
+ extra_query: Add additional query parameters to the request
113
+
114
+ extra_body: Add additional JSON properties to the request
115
+
116
+ timeout: Override the client-level default timeout for this request, in seconds
117
+ """
118
+ if not email_id:
119
+ raise ValueError(f"Expected a non-empty value for `email_id` but received {email_id!r}")
120
+ return self._post(
121
+ f"/emails/{email_id}/reply",
122
+ body=maybe_transform(
123
+ {
124
+ "from_": from_,
125
+ "html": html,
126
+ "attachments": attachments,
127
+ "bcc": bcc,
128
+ "cc": cc,
129
+ "from_name": from_name,
130
+ "is_draft": is_draft,
131
+ "reply_all": reply_all,
132
+ "subject": subject,
133
+ "text": text,
134
+ "to": to,
135
+ },
136
+ email_reply_params.EmailReplyParams,
137
+ ),
138
+ options=make_request_options(
139
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
140
+ ),
141
+ cast_to=EmailReplyResponse,
142
+ )
143
+
144
+ def send(
145
+ self,
146
+ *,
147
+ from_: str,
148
+ html: str,
149
+ subject: str,
150
+ to: Union[str, SequenceNotStr[str]],
151
+ attachments: Iterable[email_send_params.Attachment] | Omit = omit,
152
+ bcc: Union[str, SequenceNotStr[str]] | Omit = omit,
153
+ cc: Union[str, SequenceNotStr[str]] | Omit = omit,
154
+ from_name: str | Omit = omit,
155
+ in_reply_to: str | Omit = omit,
156
+ is_draft: bool | Omit = omit,
157
+ references: SequenceNotStr[str] | Omit = omit,
158
+ reply_to: Union[str, SequenceNotStr[str]] | Omit = omit,
159
+ text: str | Omit = omit,
160
+ thread_id: str | Omit = omit,
161
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
162
+ # The extra values given here take precedence over values defined on the client or passed to this method.
163
+ extra_headers: Headers | None = None,
164
+ extra_query: Query | None = None,
165
+ extra_body: Body | None = None,
166
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
167
+ ) -> EmailSendResponse:
168
+ """Send an email from a verified domain belonging to the organization.
169
+
170
+ Useful for
171
+ transactional or conversational messages. Returns metadata including identifiers
172
+ for further queries.
173
+
174
+ Args:
175
+ extra_headers: Send extra headers
176
+
177
+ extra_query: Add additional query parameters to the request
178
+
179
+ extra_body: Add additional JSON properties to the request
180
+
181
+ timeout: Override the client-level default timeout for this request, in seconds
182
+ """
183
+ return self._post(
184
+ "/emails/send",
185
+ body=maybe_transform(
186
+ {
187
+ "from_": from_,
188
+ "html": html,
189
+ "subject": subject,
190
+ "to": to,
191
+ "attachments": attachments,
192
+ "bcc": bcc,
193
+ "cc": cc,
194
+ "from_name": from_name,
195
+ "in_reply_to": in_reply_to,
196
+ "is_draft": is_draft,
197
+ "references": references,
198
+ "reply_to": reply_to,
199
+ "text": text,
200
+ "thread_id": thread_id,
201
+ },
202
+ email_send_params.EmailSendParams,
203
+ ),
204
+ options=make_request_options(
205
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
206
+ ),
207
+ cast_to=EmailSendResponse,
208
+ )
209
+
210
+
211
+ class AsyncEmailsResource(AsyncAPIResource):
212
+ @cached_property
213
+ def with_raw_response(self) -> AsyncEmailsResourceWithRawResponse:
214
+ """
215
+ This property can be used as a prefix for any HTTP method call to return
216
+ the raw response object instead of the parsed content.
217
+
218
+ For more information, see https://www.github.com/aiinbx/aiinbx-py#accessing-raw-response-data-eg-headers
219
+ """
220
+ return AsyncEmailsResourceWithRawResponse(self)
221
+
222
+ @cached_property
223
+ def with_streaming_response(self) -> AsyncEmailsResourceWithStreamingResponse:
224
+ """
225
+ An alternative to `.with_raw_response` that doesn't eagerly read the response body.
226
+
227
+ For more information, see https://www.github.com/aiinbx/aiinbx-py#with_streaming_response
228
+ """
229
+ return AsyncEmailsResourceWithStreamingResponse(self)
230
+
231
+ async def retrieve(
232
+ self,
233
+ email_id: str,
234
+ *,
235
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
236
+ # The extra values given here take precedence over values defined on the client or passed to this method.
237
+ extra_headers: Headers | None = None,
238
+ extra_query: Query | None = None,
239
+ extra_body: Body | None = None,
240
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
241
+ ) -> EmailRetrieveResponse:
242
+ """
243
+ Retrieve a specific email by its ID using API key authentication
244
+
245
+ Args:
246
+ extra_headers: Send extra headers
247
+
248
+ extra_query: Add additional query parameters to the request
249
+
250
+ extra_body: Add additional JSON properties to the request
251
+
252
+ timeout: Override the client-level default timeout for this request, in seconds
253
+ """
254
+ if not email_id:
255
+ raise ValueError(f"Expected a non-empty value for `email_id` but received {email_id!r}")
256
+ return await self._get(
257
+ f"/emails/{email_id}",
258
+ options=make_request_options(
259
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
260
+ ),
261
+ cast_to=EmailRetrieveResponse,
262
+ )
263
+
264
+ async def reply(
265
+ self,
266
+ email_id: str,
267
+ *,
268
+ from_: str,
269
+ html: str,
270
+ attachments: Iterable[email_reply_params.Attachment] | Omit = omit,
271
+ bcc: Union[str, SequenceNotStr[str]] | Omit = omit,
272
+ cc: Union[str, SequenceNotStr[str]] | Omit = omit,
273
+ from_name: str | Omit = omit,
274
+ is_draft: bool | Omit = omit,
275
+ reply_all: bool | Omit = omit,
276
+ subject: str | Omit = omit,
277
+ text: str | Omit = omit,
278
+ to: Union[str, SequenceNotStr[str]] | Omit = omit,
279
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
280
+ # The extra values given here take precedence over values defined on the client or passed to this method.
281
+ extra_headers: Headers | None = None,
282
+ extra_query: Query | None = None,
283
+ extra_body: Body | None = None,
284
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
285
+ ) -> EmailReplyResponse:
286
+ """Reply to an existing email.
287
+
288
+ Automatically handles reply headers (In-Reply-To,
289
+ References) and thread association. The reply will be sent from a verified
290
+ domain belonging to the organization.
291
+
292
+ Args:
293
+ extra_headers: Send extra headers
294
+
295
+ extra_query: Add additional query parameters to the request
296
+
297
+ extra_body: Add additional JSON properties to the request
298
+
299
+ timeout: Override the client-level default timeout for this request, in seconds
300
+ """
301
+ if not email_id:
302
+ raise ValueError(f"Expected a non-empty value for `email_id` but received {email_id!r}")
303
+ return await self._post(
304
+ f"/emails/{email_id}/reply",
305
+ body=await async_maybe_transform(
306
+ {
307
+ "from_": from_,
308
+ "html": html,
309
+ "attachments": attachments,
310
+ "bcc": bcc,
311
+ "cc": cc,
312
+ "from_name": from_name,
313
+ "is_draft": is_draft,
314
+ "reply_all": reply_all,
315
+ "subject": subject,
316
+ "text": text,
317
+ "to": to,
318
+ },
319
+ email_reply_params.EmailReplyParams,
320
+ ),
321
+ options=make_request_options(
322
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
323
+ ),
324
+ cast_to=EmailReplyResponse,
325
+ )
326
+
327
+ async def send(
328
+ self,
329
+ *,
330
+ from_: str,
331
+ html: str,
332
+ subject: str,
333
+ to: Union[str, SequenceNotStr[str]],
334
+ attachments: Iterable[email_send_params.Attachment] | Omit = omit,
335
+ bcc: Union[str, SequenceNotStr[str]] | Omit = omit,
336
+ cc: Union[str, SequenceNotStr[str]] | Omit = omit,
337
+ from_name: str | Omit = omit,
338
+ in_reply_to: str | Omit = omit,
339
+ is_draft: bool | Omit = omit,
340
+ references: SequenceNotStr[str] | Omit = omit,
341
+ reply_to: Union[str, SequenceNotStr[str]] | Omit = omit,
342
+ text: str | Omit = omit,
343
+ thread_id: str | Omit = omit,
344
+ # Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
345
+ # The extra values given here take precedence over values defined on the client or passed to this method.
346
+ extra_headers: Headers | None = None,
347
+ extra_query: Query | None = None,
348
+ extra_body: Body | None = None,
349
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
350
+ ) -> EmailSendResponse:
351
+ """Send an email from a verified domain belonging to the organization.
352
+
353
+ Useful for
354
+ transactional or conversational messages. Returns metadata including identifiers
355
+ for further queries.
356
+
357
+ Args:
358
+ extra_headers: Send extra headers
359
+
360
+ extra_query: Add additional query parameters to the request
361
+
362
+ extra_body: Add additional JSON properties to the request
363
+
364
+ timeout: Override the client-level default timeout for this request, in seconds
365
+ """
366
+ return await self._post(
367
+ "/emails/send",
368
+ body=await async_maybe_transform(
369
+ {
370
+ "from_": from_,
371
+ "html": html,
372
+ "subject": subject,
373
+ "to": to,
374
+ "attachments": attachments,
375
+ "bcc": bcc,
376
+ "cc": cc,
377
+ "from_name": from_name,
378
+ "in_reply_to": in_reply_to,
379
+ "is_draft": is_draft,
380
+ "references": references,
381
+ "reply_to": reply_to,
382
+ "text": text,
383
+ "thread_id": thread_id,
384
+ },
385
+ email_send_params.EmailSendParams,
386
+ ),
387
+ options=make_request_options(
388
+ extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
389
+ ),
390
+ cast_to=EmailSendResponse,
391
+ )
392
+
393
+
394
+ class EmailsResourceWithRawResponse:
395
+ def __init__(self, emails: EmailsResource) -> None:
396
+ self._emails = emails
397
+
398
+ self.retrieve = to_raw_response_wrapper(
399
+ emails.retrieve,
400
+ )
401
+ self.reply = to_raw_response_wrapper(
402
+ emails.reply,
403
+ )
404
+ self.send = to_raw_response_wrapper(
405
+ emails.send,
406
+ )
407
+
408
+
409
+ class AsyncEmailsResourceWithRawResponse:
410
+ def __init__(self, emails: AsyncEmailsResource) -> None:
411
+ self._emails = emails
412
+
413
+ self.retrieve = async_to_raw_response_wrapper(
414
+ emails.retrieve,
415
+ )
416
+ self.reply = async_to_raw_response_wrapper(
417
+ emails.reply,
418
+ )
419
+ self.send = async_to_raw_response_wrapper(
420
+ emails.send,
421
+ )
422
+
423
+
424
+ class EmailsResourceWithStreamingResponse:
425
+ def __init__(self, emails: EmailsResource) -> None:
426
+ self._emails = emails
427
+
428
+ self.retrieve = to_streamed_response_wrapper(
429
+ emails.retrieve,
430
+ )
431
+ self.reply = to_streamed_response_wrapper(
432
+ emails.reply,
433
+ )
434
+ self.send = to_streamed_response_wrapper(
435
+ emails.send,
436
+ )
437
+
438
+
439
+ class AsyncEmailsResourceWithStreamingResponse:
440
+ def __init__(self, emails: AsyncEmailsResource) -> None:
441
+ self._emails = emails
442
+
443
+ self.retrieve = async_to_streamed_response_wrapper(
444
+ emails.retrieve,
445
+ )
446
+ self.reply = async_to_streamed_response_wrapper(
447
+ emails.reply,
448
+ )
449
+ self.send = async_to_streamed_response_wrapper(
450
+ emails.send,
451
+ )
@@ -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
+ )