@@ -18,8 +18,9 @@ def __init__(
18
18
client_id : Optional [str ] = None ,
19
19
client_secret : Optional [str ] = None ,
20
20
):
21
- self .client_id = client_id
22
- self .client_secret = client_secret
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" )
23
24
24
25
25
26
class Pipedream (Client ):
@@ -38,9 +39,9 @@ def __init__(
38
39
raise ValueError ("Project ID is required" )
39
40
40
41
super ().__init__ (
42
+ base_url = _get_base_url (api_environment ),
41
43
client_id = credentials .client_id ,
42
44
client_secret = credentials .client_secret ,
43
- environment = api_environment ,
44
45
project_id = project_id ,
45
46
x_pd_environment = environment ,
46
47
** kwargs ,
@@ -63,10 +64,17 @@ def __init__(
63
64
raise ValueError ("Project ID is required" )
64
65
65
66
super ().__init__ (
67
+ base_url = _get_base_url (api_environment ),
66
68
client_id = credentials .client_id ,
67
69
client_secret = credentials .client_secret ,
68
- environment = api_environment ,
69
70
project_id = project_id ,
70
71
x_pd_environment = environment ,
71
72
** kwargs ,
72
73
)
74
+
75
+
76
+ def _get_base_url (environment : PipedreamEnvironment ) -> str :
77
+ """
78
+ Returns the base URL for the given environment.
79
+ """
80
+ return os .path .expandvars (environment .value )
0 commit comments