Skip to content

Commit 68d46fc

Browse files
🌿 Fern Regeneration -- July 7, 2025 (#5)
* SDK regeneration * Remove unnecessary code --------- Co-authored-by: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Co-authored-by: Jay Vercellone <[email protected]>
1 parent 6e1bc8d commit 68d46fc

File tree

2 files changed

+28
-20
lines changed

2 files changed

+28
-20
lines changed

src/pipedream/client.py

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# This file was auto-generated by Fern from our API Definition.
22

3+
import os
34
import typing
45

56
import httpx
@@ -8,6 +9,7 @@
89
from .app_categories.client import AppCategoriesClient, AsyncAppCategoriesClient
910
from .apps.client import AppsClient, AsyncAppsClient
1011
from .components.client import AsyncComponentsClient, ComponentsClient
12+
from .core.api_error import ApiError
1113
from .core.client_wrapper import AsyncClientWrapper, SyncClientWrapper
1214
from .core.oauth_token_provider import OAuthTokenProvider
1315
from .deployed_triggers.client import AsyncDeployedTriggersClient, DeployedTriggersClient
@@ -40,8 +42,8 @@ class Client:
4042
4143
project_id : str
4244
x_pd_environment : typing.Optional[str]
43-
client_id : str
44-
client_secret : str
45+
client_id : typing.Optional[str]
46+
client_secret : typing.Optional[str]
4547
_token_getter_override : typing.Optional[typing.Callable[[], str]]
4648
timeout : typing.Optional[float]
4749
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
@@ -71,8 +73,8 @@ def __init__(
7173
environment: PipedreamEnvironment = PipedreamEnvironment.PROD,
7274
project_id: str,
7375
x_pd_environment: typing.Optional[str] = None,
74-
client_id: str,
75-
client_secret: str,
76+
client_id: typing.Optional[str] = os.getenv("PIPEDREAM_CLIENT_ID"),
77+
client_secret: typing.Optional[str] = os.getenv("PIPEDREAM_CLIENT_SECRET"),
7678
_token_getter_override: typing.Optional[typing.Callable[[], str]] = None,
7779
timeout: typing.Optional[float] = None,
7880
follow_redirects: typing.Optional[bool] = True,
@@ -81,6 +83,14 @@ def __init__(
8183
_defaulted_timeout = (
8284
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
8385
)
86+
if client_id is None:
87+
raise ApiError(
88+
body="The client must be instantiated be either passing in client_id or setting PIPEDREAM_CLIENT_ID"
89+
)
90+
if client_secret is None:
91+
raise ApiError(
92+
body="The client must be instantiated be either passing in client_secret or setting PIPEDREAM_CLIENT_SECRET"
93+
)
8494
oauth_token_provider = OAuthTokenProvider(
8595
client_id=client_id,
8696
client_secret=client_secret,
@@ -140,8 +150,8 @@ class AsyncClient:
140150
141151
project_id : str
142152
x_pd_environment : typing.Optional[str]
143-
client_id : str
144-
client_secret : str
153+
client_id : typing.Optional[str]
154+
client_secret : typing.Optional[str]
145155
_token_getter_override : typing.Optional[typing.Callable[[], str]]
146156
timeout : typing.Optional[float]
147157
The timeout to be used, in seconds, for requests. By default the timeout is 60 seconds, unless a custom httpx client is used, in which case this default is not enforced.
@@ -171,8 +181,8 @@ def __init__(
171181
environment: PipedreamEnvironment = PipedreamEnvironment.PROD,
172182
project_id: str,
173183
x_pd_environment: typing.Optional[str] = None,
174-
client_id: str,
175-
client_secret: str,
184+
client_id: typing.Optional[str] = os.getenv("PIPEDREAM_CLIENT_ID"),
185+
client_secret: typing.Optional[str] = os.getenv("PIPEDREAM_CLIENT_SECRET"),
176186
_token_getter_override: typing.Optional[typing.Callable[[], str]] = None,
177187
timeout: typing.Optional[float] = None,
178188
follow_redirects: typing.Optional[bool] = True,
@@ -181,6 +191,14 @@ def __init__(
181191
_defaulted_timeout = (
182192
timeout if timeout is not None else 60 if httpx_client is None else httpx_client.timeout.read
183193
)
194+
if client_id is None:
195+
raise ApiError(
196+
body="The client must be instantiated be either passing in client_id or setting PIPEDREAM_CLIENT_ID"
197+
)
198+
if client_secret is None:
199+
raise ApiError(
200+
body="The client must be instantiated be either passing in client_secret or setting PIPEDREAM_CLIENT_SECRET"
201+
)
184202
oauth_token_provider = OAuthTokenProvider(
185203
client_id=client_id,
186204
client_secret=client_secret,

src/pipedream/pipedream.py

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,8 @@ def __init__(
1818
client_id: Optional[str] = None,
1919
client_secret: Optional[str] = None,
2020
):
21-
self.client_id = client_id or os.getenv("PIPEDREAM_CLIENT_ID")
22-
self.client_secret = client_secret or os.getenv(
23-
"PIPEDREAM_CLIENT_SECRET")
24-
25-
if not self.client_id or not self.client_secret:
26-
raise ValueError("OAuth client ID and secret are required")
21+
self.client_id = client_id
22+
self.client_secret = client_secret
2723

2824

2925
class Pipedream(Client):
@@ -41,9 +37,6 @@ def __init__(
4137
if not project_id:
4238
raise ValueError("Project ID is required")
4339

44-
if not credentials.client_id or not credentials.client_secret:
45-
raise ValueError("OAuth client ID and secret are required")
46-
4740
super().__init__(
4841
client_id=credentials.client_id,
4942
client_secret=credentials.client_secret,
@@ -69,9 +62,6 @@ def __init__(
6962
if not project_id:
7063
raise ValueError("Project ID is required")
7164

72-
if not credentials.client_id or not credentials.client_secret:
73-
raise ValueError("OAuth client ID and secret are required")
74-
7565
super().__init__(
7666
client_id=credentials.client_id,
7767
client_secret=credentials.client_secret,

0 commit comments

Comments
 (0)