@@ -65,11 +65,13 @@ class Orb(SyncAPIClient):
65
65
66
66
# client options
67
67
api_key : str
68
+ webhook_secret : str | None
68
69
69
70
def __init__ (
70
71
self ,
71
72
* ,
72
73
api_key : str | None = None ,
74
+ webhook_secret : str | None = None ,
73
75
base_url : str | httpx .URL | None = None ,
74
76
timeout : Union [float , Timeout , None , NotGiven ] = NOT_GIVEN ,
75
77
max_retries : int = DEFAULT_MAX_RETRIES ,
@@ -89,7 +91,9 @@ def __init__(
89
91
) -> None :
90
92
"""Construct a new synchronous orb client instance.
91
93
92
- This automatically infers the `api_key` argument from the `ORB_API_KEY` environment variable if it is not provided.
94
+ This automatically infers the following arguments from their corresponding environment variables if they are not provided:
95
+ - `api_key` from `ORB_API_KEY`
96
+ - `webhook_secret` from `ORB_WEBHOOK_SECRET`
93
97
"""
94
98
if api_key is None :
95
99
api_key = os .environ .get ("ORB_API_KEY" )
@@ -99,6 +103,10 @@ def __init__(
99
103
)
100
104
self .api_key = api_key
101
105
106
+ if webhook_secret is None :
107
+ webhook_secret = os .environ .get ("ORB_WEBHOOK_SECRET" )
108
+ self .webhook_secret = webhook_secret
109
+
102
110
if base_url is None :
103
111
base_url = os .environ .get ("ORB_BASE_URL" )
104
112
if base_url is None :
@@ -157,6 +165,7 @@ def copy(
157
165
self ,
158
166
* ,
159
167
api_key : str | None = None ,
168
+ webhook_secret : str | None = None ,
160
169
base_url : str | httpx .URL | None = None ,
161
170
timeout : float | Timeout | None | NotGiven = NOT_GIVEN ,
162
171
http_client : httpx .Client | None = None ,
@@ -191,6 +200,7 @@ def copy(
191
200
http_client = http_client or self ._client
192
201
return self .__class__ (
193
202
api_key = api_key or self .api_key ,
203
+ webhook_secret = webhook_secret or self .webhook_secret ,
194
204
base_url = base_url or self .base_url ,
195
205
timeout = self .timeout if isinstance (timeout , NotGiven ) else timeout ,
196
206
http_client = http_client ,
@@ -305,11 +315,13 @@ class AsyncOrb(AsyncAPIClient):
305
315
306
316
# client options
307
317
api_key : str
318
+ webhook_secret : str | None
308
319
309
320
def __init__ (
310
321
self ,
311
322
* ,
312
323
api_key : str | None = None ,
324
+ webhook_secret : str | None = None ,
313
325
base_url : str | httpx .URL | None = None ,
314
326
timeout : Union [float , Timeout , None , NotGiven ] = NOT_GIVEN ,
315
327
max_retries : int = DEFAULT_MAX_RETRIES ,
@@ -329,7 +341,9 @@ def __init__(
329
341
) -> None :
330
342
"""Construct a new async orb client instance.
331
343
332
- This automatically infers the `api_key` argument from the `ORB_API_KEY` environment variable if it is not provided.
344
+ This automatically infers the following arguments from their corresponding environment variables if they are not provided:
345
+ - `api_key` from `ORB_API_KEY`
346
+ - `webhook_secret` from `ORB_WEBHOOK_SECRET`
333
347
"""
334
348
if api_key is None :
335
349
api_key = os .environ .get ("ORB_API_KEY" )
@@ -339,6 +353,10 @@ def __init__(
339
353
)
340
354
self .api_key = api_key
341
355
356
+ if webhook_secret is None :
357
+ webhook_secret = os .environ .get ("ORB_WEBHOOK_SECRET" )
358
+ self .webhook_secret = webhook_secret
359
+
342
360
if base_url is None :
343
361
base_url = os .environ .get ("ORB_BASE_URL" )
344
362
if base_url is None :
@@ -397,6 +415,7 @@ def copy(
397
415
self ,
398
416
* ,
399
417
api_key : str | None = None ,
418
+ webhook_secret : str | None = None ,
400
419
base_url : str | httpx .URL | None = None ,
401
420
timeout : float | Timeout | None | NotGiven = NOT_GIVEN ,
402
421
http_client : httpx .AsyncClient | None = None ,
@@ -431,6 +450,7 @@ def copy(
431
450
http_client = http_client or self ._client
432
451
return self .__class__ (
433
452
api_key = api_key or self .api_key ,
453
+ webhook_secret = webhook_secret or self .webhook_secret ,
434
454
base_url = base_url or self .base_url ,
435
455
timeout = self .timeout if isinstance (timeout , NotGiven ) else timeout ,
436
456
http_client = http_client ,
0 commit comments