aiinbx 0.3.0__tar.gz → 0.4.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.

Potentially problematic release.


This version of aiinbx might be problematic. Click here for more details.

Files changed (90) hide show
  1. aiinbx-0.4.0/.release-please-manifest.json +3 -0
  2. {aiinbx-0.3.0 → aiinbx-0.4.0}/CHANGELOG.md +20 -0
  3. {aiinbx-0.3.0 → aiinbx-0.4.0}/PKG-INFO +1 -1
  4. {aiinbx-0.3.0 → aiinbx-0.4.0}/api.md +22 -0
  5. {aiinbx-0.3.0 → aiinbx-0.4.0}/pyproject.toml +53 -2
  6. {aiinbx-0.3.0 → aiinbx-0.4.0}/requirements-dev.lock +5 -3
  7. {aiinbx-0.3.0 → aiinbx-0.4.0}/requirements.lock +5 -2
  8. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/__init__.py +3 -1
  9. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_base_client.py +12 -12
  10. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_client.py +17 -9
  11. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_compat.py +48 -48
  12. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_models.py +50 -44
  13. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_qs.py +7 -7
  14. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_types.py +53 -12
  15. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_utils/__init__.py +9 -2
  16. aiinbx-0.4.0/src/aiinbx/_utils/_compat.py +45 -0
  17. aiinbx-0.4.0/src/aiinbx/_utils/_datetime_parse.py +136 -0
  18. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_utils/_transform.py +13 -3
  19. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_utils/_typing.py +6 -1
  20. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_utils/_utils.py +4 -5
  21. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_version.py +1 -1
  22. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/resources/__init__.py +14 -0
  23. aiinbx-0.4.0/src/aiinbx/resources/domains.py +455 -0
  24. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/resources/emails.py +44 -44
  25. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/resources/threads.py +56 -56
  26. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/types/__init__.py +6 -0
  27. aiinbx-0.4.0/src/aiinbx/types/domain_create_params.py +11 -0
  28. aiinbx-0.4.0/src/aiinbx/types/domain_create_response.py +26 -0
  29. aiinbx-0.4.0/src/aiinbx/types/domain_delete_response.py +11 -0
  30. aiinbx-0.4.0/src/aiinbx/types/domain_list_response.py +48 -0
  31. aiinbx-0.4.0/src/aiinbx/types/domain_retrieve_response.py +44 -0
  32. aiinbx-0.4.0/src/aiinbx/types/domain_verify_response.py +147 -0
  33. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/types/email_reply_params.py +5 -4
  34. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/types/email_send_params.py +7 -6
  35. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/types/thread_forward_params.py +5 -4
  36. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/types/thread_search_params.py +2 -2
  37. aiinbx-0.4.0/tests/api_resources/test_domains.py +406 -0
  38. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/test_client.py +6 -47
  39. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/test_models.py +24 -24
  40. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/test_transform.py +17 -10
  41. aiinbx-0.4.0/tests/test_utils/test_datetime_parse.py +110 -0
  42. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/utils.py +13 -5
  43. aiinbx-0.3.0/.release-please-manifest.json +0 -3
  44. aiinbx-0.3.0/mypy.ini +0 -50
  45. {aiinbx-0.3.0 → aiinbx-0.4.0}/.gitignore +0 -0
  46. {aiinbx-0.3.0 → aiinbx-0.4.0}/CONTRIBUTING.md +0 -0
  47. {aiinbx-0.3.0 → aiinbx-0.4.0}/LICENSE +0 -0
  48. {aiinbx-0.3.0 → aiinbx-0.4.0}/README.md +0 -0
  49. {aiinbx-0.3.0 → aiinbx-0.4.0}/SECURITY.md +0 -0
  50. {aiinbx-0.3.0 → aiinbx-0.4.0}/bin/check-release-environment +0 -0
  51. {aiinbx-0.3.0 → aiinbx-0.4.0}/bin/publish-pypi +0 -0
  52. {aiinbx-0.3.0 → aiinbx-0.4.0}/examples/.keep +0 -0
  53. {aiinbx-0.3.0 → aiinbx-0.4.0}/noxfile.py +0 -0
  54. {aiinbx-0.3.0 → aiinbx-0.4.0}/release-please-config.json +0 -0
  55. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/ai_inbx/lib/.keep +0 -0
  56. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_constants.py +0 -0
  57. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_exceptions.py +0 -0
  58. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_files.py +0 -0
  59. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_resource.py +0 -0
  60. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_response.py +0 -0
  61. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_streaming.py +0 -0
  62. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_utils/_logs.py +0 -0
  63. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_utils/_proxy.py +0 -0
  64. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_utils/_reflection.py +0 -0
  65. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_utils/_resources_proxy.py +0 -0
  66. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_utils/_streams.py +0 -0
  67. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/_utils/_sync.py +0 -0
  68. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/lib/.keep +0 -0
  69. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/py.typed +0 -0
  70. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/types/email_reply_response.py +0 -0
  71. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/types/email_retrieve_response.py +0 -0
  72. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/types/email_send_response.py +0 -0
  73. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/types/thread_forward_response.py +0 -0
  74. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/types/thread_retrieve_response.py +0 -0
  75. {aiinbx-0.3.0 → aiinbx-0.4.0}/src/aiinbx/types/thread_search_response.py +0 -0
  76. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/__init__.py +0 -0
  77. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/api_resources/__init__.py +0 -0
  78. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/api_resources/test_emails.py +0 -0
  79. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/api_resources/test_threads.py +0 -0
  80. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/conftest.py +0 -0
  81. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/sample_file.txt +0 -0
  82. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/test_deepcopy.py +0 -0
  83. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/test_extract_files.py +0 -0
  84. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/test_files.py +0 -0
  85. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/test_qs.py +0 -0
  86. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/test_required_args.py +0 -0
  87. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/test_response.py +0 -0
  88. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/test_streaming.py +0 -0
  89. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/test_utils/test_proxy.py +0 -0
  90. {aiinbx-0.3.0 → aiinbx-0.4.0}/tests/test_utils/test_typing.py +0 -0
