From d4b17b0534e20d7c0005e8c91ff3de022aa5f7c6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 17:06:44 +0000 Subject: [PATCH 1/2] feat(client): support file upload requests --- src/orb/_base_client.py | 5 ++++- src/orb/_files.py | 8 ++++---- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/orb/_base_client.py b/src/orb/_base_client.py index 30832fc9..d355fc69 100644 --- a/src/orb/_base_client.py +++ b/src/orb/_base_client.py @@ -533,7 +533,10 @@ def _build_request( is_body_allowed = options.method.lower() != "get" if is_body_allowed: - kwargs["json"] = json_data if is_given(json_data) else None + if isinstance(json_data, bytes): + kwargs["content"] = json_data + else: + kwargs["json"] = json_data if is_given(json_data) else None kwargs["files"] = files else: headers.pop("Content-Type", None) diff --git a/src/orb/_files.py b/src/orb/_files.py index 715cc207..cc14c14f 100644 --- a/src/orb/_files.py +++ b/src/orb/_files.py @@ -69,12 +69,12 @@ def _transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], _read_file_content(file[1]), *file[2:]) + return (file[0], read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -def _read_file_content(file: FileContent) -> HttpxFileContent: +def read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return pathlib.Path(file).read_bytes() return file @@ -111,12 +111,12 @@ async def _async_transform_file(file: FileTypes) -> HttpxFileTypes: return file if is_tuple_t(file): - return (file[0], await _async_read_file_content(file[1]), *file[2:]) + return (file[0], await async_read_file_content(file[1]), *file[2:]) raise TypeError(f"Expected file types input to be a FileContent type or to be a tuple") -async def _async_read_file_content(file: FileContent) -> HttpxFileContent: +async def async_read_file_content(file: FileContent) -> HttpxFileContent: if isinstance(file, os.PathLike): return await anyio.Path(file).read_bytes() From 5c8b968a4bf6900ce52c8da020f451e9a86ee9c8 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 30 Jul 2025 17:07:04 +0000 Subject: [PATCH 2/2] release: 4.11.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ pyproject.toml | 2 +- src/orb/_version.py | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index ad56a78c..a43b15a4 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "4.10.0" + ".": "4.11.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a3aa51a..ad4c9be8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 4.11.0 (2025-07-30) + +Full Changelog: [v4.10.0...v4.11.0](https://github.com/orbcorp/orb-python/compare/v4.10.0...v4.11.0) + +### Features + +* **client:** support file upload requests ([d4b17b0](https://github.com/orbcorp/orb-python/commit/d4b17b0534e20d7c0005e8c91ff3de022aa5f7c6)) + ## 4.10.0 (2025-07-26) Full Changelog: [v4.9.0...v4.10.0](https://github.com/orbcorp/orb-python/compare/v4.9.0...v4.10.0) diff --git a/pyproject.toml b/pyproject.toml index c303930a..a578d173 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "orb-billing" -version = "4.10.0" +version = "4.11.0" description = "The official Python library for the orb API" dynamic = ["readme"] license = "Apache-2.0" diff --git a/src/orb/_version.py b/src/orb/_version.py index 7b52cf46..1ee678ff 100644 --- a/src/orb/_version.py +++ b/src/orb/_version.py @@ -1,4 +1,4 @@ # File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. __title__ = "orb" -__version__ = "4.10.0" # x-release-please-version +__version__ = "4.11.0" # x-release-please-version