You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from speakeasy_client_sdk_python.models import shared
27
26
28
27
s = Speakeasy(
29
28
security=shared.Security(
30
-
api_key=os.getenv("API_KEY", ""),
29
+
api_key="<YOUR_API_KEY_HERE>",
31
30
),
32
31
)
33
32
@@ -45,14 +44,13 @@ The same SDK client can also be used to make asychronous requests by importing a
45
44
```python
46
45
# Asynchronous Example
47
46
import asyncio
48
-
import os
49
47
from speakeasy_client_sdk_python import Speakeasy
50
48
from speakeasy_client_sdk_python.models import shared
51
49
52
50
asyncdefmain():
53
51
s = Speakeasy(
54
52
security=shared.Security(
55
-
api_key=os.getenv("API_KEY", ""),
53
+
api_key="<YOUR_API_KEY_HERE>",
56
54
),
57
55
)
58
56
res =await s.apis.get_apis_async()
@@ -200,13 +198,12 @@ Handling errors in this SDK should largely match your expectations. All operati
200
198
### Example
201
199
202
200
```python
203
-
import os
204
201
from speakeasy_client_sdk_python import Speakeasy
205
202
from speakeasy_client_sdk_python.models import errors, shared
206
203
207
204
s = Speakeasy(
208
205
security=shared.Security(
209
-
api_key=os.getenv("API_KEY", ""),
206
+
api_key="<YOUR_API_KEY_HERE>",
210
207
),
211
208
)
212
209
@@ -246,14 +243,13 @@ You can override the default server globally by passing a server name to the `se
246
243
#### Example
247
244
248
245
```python
249
-
import os
250
246
from speakeasy_client_sdk_python import Speakeasy
251
247
from speakeasy_client_sdk_python.models import shared
252
248
253
249
s = Speakeasy(
254
250
server="prod",
255
251
security=shared.Security(
256
-
api_key=os.getenv("API_KEY", ""),
252
+
api_key="<YOUR_API_KEY_HERE>",
257
253
),
258
254
)
259
255
@@ -274,14 +270,13 @@ if res is not None:
274
270
275
271
The default server can also be overridden globally by passing a URL to the `server_url: str` optional parameter when initializing the SDK client instance. For example:
276
272
```python
277
-
import os
278
273
from speakeasy_client_sdk_python import Speakeasy
279
274
from speakeasy_client_sdk_python.models import shared
280
275
281
276
s = Speakeasy(
282
277
server_url="https://api.prod.speakeasyapi.dev",
283
278
security=shared.Security(
284
-
api_key=os.getenv("API_KEY", ""),
279
+
api_key="<YOUR_API_KEY_HERE>",
285
280
),
286
281
)
287
282
@@ -397,13 +392,12 @@ This SDK supports the following security schemes globally:
397
392
398
393
You can set the security parameters through the `security` optional parameter when initializing the SDK client instance. The selected scheme will be used by default to authenticate with the API for all operations that support it. For example:
399
394
```python
400
-
import os
401
395
from speakeasy_client_sdk_python import Speakeasy
402
396
from speakeasy_client_sdk_python.models import shared
403
397
404
398
s = Speakeasy(
405
399
security=shared.Security(
406
-
api_key=os.getenv("API_KEY", ""),
400
+
api_key="<YOUR_API_KEY_HERE>",
407
401
),
408
402
)
409
403
@@ -440,13 +434,12 @@ The following global parameter is available.
440
434
### Example
441
435
442
436
```python
443
-
import os
444
437
from speakeasy_client_sdk_python import Speakeasy
445
438
from speakeasy_client_sdk_python.models import shared
446
439
447
440
s = Speakeasy(
448
441
security=shared.Security(
449
-
api_key=os.getenv("API_KEY", ""),
442
+
api_key="<YOUR_API_KEY_HERE>",
450
443
),
451
444
)
452
445
@@ -467,14 +460,13 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an
467
460
468
461
To change the default retry strategy for a single API call, simply provide a `RetryConfig` object to the call:
469
462
```python
470
-
import os
471
463
from speakeasy.utils import BackoffStrategy, RetryConfig
472
464
from speakeasy_client_sdk_python import Speakeasy
473
465
from speakeasy_client_sdk_python.models import shared
474
466
475
467
s = Speakeasy(
476
468
security=shared.Security(
477
-
api_key=os.getenv("API_KEY", ""),
469
+
api_key="<YOUR_API_KEY_HERE>",
478
470
),
479
471
)
480
472
@@ -493,15 +485,14 @@ if res is not None:
493
485
494
486
If you'd like to override the default retry strategy for all operations that support retries, you can use the `retry_config` optional parameter when initializing the SDK:
495
487
```python
496
-
import os
497
488
from speakeasy.utils import BackoffStrategy, RetryConfig
498
489
from speakeasy_client_sdk_python import Speakeasy
499
490
from speakeasy_client_sdk_python.models import shared
@@ -529,13 +520,12 @@ Certain SDK methods accept file objects as part of a request body or multi-part
529
520
>
530
521
531
522
```python
532
-
import os
533
523
from speakeasy_client_sdk_python import Speakeasy
534
524
from speakeasy_client_sdk_python.models import shared
535
525
536
526
s = Speakeasy(
537
527
security=shared.Security(
538
-
api_key=os.getenv("API_KEY", ""),
528
+
api_key="<YOUR_API_KEY_HERE>",
539
529
),
540
530
)
541
531
@@ -572,6 +562,16 @@ s = Speakeasy(debug_logger=logging.getLogger("speakeasy_client_sdk_python"))
572
562
```
573
563
<!-- End Debugging [debug] -->
574
564
565
+
<!-- Start IDE Support [idesupport] -->
566
+
## IDE Support
567
+
568
+
### PyCharm
569
+
570
+
Generally, the SDK will work well with most IDEs out of the box. However, when using PyCharm, you can enjoy much better integration with Pydantic by installing an additional plugin.
0 commit comments