From 85e6982107d4355bb8780ba363cf271692651678 Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Fri, 22 May 2026 03:20:16 +0000 Subject: [PATCH] [fern-generated] Update SDK Generated by Fern CLI Version: unknown Generators: - fernapi/fern-python-sdk: 5.12.1 --- .fern/metadata.json | 4 ++-- poetry.lock | 22 +++++++++++----------- pyproject.toml | 2 +- src/pipedream/core/client_wrapper.py | 4 ++-- src/pipedream/oauth_tokens/raw_client.py | 23 +++++++++++++++++++++++ 5 files changed, 39 insertions(+), 16 deletions(-) diff --git a/.fern/metadata.json b/.fern/metadata.json index 8b8520e..e96d3f9 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -10,9 +10,9 @@ "exported_filename": "pipedream.py" } }, - "originGitCommit": "b98152f4744d4752cacd615b76d9524eae3eb3a3", + "originGitCommit": "fa2fad94474bee68b5a4c87f25775ff6701a0fe6", "originGitCommitIsDirty": false, "invokedBy": "ci", "ciProvider": "github", - "sdkVersion": "2.0.3" + "sdkVersion": "2.0.4" } \ No newline at end of file diff --git a/poetry.lock b/poetry.lock index 0219856..4111119 100644 --- a/poetry.lock +++ b/poetry.lock @@ -2,13 +2,13 @@ [[package]] name = "aiohappyeyeballs" -version = "2.6.1" +version = "2.6.2" description = "Happy Eyeballs for asyncio" optional = true -python-versions = ">=3.9" +python-versions = ">=3.10" files = [ - {file = "aiohappyeyeballs-2.6.1-py3-none-any.whl", hash = "sha256:f349ba8f4b75cb25c99c5c2d84e997e485204d2902a9597802b0371f09331fb8"}, - {file = "aiohappyeyeballs-2.6.1.tar.gz", hash = "sha256:c3f9d0113123803ccadfdf3f0faa505bc78e6a72d1cc4806cbd719826e943558"}, + {file = "aiohappyeyeballs-2.6.2-py3-none-any.whl", hash = "sha256:4708045e2d7a6c6bdf8aafa8ed39649eaf926a4543b54560659129e3365953c4"}, + {file = "aiohappyeyeballs-2.6.2.tar.gz", hash = "sha256:e202810ee718bd01fc6ef49e8ea53d023d5cb6b581076d7925aa499fa55dbe64"}, ] [[package]] @@ -233,13 +233,13 @@ files = [ [[package]] name = "certifi" -version = "2026.4.22" +version = "2026.5.20" description = "Python package for providing Mozilla's CA Bundle." optional = false python-versions = ">=3.7" files = [ - {file = "certifi-2026.4.22-py3-none-any.whl", hash = "sha256:3cb2210c8f88ba2318d29b0388d1023c8492ff72ecdde4ebdaddbb13a31b1c4a"}, - {file = "certifi-2026.4.22.tar.gz", hash = "sha256:8d455352a37b71bf76a79caa83a3d6c25afee4a385d632127b6afb3963f1c580"}, + {file = "certifi-2026.5.20-py3-none-any.whl", hash = "sha256:3c52e209ba0a4ad7aebe60436a4ab349c39e1e602e8c134221e546902ad25897"}, + {file = "certifi-2026.5.20.tar.gz", hash = "sha256:69dea482ab64caa7b9f6aba1c6bf48bb6a5448d1c0f1b17ab42ad8c763a5344d"}, ] [[package]] @@ -496,13 +496,13 @@ httpx = ">=0.27.0" [[package]] name = "idna" -version = "3.15" +version = "3.16" description = "Internationalized Domain Names in Applications (IDNA)" optional = false -python-versions = ">=3.8" +python-versions = ">=3.9" files = [ - {file = "idna-3.15-py3-none-any.whl", hash = "sha256:048adeaf8c2d788c40fee287673ccaa74c24ffd8dcf09ffa555a2fbb59f10ac8"}, - {file = "idna-3.15.tar.gz", hash = "sha256:ca962446ea538f7092a95e057da437618e886f4d349216d2b1e294abfdb65fdc"}, + {file = "idna-3.16-py3-none-any.whl", hash = "sha256:cc246e3a3f89580c3a951b5ad298ca4638078b2cdd4f115654332b5c26daded5"}, + {file = "idna-3.16.tar.gz", hash = "sha256:d7a6da03db833450fca25d2358ac9ff06cd624577a4aea3a596d5c0f77b8e03d"}, ] [package.extras] diff --git a/pyproject.toml b/pyproject.toml index 4d85393..c3be54d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ dynamic = ["version"] [tool.poetry] name = "pipedream" -version = "2.0.3" +version = "2.0.4" description = "" readme = "README.md" authors = [] diff --git a/src/pipedream/core/client_wrapper.py b/src/pipedream/core/client_wrapper.py index 035443b..4bf948c 100644 --- a/src/pipedream/core/client_wrapper.py +++ b/src/pipedream/core/client_wrapper.py @@ -34,12 +34,12 @@ def get_headers(self) -> typing.Dict[str, str]: import platform headers: typing.Dict[str, str] = { - "User-Agent": "pipedream/2.0.3", + "User-Agent": "pipedream/2.0.4", "X-Fern-Language": "Python", "X-Fern-Runtime": f"python/{platform.python_version()}", "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", "X-Fern-SDK-Name": "pipedream", - "X-Fern-SDK-Version": "2.0.3", + "X-Fern-SDK-Version": "2.0.4", **(self.get_custom_headers() or {}), } if self._project_environment is not None: diff --git a/src/pipedream/oauth_tokens/raw_client.py b/src/pipedream/oauth_tokens/raw_client.py index 73ff2c4..fe934fa 100644 --- a/src/pipedream/oauth_tokens/raw_client.py +++ b/src/pipedream/oauth_tokens/raw_client.py @@ -9,6 +9,7 @@ from ..core.parse_error import ParsingError from ..core.pydantic_utilities import parse_obj_as from ..core.request_options import RequestOptions +from ..errors.too_many_requests_error import TooManyRequestsError from ..types.create_o_auth_token_response import CreateOAuthTokenResponse from pydantic import ValidationError @@ -73,6 +74,17 @@ def create( ), ) return HttpResponse(response=_response, data=_data) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text) @@ -140,6 +152,17 @@ async def create( ), ) return AsyncHttpResponse(response=_response, data=_data) + if _response.status_code == 429: + raise TooManyRequestsError( + headers=dict(_response.headers), + body=typing.cast( + typing.Any, + parse_obj_as( + type_=typing.Any, # type: ignore + object_=_response.json(), + ), + ), + ) _response_json = _response.json() except JSONDecodeError: raise ApiError(status_code=_response.status_code, headers=dict(_response.headers), body=_response.text)