channel3-sdk 2.1.0__tar.gz → 2.2.1__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 channel3-sdk might be problematic. Click here for more details.
- channel3_sdk-2.2.1/.release-please-manifest.json +3 -0
- channel3_sdk-2.2.1/CHANGELOG.md +51 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/PKG-INFO +2 -6
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/README.md +0 -4
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/pyproject.toml +6 -2
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/requirements-dev.lock +6 -3
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/requirements.lock +6 -3
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/__init__.py +3 -3
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_base_client.py +9 -9
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_client.py +21 -79
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_models.py +10 -4
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_qs.py +7 -7
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_types.py +18 -11
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_utils/_transform.py +2 -2
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_utils/_utils.py +4 -4
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_version.py +1 -1
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/resources/brands.py +11 -11
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/resources/enrich.py +3 -3
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/resources/products.py +3 -3
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/resources/search.py +17 -17
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/test_client.py +0 -20
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/test_transform.py +9 -2
- channel3_sdk-2.1.0/.release-please-manifest.json +0 -3
- channel3_sdk-2.1.0/CHANGELOG.md +0 -31
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/.gitignore +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/CONTRIBUTING.md +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/LICENSE +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/SECURITY.md +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/api.md +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/bin/check-release-environment +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/bin/publish-pypi +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/examples/.keep +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/noxfile.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/release-please-config.json +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_compat.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_constants.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_exceptions.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_files.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_resource.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_response.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_streaming.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_utils/__init__.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_utils/_compat.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_utils/_datetime_parse.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_utils/_logs.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_utils/_proxy.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_utils/_reflection.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_utils/_resources_proxy.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_utils/_streams.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_utils/_sync.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/_utils/_typing.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/lib/.keep +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/py.typed +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/resources/__init__.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/types/__init__.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/types/availability_status.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/types/brand.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/types/brand_list_params.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/types/brand_list_response.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/types/enrich_enrich_url_params.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/types/enrich_enrich_url_response.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/types/price.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/types/product_retrieve_response.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/types/search_perform_params.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/types/search_perform_response.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/channel3_sdk/types/variant.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/src/public_sdk/lib/.keep +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/__init__.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/api_resources/__init__.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/api_resources/test_brands.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/api_resources/test_client.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/api_resources/test_enrich.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/api_resources/test_products.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/api_resources/test_search.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/conftest.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/sample_file.txt +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/test_deepcopy.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/test_extract_files.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/test_files.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/test_models.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/test_qs.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/test_required_args.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/test_response.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/test_streaming.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/test_utils/test_datetime_parse.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/test_utils/test_proxy.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/test_utils/test_typing.py +0 -0
- {channel3_sdk-2.1.0 → channel3_sdk-2.2.1}/tests/utils.py +0 -0
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 2.2.1 (2025-10-21)
|
|
4
|
+
|
|
5
|
+
Full Changelog: [v2.2.0...v2.2.1](https://github.com/channel3-ai/sdk-python/compare/v2.2.0...v2.2.1)
|
|
6
|
+
|
|
7
|
+
### Chores
|
|
8
|
+
|
|
9
|
+
* bump `httpx-aiohttp` version to 0.1.9 ([9fce17d](https://github.com/channel3-ai/sdk-python/commit/9fce17d430d871ec313c00be59baa4cc674405a6))
|
|
10
|
+
* do not install brew dependencies in ./scripts/bootstrap by default ([4195b56](https://github.com/channel3-ai/sdk-python/commit/4195b56c72109be10c6444cc66b262e405562f02))
|
|
11
|
+
* **internal:** detect missing future annotations with ruff ([ee0fee8](https://github.com/channel3-ai/sdk-python/commit/ee0fee8c45a79bbc7436bbdc9216fed4c4f8549f))
|
|
12
|
+
* **internal:** update pydantic dependency ([748c67f](https://github.com/channel3-ai/sdk-python/commit/748c67f3e609d241af1ee9342ef3755589d3534c))
|
|
13
|
+
* **types:** change optional parameter type from NotGiven to Omit ([61aab9b](https://github.com/channel3-ai/sdk-python/commit/61aab9bec310efab0ce7a4b13440f1207bcbef8a))
|
|
14
|
+
|
|
15
|
+
## 2.2.0 (2025-09-16)
|
|
16
|
+
|
|
17
|
+
Full Changelog: [v2.1.0...v2.2.0](https://github.com/channel3-ai/sdk-python/compare/v2.1.0...v2.2.0)
|
|
18
|
+
|
|
19
|
+
### Features
|
|
20
|
+
|
|
21
|
+
* **api:** manual updates ([79f6922](https://github.com/channel3-ai/sdk-python/commit/79f69227ff70ac778731b6dac5f1297a66800893))
|
|
22
|
+
|
|
23
|
+
## 2.1.0 (2025-09-16)
|
|
24
|
+
|
|
25
|
+
Full Changelog: [v2.0.0...v2.1.0](https://github.com/channel3-ai/sdk-python/compare/v2.0.0...v2.1.0)
|
|
26
|
+
|
|
27
|
+
### Features
|
|
28
|
+
|
|
29
|
+
* **api:** api update ([b6dac15](https://github.com/channel3-ai/sdk-python/commit/b6dac1516907c474ecfd919c5fad34943b59b101))
|
|
30
|
+
|
|
31
|
+
## 2.0.0 (2025-09-16)
|
|
32
|
+
|
|
33
|
+
Full Changelog: [v0.0.2...v2.0.0](https://github.com/channel3-ai/sdk-python/compare/v0.0.2...v2.0.0)
|
|
34
|
+
|
|
35
|
+
### Features
|
|
36
|
+
|
|
37
|
+
* **api:** manual updates ([f91f4f1](https://github.com/channel3-ai/sdk-python/commit/f91f4f163ea386464efa5b307ec11b689922493e))
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
### Chores
|
|
41
|
+
|
|
42
|
+
* update SDK settings ([35e85c7](https://github.com/channel3-ai/sdk-python/commit/35e85c70a123d6dd8b745999388082499562347e))
|
|
43
|
+
|
|
44
|
+
## 0.0.2 (2025-09-16)
|
|
45
|
+
|
|
46
|
+
Full Changelog: [v0.0.1...v0.0.2](https://github.com/channel3-ai/sdk-python/compare/v0.0.1...v0.0.2)
|
|
47
|
+
|
|
48
|
+
### Chores
|
|
49
|
+
|
|
50
|
+
* sync repo ([ab5e4db](https://github.com/channel3-ai/sdk-python/commit/ab5e4db3bb8b00b432e09fd05079277cad518277))
|
|
51
|
+
* update SDK settings ([1bdef96](https://github.com/channel3-ai/sdk-python/commit/1bdef969e22a85f658edc0f31eef8657df2b2090))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: channel3_sdk
|
|
3
|
-
Version: 2.1
|
|
3
|
+
Version: 2.2.1
|
|
4
4
|
Summary: The official Python library for the channel3 API
|
|
5
5
|
Project-URL: Homepage, https://github.com/channel3-ai/sdk-python
|
|
6
6
|
Project-URL: Repository, https://github.com/channel3-ai/sdk-python
|
|
@@ -30,7 +30,7 @@ Requires-Dist: sniffio
|
|
|
30
30
|
Requires-Dist: typing-extensions<5,>=4.10
|
|
31
31
|
Provides-Extra: aiohttp
|
|
32
32
|
Requires-Dist: aiohttp; extra == 'aiohttp'
|
|
33
|
-
Requires-Dist: httpx-aiohttp>=0.1.
|
|
33
|
+
Requires-Dist: httpx-aiohttp>=0.1.9; extra == 'aiohttp'
|
|
34
34
|
Description-Content-Type: text/markdown
|
|
35
35
|
|
|
36
36
|
# Channel3 Python API library
|
|
@@ -65,8 +65,6 @@ from channel3_sdk import Channel3
|
|
|
65
65
|
|
|
66
66
|
client = Channel3(
|
|
67
67
|
api_key=os.environ.get("CHANNEL3_API_KEY"), # This is the default and can be omitted
|
|
68
|
-
# defaults to "production".
|
|
69
|
-
environment="development",
|
|
70
68
|
)
|
|
71
69
|
|
|
72
70
|
response = client.search.perform()
|
|
@@ -88,8 +86,6 @@ from channel3_sdk import AsyncChannel3
|
|
|
88
86
|
|
|
89
87
|
client = AsyncChannel3(
|
|
90
88
|
api_key=os.environ.get("CHANNEL3_API_KEY"), # This is the default and can be omitted
|
|
91
|
-
# defaults to "production".
|
|
92
|
-
environment="development",
|
|
93
89
|
)
|
|
94
90
|
|
|
95
91
|
|
|
@@ -30,8 +30,6 @@ from channel3_sdk import Channel3
|
|
|
30
30
|
|
|
31
31
|
client = Channel3(
|
|
32
32
|
api_key=os.environ.get("CHANNEL3_API_KEY"), # This is the default and can be omitted
|
|
33
|
-
# defaults to "production".
|
|
34
|
-
environment="development",
|
|
35
33
|
)
|
|
36
34
|
|
|
37
35
|
response = client.search.perform()
|
|
@@ -53,8 +51,6 @@ from channel3_sdk import AsyncChannel3
|
|
|
53
51
|
|
|
54
52
|
client = AsyncChannel3(
|
|
55
53
|
api_key=os.environ.get("CHANNEL3_API_KEY"), # This is the default and can be omitted
|
|
56
|
-
# defaults to "production".
|
|
57
|
-
environment="development",
|
|
58
54
|
)
|
|
59
55
|
|
|
60
56
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "channel3_sdk"
|
|
3
|
-
version = "2.1
|
|
3
|
+
version = "2.2.1"
|
|
4
4
|
description = "The official Python library for the channel3 API"
|
|
5
5
|
dynamic = ["readme"]
|
|
6
6
|
license = "Apache-2.0"
|
|
@@ -39,7 +39,7 @@ Homepage = "https://github.com/channel3-ai/sdk-python"
|
|
|
39
39
|
Repository = "https://github.com/channel3-ai/sdk-python"
|
|
40
40
|
|
|
41
41
|
[project.optional-dependencies]
|
|
42
|
-
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.
|
|
42
|
+
aiohttp = ["aiohttp", "httpx_aiohttp>=0.1.9"]
|
|
43
43
|
|
|
44
44
|
[tool.rye]
|
|
45
45
|
managed = true
|
|
@@ -224,6 +224,8 @@ select = [
|
|
|
224
224
|
"B",
|
|
225
225
|
# remove unused imports
|
|
226
226
|
"F401",
|
|
227
|
+
# check for missing future annotations
|
|
228
|
+
"FA102",
|
|
227
229
|
# bare except statements
|
|
228
230
|
"E722",
|
|
229
231
|
# unused arguments
|
|
@@ -246,6 +248,8 @@ unfixable = [
|
|
|
246
248
|
"T203",
|
|
247
249
|
]
|
|
248
250
|
|
|
251
|
+
extend-safe-fixes = ["FA102"]
|
|
252
|
+
|
|
249
253
|
[tool.ruff.lint.flake8-tidy-imports.banned-api]
|
|
250
254
|
"functools.lru_cache".msg = "This function does not retain type information for the wrapped function's arguments; The `lru_cache` function from `_utils` should be used instead"
|
|
251
255
|
|
|
@@ -56,7 +56,7 @@ httpx==0.28.1
|
|
|
56
56
|
# via channel3-sdk
|
|
57
57
|
# via httpx-aiohttp
|
|
58
58
|
# via respx
|
|
59
|
-
httpx-aiohttp==0.1.
|
|
59
|
+
httpx-aiohttp==0.1.9
|
|
60
60
|
# via channel3-sdk
|
|
61
61
|
idna==3.4
|
|
62
62
|
# via anyio
|
|
@@ -88,9 +88,9 @@ pluggy==1.5.0
|
|
|
88
88
|
propcache==0.3.1
|
|
89
89
|
# via aiohttp
|
|
90
90
|
# via yarl
|
|
91
|
-
pydantic==2.
|
|
91
|
+
pydantic==2.11.9
|
|
92
92
|
# via channel3-sdk
|
|
93
|
-
pydantic-core==2.
|
|
93
|
+
pydantic-core==2.33.2
|
|
94
94
|
# via pydantic
|
|
95
95
|
pygments==2.18.0
|
|
96
96
|
# via rich
|
|
@@ -126,6 +126,9 @@ typing-extensions==4.12.2
|
|
|
126
126
|
# via pydantic
|
|
127
127
|
# via pydantic-core
|
|
128
128
|
# via pyright
|
|
129
|
+
# via typing-inspection
|
|
130
|
+
typing-inspection==0.4.1
|
|
131
|
+
# via pydantic
|
|
129
132
|
virtualenv==20.24.5
|
|
130
133
|
# via nox
|
|
131
134
|
yarl==1.20.0
|
|
@@ -43,7 +43,7 @@ httpcore==1.0.9
|
|
|
43
43
|
httpx==0.28.1
|
|
44
44
|
# via channel3-sdk
|
|
45
45
|
# via httpx-aiohttp
|
|
46
|
-
httpx-aiohttp==0.1.
|
|
46
|
+
httpx-aiohttp==0.1.9
|
|
47
47
|
# via channel3-sdk
|
|
48
48
|
idna==3.4
|
|
49
49
|
# via anyio
|
|
@@ -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.
|
|
58
|
+
pydantic==2.11.9
|
|
59
59
|
# via channel3-sdk
|
|
60
|
-
pydantic-core==2.
|
|
60
|
+
pydantic-core==2.33.2
|
|
61
61
|
# via pydantic
|
|
62
62
|
sniffio==1.3.0
|
|
63
63
|
# via anyio
|
|
@@ -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,10 +3,9 @@
|
|
|
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 (
|
|
9
|
-
ENVIRONMENTS,
|
|
10
9
|
Client,
|
|
11
10
|
Stream,
|
|
12
11
|
Timeout,
|
|
@@ -49,7 +48,9 @@ __all__ = [
|
|
|
49
48
|
"ProxiesTypes",
|
|
50
49
|
"NotGiven",
|
|
51
50
|
"NOT_GIVEN",
|
|
51
|
+
"not_given",
|
|
52
52
|
"Omit",
|
|
53
|
+
"omit",
|
|
53
54
|
"Channel3Error",
|
|
54
55
|
"APIError",
|
|
55
56
|
"APIStatusError",
|
|
@@ -72,7 +73,6 @@ __all__ = [
|
|
|
72
73
|
"AsyncStream",
|
|
73
74
|
"Channel3",
|
|
74
75
|
"AsyncChannel3",
|
|
75
|
-
"ENVIRONMENTS",
|
|
76
76
|
"file_from_path",
|
|
77
77
|
"BaseModel",
|
|
78
78
|
"DEFAULT_TIMEOUT",
|
|
@@ -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,6 +56,7 @@ 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
62
|
from ._compat import PYDANTIC_V1, model_copy, model_dump
|
|
@@ -145,9 +145,9 @@ class PageInfo:
|
|
|
145
145
|
def __init__(
|
|
146
146
|
self,
|
|
147
147
|
*,
|
|
148
|
-
url: URL | NotGiven =
|
|
149
|
-
json: Body | NotGiven =
|
|
150
|
-
params: Query | NotGiven =
|
|
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
|
|
@@ -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,
|
|
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 =
|
|
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 =
|
|
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 =
|
|
1822
|
-
post_parser: PostParser | NotGiven =
|
|
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,15 +3,14 @@
|
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
import os
|
|
6
|
-
from typing import Any,
|
|
7
|
-
from typing_extensions import Self,
|
|
6
|
+
from typing import Any, Mapping
|
|
7
|
+
from typing_extensions import Self, override
|
|
8
8
|
|
|
9
9
|
import httpx
|
|
10
10
|
|
|
11
11
|
from . import _exceptions
|
|
12
12
|
from ._qs import Querystring
|
|
13
13
|
from ._types import (
|
|
14
|
-
NOT_GIVEN,
|
|
15
14
|
Body,
|
|
16
15
|
Omit,
|
|
17
16
|
Query,
|
|
@@ -21,6 +20,7 @@ from ._types import (
|
|
|
21
20
|
Transport,
|
|
22
21
|
ProxiesTypes,
|
|
23
22
|
RequestOptions,
|
|
23
|
+
not_given,
|
|
24
24
|
)
|
|
25
25
|
from ._utils import is_given, get_async_library
|
|
26
26
|
from ._version import __version__
|
|
@@ -41,7 +41,6 @@ from ._base_client import (
|
|
|
41
41
|
)
|
|
42
42
|
|
|
43
43
|
__all__ = [
|
|
44
|
-
"ENVIRONMENTS",
|
|
45
44
|
"Timeout",
|
|
46
45
|
"Transport",
|
|
47
46
|
"ProxiesTypes",
|
|
@@ -52,11 +51,6 @@ __all__ = [
|
|
|
52
51
|
"AsyncClient",
|
|
53
52
|
]
|
|
54
53
|
|
|
55
|
-
ENVIRONMENTS: Dict[str, str] = {
|
|
56
|
-
"production": "https://api.trychannel3.com",
|
|
57
|
-
"development": "https://localhost:8000",
|
|
58
|
-
}
|
|
59
|
-
|
|
60
54
|
|
|
61
55
|
class Channel3(SyncAPIClient):
|
|
62
56
|
search: search.SearchResource
|
|
@@ -69,15 +63,12 @@ class Channel3(SyncAPIClient):
|
|
|
69
63
|
# client options
|
|
70
64
|
api_key: str
|
|
71
65
|
|
|
72
|
-
_environment: Literal["production", "development"] | NotGiven
|
|
73
|
-
|
|
74
66
|
def __init__(
|
|
75
67
|
self,
|
|
76
68
|
*,
|
|
77
69
|
api_key: str | None = None,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
|
|
70
|
+
base_url: str | httpx.URL | None = None,
|
|
71
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
81
72
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
82
73
|
default_headers: Mapping[str, str] | None = None,
|
|
83
74
|
default_query: Mapping[str, object] | None = None,
|
|
@@ -107,31 +98,10 @@ class Channel3(SyncAPIClient):
|
|
|
107
98
|
)
|
|
108
99
|
self.api_key = api_key
|
|
109
100
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
# cast required because mypy doesn't understand the type narrowing
|
|
115
|
-
base_url = cast("str | httpx.URL", base_url) # pyright: ignore[reportUnnecessaryCast]
|
|
116
|
-
elif is_given(environment):
|
|
117
|
-
if base_url_env and base_url is not None:
|
|
118
|
-
raise ValueError(
|
|
119
|
-
"Ambiguous URL; The `CHANNEL3_BASE_URL` env var and the `environment` argument are given. If you want to use the environment, you must pass base_url=None",
|
|
120
|
-
)
|
|
121
|
-
|
|
122
|
-
try:
|
|
123
|
-
base_url = ENVIRONMENTS[environment]
|
|
124
|
-
except KeyError as exc:
|
|
125
|
-
raise ValueError(f"Unknown environment: {environment}") from exc
|
|
126
|
-
elif base_url_env is not None:
|
|
127
|
-
base_url = base_url_env
|
|
128
|
-
else:
|
|
129
|
-
self._environment = environment = "production"
|
|
130
|
-
|
|
131
|
-
try:
|
|
132
|
-
base_url = ENVIRONMENTS[environment]
|
|
133
|
-
except KeyError as exc:
|
|
134
|
-
raise ValueError(f"Unknown environment: {environment}") from exc
|
|
101
|
+
if base_url is None:
|
|
102
|
+
base_url = os.environ.get("CHANNEL3_BASE_URL")
|
|
103
|
+
if base_url is None:
|
|
104
|
+
base_url = f"https://api.trychannel3.com"
|
|
135
105
|
|
|
136
106
|
super().__init__(
|
|
137
107
|
version=__version__,
|
|
@@ -175,11 +145,10 @@ class Channel3(SyncAPIClient):
|
|
|
175
145
|
self,
|
|
176
146
|
*,
|
|
177
147
|
api_key: str | None = None,
|
|
178
|
-
environment: Literal["production", "development"] | None = None,
|
|
179
148
|
base_url: str | httpx.URL | None = None,
|
|
180
|
-
timeout: float | Timeout | None | NotGiven =
|
|
149
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
181
150
|
http_client: httpx.Client | None = None,
|
|
182
|
-
max_retries: int | NotGiven =
|
|
151
|
+
max_retries: int | NotGiven = not_given,
|
|
183
152
|
default_headers: Mapping[str, str] | None = None,
|
|
184
153
|
set_default_headers: Mapping[str, str] | None = None,
|
|
185
154
|
default_query: Mapping[str, object] | None = None,
|
|
@@ -211,7 +180,6 @@ class Channel3(SyncAPIClient):
|
|
|
211
180
|
return self.__class__(
|
|
212
181
|
api_key=api_key or self.api_key,
|
|
213
182
|
base_url=base_url or self.base_url,
|
|
214
|
-
environment=environment or self._environment,
|
|
215
183
|
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
|
|
216
184
|
http_client=http_client,
|
|
217
185
|
max_retries=max_retries if is_given(max_retries) else self.max_retries,
|
|
@@ -232,7 +200,7 @@ class Channel3(SyncAPIClient):
|
|
|
232
200
|
extra_headers: Headers | None = None,
|
|
233
201
|
extra_query: Query | None = None,
|
|
234
202
|
extra_body: Body | None = None,
|
|
235
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
203
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
236
204
|
) -> object:
|
|
237
205
|
"""Root"""
|
|
238
206
|
return self.get(
|
|
@@ -288,15 +256,12 @@ class AsyncChannel3(AsyncAPIClient):
|
|
|
288
256
|
# client options
|
|
289
257
|
api_key: str
|
|
290
258
|
|
|
291
|
-
_environment: Literal["production", "development"] | NotGiven
|
|
292
|
-
|
|
293
259
|
def __init__(
|
|
294
260
|
self,
|
|
295
261
|
*,
|
|
296
262
|
api_key: str | None = None,
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
timeout: Union[float, Timeout, None, NotGiven] = NOT_GIVEN,
|
|
263
|
+
base_url: str | httpx.URL | None = None,
|
|
264
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
300
265
|
max_retries: int = DEFAULT_MAX_RETRIES,
|
|
301
266
|
default_headers: Mapping[str, str] | None = None,
|
|
302
267
|
default_query: Mapping[str, object] | None = None,
|
|
@@ -326,31 +291,10 @@ class AsyncChannel3(AsyncAPIClient):
|
|
|
326
291
|
)
|
|
327
292
|
self.api_key = api_key
|
|
328
293
|
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
# cast required because mypy doesn't understand the type narrowing
|
|
334
|
-
base_url = cast("str | httpx.URL", base_url) # pyright: ignore[reportUnnecessaryCast]
|
|
335
|
-
elif is_given(environment):
|
|
336
|
-
if base_url_env and base_url is not None:
|
|
337
|
-
raise ValueError(
|
|
338
|
-
"Ambiguous URL; The `CHANNEL3_BASE_URL` env var and the `environment` argument are given. If you want to use the environment, you must pass base_url=None",
|
|
339
|
-
)
|
|
340
|
-
|
|
341
|
-
try:
|
|
342
|
-
base_url = ENVIRONMENTS[environment]
|
|
343
|
-
except KeyError as exc:
|
|
344
|
-
raise ValueError(f"Unknown environment: {environment}") from exc
|
|
345
|
-
elif base_url_env is not None:
|
|
346
|
-
base_url = base_url_env
|
|
347
|
-
else:
|
|
348
|
-
self._environment = environment = "production"
|
|
349
|
-
|
|
350
|
-
try:
|
|
351
|
-
base_url = ENVIRONMENTS[environment]
|
|
352
|
-
except KeyError as exc:
|
|
353
|
-
raise ValueError(f"Unknown environment: {environment}") from exc
|
|
294
|
+
if base_url is None:
|
|
295
|
+
base_url = os.environ.get("CHANNEL3_BASE_URL")
|
|
296
|
+
if base_url is None:
|
|
297
|
+
base_url = f"https://api.trychannel3.com"
|
|
354
298
|
|
|
355
299
|
super().__init__(
|
|
356
300
|
version=__version__,
|
|
@@ -394,11 +338,10 @@ class AsyncChannel3(AsyncAPIClient):
|
|
|
394
338
|
self,
|
|
395
339
|
*,
|
|
396
340
|
api_key: str | None = None,
|
|
397
|
-
environment: Literal["production", "development"] | None = None,
|
|
398
341
|
base_url: str | httpx.URL | None = None,
|
|
399
|
-
timeout: float | Timeout | None | NotGiven =
|
|
342
|
+
timeout: float | Timeout | None | NotGiven = not_given,
|
|
400
343
|
http_client: httpx.AsyncClient | None = None,
|
|
401
|
-
max_retries: int | NotGiven =
|
|
344
|
+
max_retries: int | NotGiven = not_given,
|
|
402
345
|
default_headers: Mapping[str, str] | None = None,
|
|
403
346
|
set_default_headers: Mapping[str, str] | None = None,
|
|
404
347
|
default_query: Mapping[str, object] | None = None,
|
|
@@ -430,7 +373,6 @@ class AsyncChannel3(AsyncAPIClient):
|
|
|
430
373
|
return self.__class__(
|
|
431
374
|
api_key=api_key or self.api_key,
|
|
432
375
|
base_url=base_url or self.base_url,
|
|
433
|
-
environment=environment or self._environment,
|
|
434
376
|
timeout=self.timeout if isinstance(timeout, NotGiven) else timeout,
|
|
435
377
|
http_client=http_client,
|
|
436
378
|
max_retries=max_retries if is_given(max_retries) else self.max_retries,
|
|
@@ -451,7 +393,7 @@ class AsyncChannel3(AsyncAPIClient):
|
|
|
451
393
|
extra_headers: Headers | None = None,
|
|
452
394
|
extra_query: Query | None = None,
|
|
453
395
|
extra_body: Body | None = None,
|
|
454
|
-
timeout: float | httpx.Timeout | None | NotGiven =
|
|
396
|
+
timeout: float | httpx.Timeout | None | NotGiven = not_given,
|
|
455
397
|
) -> object:
|
|
456
398
|
"""Root"""
|
|
457
399
|
return await self.get(
|
|
@@ -256,7 +256,7 @@ class BaseModel(pydantic.BaseModel):
|
|
|
256
256
|
mode: Literal["json", "python"] | str = "python",
|
|
257
257
|
include: IncEx | None = None,
|
|
258
258
|
exclude: IncEx | None = None,
|
|
259
|
-
by_alias: bool =
|
|
259
|
+
by_alias: bool | None = None,
|
|
260
260
|
exclude_unset: bool = False,
|
|
261
261
|
exclude_defaults: bool = False,
|
|
262
262
|
exclude_none: bool = False,
|
|
@@ -264,6 +264,7 @@ class BaseModel(pydantic.BaseModel):
|
|
|
264
264
|
warnings: bool | Literal["none", "warn", "error"] = True,
|
|
265
265
|
context: dict[str, Any] | None = None,
|
|
266
266
|
serialize_as_any: bool = False,
|
|
267
|
+
fallback: Callable[[Any], Any] | None = None,
|
|
267
268
|
) -> dict[str, Any]:
|
|
268
269
|
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump
|
|
269
270
|
|
|
@@ -295,10 +296,12 @@ class BaseModel(pydantic.BaseModel):
|
|
|
295
296
|
raise ValueError("context is only supported in Pydantic v2")
|
|
296
297
|
if serialize_as_any != False:
|
|
297
298
|
raise ValueError("serialize_as_any is only supported in Pydantic v2")
|
|
299
|
+
if fallback is not None:
|
|
300
|
+
raise ValueError("fallback is only supported in Pydantic v2")
|
|
298
301
|
dumped = super().dict( # pyright: ignore[reportDeprecated]
|
|
299
302
|
include=include,
|
|
300
303
|
exclude=exclude,
|
|
301
|
-
by_alias=by_alias,
|
|
304
|
+
by_alias=by_alias if by_alias is not None else False,
|
|
302
305
|
exclude_unset=exclude_unset,
|
|
303
306
|
exclude_defaults=exclude_defaults,
|
|
304
307
|
exclude_none=exclude_none,
|
|
@@ -313,13 +316,14 @@ class BaseModel(pydantic.BaseModel):
|
|
|
313
316
|
indent: int | None = None,
|
|
314
317
|
include: IncEx | None = None,
|
|
315
318
|
exclude: IncEx | None = None,
|
|
316
|
-
by_alias: bool =
|
|
319
|
+
by_alias: bool | None = None,
|
|
317
320
|
exclude_unset: bool = False,
|
|
318
321
|
exclude_defaults: bool = False,
|
|
319
322
|
exclude_none: bool = False,
|
|
320
323
|
round_trip: bool = False,
|
|
321
324
|
warnings: bool | Literal["none", "warn", "error"] = True,
|
|
322
325
|
context: dict[str, Any] | None = None,
|
|
326
|
+
fallback: Callable[[Any], Any] | None = None,
|
|
323
327
|
serialize_as_any: bool = False,
|
|
324
328
|
) -> str:
|
|
325
329
|
"""Usage docs: https://docs.pydantic.dev/2.4/concepts/serialization/#modelmodel_dump_json
|
|
@@ -348,11 +352,13 @@ class BaseModel(pydantic.BaseModel):
|
|
|
348
352
|
raise ValueError("context is only supported in Pydantic v2")
|
|
349
353
|
if serialize_as_any != False:
|
|
350
354
|
raise ValueError("serialize_as_any is only supported in Pydantic v2")
|
|
355
|
+
if fallback is not None:
|
|
356
|
+
raise ValueError("fallback is only supported in Pydantic v2")
|
|
351
357
|
return super().json( # type: ignore[reportDeprecated]
|
|
352
358
|
indent=indent,
|
|
353
359
|
include=include,
|
|
354
360
|
exclude=exclude,
|
|
355
|
-
by_alias=by_alias,
|
|
361
|
+
by_alias=by_alias if by_alias is not None else False,
|
|
356
362
|
exclude_unset=exclude_unset,
|
|
357
363
|
exclude_defaults=exclude_defaults,
|
|
358
364
|
exclude_none=exclude_none,
|
|
@@ -4,7 +4,7 @@ from typing import Any, List, Tuple, Union, Mapping, TypeVar
|
|
|
4
4
|
from urllib.parse import parse_qs, urlencode
|
|
5
5
|
from typing_extensions import Literal, get_args
|
|
6
6
|
|
|
7
|
-
from ._types import
|
|
7
|
+
from ._types import NotGiven, not_given
|
|
8
8
|
from ._utils import flatten
|
|
9
9
|
|
|
10
10
|
_T = TypeVar("_T")
|
|
@@ -41,8 +41,8 @@ class Querystring:
|
|
|
41
41
|
self,
|
|
42
42
|
params: Params,
|
|
43
43
|
*,
|
|
44
|
-
array_format:
|
|
45
|
-
nested_format:
|
|
44
|
+
array_format: ArrayFormat | NotGiven = not_given,
|
|
45
|
+
nested_format: NestedFormat | NotGiven = not_given,
|
|
46
46
|
) -> str:
|
|
47
47
|
return urlencode(
|
|
48
48
|
self.stringify_items(
|
|
@@ -56,8 +56,8 @@ class Querystring:
|
|
|
56
56
|
self,
|
|
57
57
|
params: Params,
|
|
58
58
|
*,
|
|
59
|
-
array_format:
|
|
60
|
-
nested_format:
|
|
59
|
+
array_format: ArrayFormat | NotGiven = not_given,
|
|
60
|
+
nested_format: NestedFormat | NotGiven = not_given,
|
|
61
61
|
) -> list[tuple[str, str]]:
|
|
62
62
|
opts = Options(
|
|
63
63
|
qs=self,
|
|
@@ -143,8 +143,8 @@ class Options:
|
|
|
143
143
|
self,
|
|
144
144
|
qs: Querystring = _qs,
|
|
145
145
|
*,
|
|
146
|
-
array_format:
|
|
147
|
-
nested_format:
|
|
146
|
+
array_format: ArrayFormat | NotGiven = not_given,
|
|
147
|
+
nested_format: NestedFormat | NotGiven = not_given,
|
|
148
148
|
) -> None:
|
|
149
149
|
self.array_format = qs.array_format if isinstance(array_format, NotGiven) else array_format
|
|
150
150
|
self.nested_format = qs.nested_format if isinstance(nested_format, NotGiven) else nested_format
|