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