@@ -0,0 +1,3 @@
1
+ {
2
+ ".": "0.4.0"
3
+ }
@@ -1,5 +1,25 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.0 (2025-10-05)
4
+
5
+ Full Changelog: [v0.3.0...v0.4.0](https://github.com/aiinbx/aiinbx-py/compare/v0.3.0...v0.4.0)
6
+
7
+ ### Features
8
+
9
+ * **api:** manual updates ([601d5ea](https://github.com/aiinbx/aiinbx-py/commit/601d5eade9216549a200c26584a2cc18176835fd))
10
+ * improve future compat with pydantic v3 ([dcc1c80](https://github.com/aiinbx/aiinbx-py/commit/dcc1c804ec998e7948395f7c1ea3aac371a539fb))
11
+ * **types:** replace List[str] with SequenceNotStr in params ([a31a999](https://github.com/aiinbx/aiinbx-py/commit/a31a999a8dd553a067fdd4368d147f773418dc02))
12
+
13
+
14
+ ### Chores
15
+
16
+ * do not install brew dependencies in ./scripts/bootstrap by default ([b4c08e3](https://github.com/aiinbx/aiinbx-py/commit/b4c08e37dfa25b784a2cd7d5e9778f3318c365b9))
17
+ * **internal:** add Sequence related utils ([879c21a](https://github.com/aiinbx/aiinbx-py/commit/879c21ac262c2c10c0e1bfa03d5d1c40470f889b))
18
+ * **internal:** move mypy configurations to `pyproject.toml` file ([3108a79](https://github.com/aiinbx/aiinbx-py/commit/3108a794e35f868d1e21a210abbda837eecc64d1))
19
+ * **internal:** update pydantic dependency ([6dcd694](https://github.com/aiinbx/aiinbx-py/commit/6dcd694e2ab6b8246892ebef85e95bff9b0338a9))
20
+ * **tests:** simplify `get_platform` test ([0f14d8c](https://github.com/aiinbx/aiinbx-py/commit/0f14d8cd43342f3fda7ccda30717c01d20679593))
21
+ * **types:** change optional parameter type from NotGiven to Omit ([1b12faa](https://github.com/aiinbx/aiinbx-py/commit/1b12faa48dbcc8fedf5dc8e4a410c58fcfac7853))
22
+
3
23
  ## 0.3.0 (2025-08-28)
4
24
 
5
25
  Full Changelog: [v0.2.0...v0.3.0](https://github.com/aiinbx/aiinbx-py/compare/v0.2.0...v0.3.0)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: aiinbx
3
- Version: 0.3.0
3
+ Version: 0.4.0
4
4
  Summary: The official Python library for the AIInbx API
5
5
  Project-URL: Homepage, https://github.com/aiinbx/aiinbx-py
6
6
  Project-URL: Repository, https://github.com/aiinbx/aiinbx-py
@@ -25,3 +25,25 @@ Methods:
25
25
  - <code title="get /emails/{emailId}">client.emails.<a href="./src/aiinbx/resources/emails.py">retrieve</a>(email_id) -> <a href="./src/aiinbx/types/email_retrieve_response.py">EmailRetrieveResponse</a></code>
26
26
  - <code title="post /emails/{emailId}/reply">client.emails.<a href="./src/aiinbx/resources/emails.py">reply</a>(email_id, \*\*<a href="src/aiinbx/types/email_reply_params.py">params</a>) -> <a href="./src/aiinbx/types/email_reply_response.py">EmailReplyResponse</a></code>
27
27
  - <code title="post /emails/send">client.emails.<a href="./src/aiinbx/resources/emails.py">send</a>(\*\*<a href="src/aiinbx/types/email_send_params.py">params</a>) -> <a href="./src/aiinbx/types/email_send_response.py">EmailSendResponse</a></code>
28
+
29
+ # Domains
30
+
31
+ Types:
32
+
33
+ ```python
34
+ from aiinbx.types import (
35
+ DomainCreateResponse,
36
+ DomainRetrieveResponse,
37
+ DomainListResponse,
38
+ DomainDeleteResponse,
39
+ DomainVerifyResponse,
40
+ )
41
+ ```
42
+
43
+ Methods:
44
+
45
+ - <code title="post /domains">client.domains.<a href="./src/aiinbx/resources/domains.py">create</a>(\*\*<a href="src/aiinbx/types/domain_create_params.py">params</a>) -> <a href="./src/aiinbx/types/domain_create_response.py">DomainCreateResponse</a></code>
46
+ - <code title="get /domains/{domainId}">client.domains.<a href="./src/aiinbx/resources/domains.py">retrieve</a>(domain_id) -> <a href="./src/aiinbx/types/domain_retrieve_response.py">DomainRetrieveResponse</a></code>
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
+ - <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
+ - <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>
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "aiinbx"
3
- version = "0.3.0"
3
+ version = "0.4.0"
4
4
  description = "The official Python library for the AIInbx API"
5
5
  dynamic = ["readme"]
6
6
  license = "Apache-2.0"
@@ -56,7 +56,6 @@ dev-dependencies = [
56
56
  "dirty-equals>=0.6.0",
57
57
  "importlib-metadata>=6.7.0",
58
58
  "rich>=13.7.1",
59
- "nest_asyncio==1.6.0",
60
59
  "pytest-xdist>=3.6.1",
61
60
  ]
62
61
 
@@ -157,6 +156,58 @@ reportOverlappingOverload = false
157
156
  reportImportCycles = false
158
157
  reportPrivateUsage = false
159
158
 
159
+ [tool.mypy]
160
+ pretty = true
161
+ show_error_codes = true
162
+
163
+ # Exclude _files.py because mypy isn't smart enough to apply
164
+ # the correct type narrowing and as this is an internal module
165
+ # it's fine to just use Pyright.
166
+ #
167
+ # We also exclude our `tests` as mypy doesn't always infer
168
+ # types correctly and Pyright will still catch any type errors.
169
+ exclude = ['src/aiinbx/_files.py', '_dev/.*.py', 'tests/.*']
170
+
171
+ strict_equality = true
172
+ implicit_reexport = true
173
+ check_untyped_defs = true
174
+ no_implicit_optional = true
175
+
176
+ warn_return_any = true
177
+ warn_unreachable = true
178
+ warn_unused_configs = true
179
+
180
+ # Turn these options off as it could cause conflicts
181
+ # with the Pyright options.
182
+ warn_unused_ignores = false
183
+ warn_redundant_casts = false
184
+
185
+ disallow_any_generics = true
186
+ disallow_untyped_defs = true
187
+ disallow_untyped_calls = true
188
+ disallow_subclassing_any = true
189
+ disallow_incomplete_defs = true
190
+ disallow_untyped_decorators = true
191
+ cache_fine_grained = true
192
+
193
+ # By default, mypy reports an error if you assign a value to the result
194
+ # of a function call that doesn't return anything. We do this in our test
195
+ # cases:
196
+ # ```
197
+ # result = ...
198
+ # assert result is None
199
+ # ```
200
+ # Changing this codegen to make mypy happy would increase complexity
201
+ # and would not be worth it.
202
+ disable_error_code = "func-returns-value,overload-cannot-match"
203
+
204
+ # https://github.com/python/mypy/issues/12162
205
+ [[tool.mypy.overrides]]
206
+ module = "black.files.*"
207
+ ignore_errors = true
208
+ ignore_missing_imports = true
209
+
210
+
160
211
  [tool.ruff]
161
212
  line-length = 120
162
213
  output-format = "grouped"
@@ -75,7 +75,6 @@ multidict==6.4.4
75
75
  mypy==1.14.1
76
76
  mypy-extensions==1.0.0
77
77
  # via mypy
78
- nest-asyncio==1.6.0
79
78
  nodeenv==1.8.0
80
79
  # via pyright
81
80
  nox==2023.4.22
@@ -89,9 +88,9 @@ pluggy==1.5.0
89
88
  propcache==0.3.1
90
89
  # via aiohttp
91
90
  # via yarl
92
- pydantic==2.10.3
91
+ pydantic==2.11.9
93
92
  # via aiinbx
94
- pydantic-core==2.27.1
93
+ pydantic-core==2.33.2
95
94
  # via pydantic
96
95
  pygments==2.18.0
97
96
  # via rich
@@ -127,6 +126,9 @@ typing-extensions==4.12.2
127
126
  # via pydantic
128
127
  # via pydantic-core
129
128
  # via pyright
129
+ # via typing-inspection
130
+ typing-inspection==0.4.1
131
+ # via pydantic
130
132
  virtualenv==20.24.5
131
133
  # via nox
132
134
  yarl==1.20.0
@@ -55,9 +55,9 @@ multidict==6.4.4
55
55
  propcache==0.3.1
56
56
  # via aiohttp
57
57
  # via yarl
58
- pydantic==2.10.3
58
+ pydantic==2.11.9
59
59
  # via aiinbx
60
- pydantic-core==2.27.1
60
+ pydantic-core==2.33.2
61
61
  # via pydantic
62
62
  sniffio==1.3.0
63
63
  # via aiinbx
@@ -68,5 +68,8 @@ typing-extensions==4.12.2
68
68
  # via multidict
69
69
  # via pydantic
70
70
  # via pydantic-core
71
+ # via typing-inspection
72
+ typing-inspection==0.4.1
73
+ # via pydantic
71
74
  yarl==1.20.0
72
75
  # via aiohttp
@@ -3,7 +3,7 @@
3
3
  import typing as _t
4
4
 
5
5
  from . import types
6
- from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes
6
+ from ._types import NOT_GIVEN, Omit, NoneType, NotGiven, Transport, ProxiesTypes, omit, not_given
7
7
  from ._utils import file_from_path
8
8
  from ._client import AIInbx, Client, Stream, Timeout, Transport, AsyncAIInbx, AsyncClient, AsyncStream, RequestOptions
9
9
  from ._models import BaseModel
@@ -38,7 +38,9 @@ __all__ = [
38
38
  "ProxiesTypes",
39
39
  "NotGiven",
40
40
  "NOT_GIVEN",
41
+ "not_given",
41
42
  "Omit",
43
+ "omit",
42
44
  "AIInbxError",
43
45
  "APIError",
44
46
  "APIStatusError",
@@ -42,7 +42,6 @@ from . import _exceptions
42
42
  from ._qs import Querystring
43
43
  from ._files import to_httpx_files, async_to_httpx_files
44
44
  from ._types import (
45
- NOT_GIVEN,
46
45
  Body,
47
46
  Omit,
48
47
  Query,
@@ -57,9 +56,10 @@ from ._types import (
57
56
  RequestOptions,
58
57
  HttpxRequestFiles,
59
58
  ModelBuilderProtocol,
59
+ not_given,
60
60
  )
61
61
  from ._utils import is_dict, is_list, asyncify, is_given, lru_cache, is_mapping
62
- from ._compat import PYDANTIC_V2, model_copy, model_dump
62
+ from ._compat import PYDANTIC_V1, model_copy, model_dump
63
63
  from ._models import GenericModel, FinalRequestOptions, validate_type, construct_type
64
64
  from ._response import (
65
65
  APIResponse,
@@ -145,9 +145,9 @@ class PageInfo:
145
145
  def __init__(
146
146
  self,
147
147
  *,
148
- url: URL | NotGiven = NOT_GIVEN,
149
- json: Body | NotGiven = NOT_GIVEN,
150
- params: Query | NotGiven = NOT_GIVEN,
148
+ url: URL | NotGiven = not_given,
149
+ json: Body | NotGiven = not_given,
150
+ params: Query | NotGiven = not_given,
151
151
  ) -> None:
152
152
  self.url = url
153
153
  self.json = json
@@ -232,7 +232,7 @@ class BaseSyncPage(BasePage[_T], Generic[_T]):
232
232
  model: Type[_T],
233
233
  options: FinalRequestOptions,
234
234
  ) -> None:
235
- if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
235
+ if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
236
236
  self.__pydantic_private__ = {}
237
237
 
238
238
  self._model = model
@@ -320,7 +320,7 @@ class BaseAsyncPage(BasePage[_T], Generic[_T]):
320
320
  client: AsyncAPIClient,
321
321
  options: FinalRequestOptions,
322
322
  ) -> None:
323
- if PYDANTIC_V2 and getattr(self, "__pydantic_private__", None) is None:
323
+ if (not PYDANTIC_V1) and getattr(self, "__pydantic_private__", None) is None:
324
324
  self.__pydantic_private__ = {}
325
325
 
326
326
  self._model = model
@@ -595,7 +595,7 @@ class BaseClient(Generic[_HttpxClientT, _DefaultStreamT]):
595
595
  # we internally support defining a temporary header to override the
596
596
  # default `cast_to` type for use with `.with_raw_response` and `.with_streaming_response`
597
597
  # see _response.py for implementation details
598
- override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, NOT_GIVEN)
598
+ override_cast_to = headers.pop(OVERRIDE_CAST_TO_HEADER, not_given)
599
599
  if is_given(override_cast_to):
600
600
  options.headers = headers
601
601
  return cast(Type[ResponseT], override_cast_to)
@@ -825,7 +825,7 @@ class SyncAPIClient(BaseClient[httpx.Client, Stream[Any]]):
825
825
  version: str,
826
826
  base_url: str | URL,
827
827
  max_retries: int = DEFAULT_MAX_RETRIES,
828
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
828
+ timeout: float | Timeout | None | NotGiven = not_given,
829
829
  http_client: httpx.Client | None = None,
830
830
  custom_headers: Mapping[str, str] | None = None,
831
831
  custom_query: Mapping[str, object] | None = None,
@@ -1356,7 +1356,7 @@ class AsyncAPIClient(BaseClient[httpx.AsyncClient, AsyncStream[Any]]):
1356
1356
  base_url: str | URL,
1357
1357
  _strict_response_validation: bool,
1358
1358
  max_retries: int = DEFAULT_MAX_RETRIES,
1359
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
1359
+ timeout: float | Timeout | None | NotGiven = not_given,
1360
1360
  http_client: httpx.AsyncClient | None = None,
1361
1361
  custom_headers: Mapping[str, str] | None = None,
1362
1362
  custom_query: Mapping[str, object] | None = None,
@@ -1818,8 +1818,8 @@ def make_request_options(
1818
1818
  extra_query: Query | None = None,
1819
1819
  extra_body: Body | None = None,
1820
1820
  idempotency_key: str | None = None,
1821
- timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
1822
- post_parser: PostParser | NotGiven = NOT_GIVEN,
1821
+ timeout: float | httpx.Timeout | None | NotGiven = not_given,
1822
+ post_parser: PostParser | NotGiven = not_given,
1823
1823
  ) -> RequestOptions:
1824
1824
  """Create a dict of type RequestOptions without keys of NotGiven values."""
1825
1825
  options: RequestOptions = {}
@@ -3,7 +3,7 @@
3
3
  from __future__ import annotations
4
4
 
5
5
  import os
6
- from typing import Any, Union, Mapping
6
+ from typing import Any, Mapping
7
7
  from typing_extensions import Self, override
8
8
 
9
9
  import httpx
@@ -11,17 +11,17 @@ import httpx
11
11
  from . import _exceptions
12
12
  from ._qs import Querystring
13
13
  from ._types import (
14
- NOT_GIVEN,
15
14
  Omit,
16
15
  Timeout,
17
16
  NotGiven,
18
17
  Transport,
19
18
  ProxiesTypes,
20
19
  RequestOptions,
20
+ not_given,
21
21
  )
22
22
  from ._utils import is_given, get_async_library
23
23
  from ._version import __version__
24
- from .resources import emails, threads
24
+ from .resources import emails, domains, threads
25
25
  from ._streaming import Stream as Stream, AsyncStream as AsyncStream
26
26
  from ._exceptions import AIInbxError, APIStatusError
27
27
  from ._base_client import (
@@ -36,6 +36,7 @@ __all__ = ["Timeout", "Transport", "ProxiesTypes", "RequestOptions", "AIInbx", "
36
36
  class AIInbx(SyncAPIClient):
37
37
  threads: threads.ThreadsResource
38
38
  emails: emails.EmailsResource
39
+ domains: domains.DomainsResource
39
40
  with_raw_response: AIInbxWithRawResponse
40
41
  with_streaming_response: AIInbxWithStreamedResponse
41
42
 
@@ -47,7 +48,7 @@ class AIInbx(SyncAPIClient):
47
48
  *,
48
49
  api_key: str | None = None,
49
50
  base_url: str | httpx.URL | None = None,
50
- timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
51
+ timeout: float | Timeout | None | NotGiven = not_given,
51
52
  max_retries: int = DEFAULT_MAX_RETRIES,
52
53
  default_headers: Mapping[str, str] | None = None,
53
54
  default_query: Mapping[str, object] | None = None,
@@ -95,6 +96,7 @@ class AIInbx(SyncAPIClient):
95
96
 
96
97
  self.threads = threads.ThreadsResource(self)
97
98
  self.emails = emails.EmailsResource(self)
99
+ self.domains = domains.DomainsResource(self)
98
100
  self.with_raw_response = AIInbxWithRawResponse(self)
99
101
  self.with_streaming_response = AIInbxWithStreamedResponse(self)
100
102
 
@@ -123,9 +125,9 @@ class AIInbx(SyncAPIClient):
123
125
  *,
124
126
  api_key: str | None = None,
125
127
  base_url: str | httpx.URL | None = None,
126
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
128
+ timeout: float | Timeout | None | NotGiven = not_given,
127
129
  http_client: httpx.Client | None = None,
128
- max_retries: int | NotGiven = NOT_GIVEN,
130
+ max_retries: int | NotGiven = not_given,
129
131
  default_headers: Mapping[str, str] | None = None,
130
132
  set_default_headers: Mapping[str, str] | None = None,
131
133
  default_query: Mapping[str, object] | None = None,
@@ -206,6 +208,7 @@ class AIInbx(SyncAPIClient):
206
208
  class AsyncAIInbx(AsyncAPIClient):
207
209
  threads: threads.AsyncThreadsResource
208
210
  emails: emails.AsyncEmailsResource
211
+ domains: domains.AsyncDomainsResource
209
212
  with_raw_response: AsyncAIInbxWithRawResponse
210
213
  with_streaming_response: AsyncAIInbxWithStreamedResponse
211
214
 
@@ -217,7 +220,7 @@ class AsyncAIInbx(AsyncAPIClient):
217
220
  *,
218
221
  api_key: str | None = None,
219
222
  base_url: str | httpx.URL | None = None,
220
- timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
223
+ timeout: float | Timeout | None | NotGiven = not_given,
221
224
  max_retries: int = DEFAULT_MAX_RETRIES,
222
225
  default_headers: Mapping[str, str] | None = None,
223
226
  default_query: Mapping[str, object] | None = None,
@@ -265,6 +268,7 @@ class AsyncAIInbx(AsyncAPIClient):
265
268
 
266
269
  self.threads = threads.AsyncThreadsResource(self)
267
270
  self.emails = emails.AsyncEmailsResource(self)
271
+ self.domains = domains.AsyncDomainsResource(self)
268
272
  self.with_raw_response = AsyncAIInbxWithRawResponse(self)
269
273
  self.with_streaming_response = AsyncAIInbxWithStreamedResponse(self)
270
274
 
@@ -293,9 +297,9 @@ class AsyncAIInbx(AsyncAPIClient):
293
297
  *,
294
298
  api_key: str | None = None,
295
299
  base_url: str | httpx.URL | None = None,
296
- timeout: float | Timeout | None | NotGiven = NOT_GIVEN,
300
+ timeout: float | Timeout | None | NotGiven = not_given,
297
301
  http_client: httpx.AsyncClient | None = None,
298
- max_retries: int | NotGiven = NOT_GIVEN,
302
+ max_retries: int | NotGiven = not_given,
299
303
  default_headers: Mapping[str, str] | None = None,
300
304
  set_default_headers: Mapping[str, str] | None = None,
301
305
  default_query: Mapping[str, object] | None = None,
@@ -377,24 +381,28 @@ class AIInbxWithRawResponse:
377
381
  def __init__(self, client: AIInbx) -> None:
378
382
  self.threads = threads.ThreadsResourceWithRawResponse(client.threads)
379
383
  self.emails = emails.EmailsResourceWithRawResponse(client.emails)
384
+ self.domains = domains.DomainsResourceWithRawResponse(client.domains)
380
385
 
381
386
 
382
387
  class AsyncAIInbxWithRawResponse:
383
388
  def __init__(self, client: AsyncAIInbx) -> None:
384
389
  self.threads = threads.AsyncThreadsResourceWithRawResponse(client.threads)
385
390
  self.emails = emails.AsyncEmailsResourceWithRawResponse(client.emails)
391
+ self.domains = domains.AsyncDomainsResourceWithRawResponse(client.domains)
386
392
 
387
393
 
388
394
  class AIInbxWithStreamedResponse:
389
395
  def __init__(self, client: AIInbx) -> None:
390
396
  self.threads = threads.ThreadsResourceWithStreamingResponse(client.threads)
391
397
  self.emails = emails.EmailsResourceWithStreamingResponse(client.emails)
398
+ self.domains = domains.DomainsResourceWithStreamingResponse(client.domains)
392
399
 
393
400
 
394
401
  class AsyncAIInbxWithStreamedResponse:
395
402
  def __init__(self, client: AsyncAIInbx) -> None:
396
403
  self.threads = threads.AsyncThreadsResourceWithStreamingResponse(client.threads)
397
404
  self.emails = emails.AsyncEmailsResourceWithStreamingResponse(client.emails)
405
+ self.domains = domains.AsyncDomainsResourceWithStreamingResponse(client.domains)
398
406
 
399
407
 
400
408
  Client = AIInbx
@@ -12,14 +12,13 @@ from ._types import IncEx, StrBytesIntFloat
12
12
  _T = TypeVar("_T")
13
13
  _ModelT = TypeVar("_ModelT", bound=pydantic.BaseModel)
14
14
 
15
- # --------------- Pydantic v2 compatibility ---------------
15
+ # --------------- Pydantic v2, v3 compatibility ---------------
16
16
 
17
17
  # Pyright incorrectly reports some of our functions as overriding a method when they don't
18
18
  # pyright: reportIncompatibleMethodOverride=false
19
19
 
20
- PYDANTIC_V2 = pydantic.VERSION.startswith("2.")
20
+ PYDANTIC_V1 = pydantic.VERSION.startswith("1.")
21
21
 
22
- # v1 re-exports
23
22
  if TYPE_CHECKING:
24
23
 
25
24
  def parse_date(value: date | StrBytesIntFloat) -> date: # noqa: ARG001
@@ -44,90 +43,92 @@ if TYPE_CHECKING:
44
43
  ...
45
44
 
46
45
  else:
47
- if PYDANTIC_V2:
48
- from pydantic.v1.typing import (
46
+ # v1 re-exports
47
+ if PYDANTIC_V1:
48
+ from pydantic.typing import (
49
49
  get_args as get_args,
50
50
  is_union as is_union,
51
51
  get_origin as get_origin,
52
52
  is_typeddict as is_typeddict,
53
53
  is_literal_type as is_literal_type,
54
54
  )
55
- from pydantic.v1.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime
55
+ from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime
56
56
  else:
57
- from pydantic.typing import (
57
+ from ._utils import (
58
58
  get_args as get_args,
59
59
  is_union as is_union,
60
60
  get_origin as get_origin,
61
+ parse_date as parse_date,
61
62
  is_typeddict as is_typeddict,
63
+ parse_datetime as parse_datetime,
62
64
  is_literal_type as is_literal_type,
63
65
  )
64
- from pydantic.datetime_parse import parse_date as parse_date, parse_datetime as parse_datetime
65
66
 
66
67
 
67
68
  # refactored config
68
69
  if TYPE_CHECKING:
69
70
  from pydantic import ConfigDict as ConfigDict
70
71
  else:
71
- if PYDANTIC_V2:
72
- from pydantic import ConfigDict
73
- else:
72
+ if PYDANTIC_V1:
74
73
  # TODO: provide an error message here?
75
74
  ConfigDict = None
75
+ else:
76
+ from pydantic import ConfigDict as ConfigDict
76
77
 
77
78
 
78
79
  # renamed methods / properties
79
80
  def parse_obj(model: type[_ModelT], value: object) -> _ModelT:
80
- if PYDANTIC_V2:
81
- return model.model_validate(value)
82
- else:
81
+ if PYDANTIC_V1:
83
82
  return cast(_ModelT, model.parse_obj(value)) # pyright: ignore[reportDeprecated, reportUnnecessaryCast]
83
+ else:
84
+ return model.model_validate(value)
84
85
 
85
86
 
86
87
  def field_is_required(field: FieldInfo) -> bool:
87
- if PYDANTIC_V2:
88
- return field.is_required()
89
- return field.required # type: ignore
88
+ if PYDANTIC_V1:
89
+ return field.required # type: ignore
90
+ return field.is_required()
90
91
 
91
92
 
92
93
  def field_get_default(field: FieldInfo) -> Any:
93
94
  value = field.get_default()
94
- if PYDANTIC_V2:
95
- from pydantic_core import PydanticUndefined
96
-
97
- if value == PydanticUndefined:
98
- return None
95
+ if PYDANTIC_V1:
99
96
  return value
97
+ from pydantic_core import PydanticUndefined
98
+
99
+ if value == PydanticUndefined:
100
+ return None
100
101
  return value
101
102
 
102
103
 
103
104
  def field_outer_type(field: FieldInfo) -> Any:
104
- if PYDANTIC_V2:
105
- return field.annotation
106
- return field.outer_type_ # type: ignore
105
+ if PYDANTIC_V1:
106
+ return field.outer_type_ # type: ignore
107
+ return field.annotation
107
108
 
108
109
 
109
110
  def get_model_config(model: type[pydantic.BaseModel]) -> Any:
110
- if PYDANTIC_V2:
111
- return model.model_config
112
- return model.__config__ # type: ignore
111
+ if PYDANTIC_V1:
112
+ return model.__config__ # type: ignore
113
+ return model.model_config
113
114
 
114
115
 
115
116
  def get_model_fields(model: type[pydantic.BaseModel]) -> dict[str, FieldInfo]:
116
- if PYDANTIC_V2:
117
- return model.model_fields
118
- return model.__fields__ # type: ignore
117
+ if PYDANTIC_V1:
118
+ return model.__fields__ # type: ignore
119
+ return model.model_fields
119
120
 
120
121
 
121
122
  def model_copy(model: _ModelT, *, deep: bool = False) -> _ModelT:
122
- if PYDANTIC_V2:
123
- return model.model_copy(deep=deep)
124
- return model.copy(deep=deep) # type: ignore
123
+ if PYDANTIC_V1:
124
+ return model.copy(deep=deep) # type: ignore
125
+ return model.model_copy(deep=deep)
125
126
 
126
127
 
127
128
  def model_json(model: pydantic.BaseModel, *, indent: int | None = None) -> str:
128
- if PYDANTIC_V2:
129
- return model.model_dump_json(indent=indent)
130
- return model.json(indent=indent) # type: ignore
129
+ if PYDANTIC_V1:
130
+ return model.json(indent=indent) # type: ignore
131
+ return model.model_dump_json(indent=indent)
131
132
 
132
133
 
133
134
  def model_dump(
@@ -139,14 +140,14 @@ def model_dump(
139
140
  warnings: bool = True,
140
141
  mode: Literal["json", "python"] = "python",
141
142
  ) -> dict[str, Any]:
142
- if PYDANTIC_V2 or hasattr(model, "model_dump"):
143
+ if (not PYDANTIC_V1) or hasattr(model, "model_dump"):
143
144
  return model.model_dump(
144
145
  mode=mode,
145
146
  exclude=exclude,
146
147
  exclude_unset=exclude_unset,
147
148
  exclude_defaults=exclude_defaults,
148
149
  # warnings are not supported in Pydantic v1
149
- warnings=warnings if PYDANTIC_V2 else True,
150
+ warnings=True if PYDANTIC_V1 else warnings,
150
151
  )
151
152
  return cast(
152
153
  "dict[str, Any]",
@@ -159,9 +160,9 @@ def model_dump(
159
160
 
160
161
 
161
162
  def model_parse(model: type[_ModelT], data: Any) -> _ModelT:
162
- if PYDANTIC_V2:
163
- return model.model_validate(data)
164
- return model.parse_obj(data) # pyright: ignore[reportDeprecated]
163
+ if PYDANTIC_V1:
164
+ return model.parse_obj(data) # pyright: ignore[reportDeprecated]
165
+ return model.model_validate(data)
165
166
 
166
167
 
167
168
  # generic models
@@ -170,17 +171,16 @@ if TYPE_CHECKING:
170
171
  class GenericModel(pydantic.BaseModel): ...
171
172
 
172
173
  else:
173
- if PYDANTIC_V2:
174
+ if PYDANTIC_V1:
175
+ import pydantic.generics
176
+
177
+ class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ...
178
+ else:
174
179
  # there no longer needs to be a distinction in v2 but
175
180
  # we still have to create our own subclass to avoid
176
181
  # inconsistent MRO ordering errors
177
182
  class GenericModel(pydantic.BaseModel): ...
178
183
 
179
- else:
180
- import pydantic.generics
181
-
182
- class GenericModel(pydantic.generics.GenericModel, pydantic.BaseModel): ...
183
-
184
184
 
185
185
  # cached properties
186
186
  if TYPE_CHECKING: