1
1
# This file was auto-generated by Fern from our API Definition.
2
2
3
- import os
4
3
import typing
5
4
6
5
import httpx
9
8
from .app_categories .client import AppCategoriesClient , AsyncAppCategoriesClient
10
9
from .apps .client import AppsClient , AsyncAppsClient
11
10
from .components .client import AsyncComponentsClient , ComponentsClient
12
- from .core .api_error import ApiError
13
11
from .core .client_wrapper import AsyncClientWrapper , SyncClientWrapper
14
12
from .core .oauth_token_provider import OAuthTokenProvider
15
13
from .deployed_triggers .client import AsyncDeployedTriggersClient , DeployedTriggersClient
@@ -42,8 +40,8 @@ class Client:
42
40
43
41
project_id : str
44
42
x_pd_environment : typing.Optional[str]
45
- client_id : typing.Optional[ str]
46
- client_secret : typing.Optional[ str]
43
+ client_id : str
44
+ client_secret : str
47
45
_token_getter_override : typing.Optional[typing.Callable[[], str]]
48
46
timeout : typing.Optional[float]
49
47
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.
@@ -73,8 +71,8 @@ def __init__(
73
71
environment : PipedreamEnvironment = PipedreamEnvironment .PROD ,
74
72
project_id : str ,
75
73
x_pd_environment : typing .Optional [str ] = None ,
76
- client_id : typing . Optional [ str ] = os . getenv ( "PIPEDREAM_CLIENT_ID" ) ,
77
- client_secret : typing . Optional [ str ] = os . getenv ( "PIPEDREAM_CLIENT_SECRET" ) ,
74
+ client_id : str ,
75
+ client_secret : str ,
78
76
_token_getter_override : typing .Optional [typing .Callable [[], str ]] = None ,
79
77
timeout : typing .Optional [float ] = None ,
80
78
follow_redirects : typing .Optional [bool ] = True ,
@@ -83,14 +81,6 @@ def __init__(
83
81
_defaulted_timeout = (
84
82
timeout if timeout is not None else 60 if httpx_client is None else httpx_client .timeout .read
85
83
)
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
- )
94
84
oauth_token_provider = OAuthTokenProvider (
95
85
client_id = client_id ,
96
86
client_secret = client_secret ,
@@ -150,8 +140,8 @@ class AsyncClient:
150
140
151
141
project_id : str
152
142
x_pd_environment : typing.Optional[str]
153
- client_id : typing.Optional[ str]
154
- client_secret : typing.Optional[ str]
143
+ client_id : str
144
+ client_secret : str
155
145
_token_getter_override : typing.Optional[typing.Callable[[], str]]
156
146
timeout : typing.Optional[float]
157
147
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.
@@ -181,8 +171,8 @@ def __init__(
181
171
environment : PipedreamEnvironment = PipedreamEnvironment .PROD ,
182
172
project_id : str ,
183
173
x_pd_environment : typing .Optional [str ] = None ,
184
- client_id : typing . Optional [ str ] = os . getenv ( "PIPEDREAM_CLIENT_ID" ) ,
185
- client_secret : typing . Optional [ str ] = os . getenv ( "PIPEDREAM_CLIENT_SECRET" ) ,
174
+ client_id : str ,
175
+ client_secret : str ,
186
176
_token_getter_override : typing .Optional [typing .Callable [[], str ]] = None ,
187
177
timeout : typing .Optional [float ] = None ,
188
178
follow_redirects : typing .Optional [bool ] = True ,
@@ -191,14 +181,6 @@ def __init__(
191
181
_defaulted_timeout = (
192
182
timeout if timeout is not None else 60 if httpx_client is None else httpx_client .timeout .read
193
183
)
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
- )
202
184
oauth_token_provider = OAuthTokenProvider (
203
185
client_id = client_id ,
204
186
client_secret = client_secret ,
0 commit comments