@@ -95,12 +95,14 @@ from clerk_backend_api import Clerk
9595
9696with Clerk(
9797 bearer_auth = " <YOUR_BEARER_TOKEN_HERE>" ,
98- ) as s:
99- res = s.email_addresses.get(email_address_id = " email_address_id_example" )
98+ ) as clerk:
10099
101- if res is not None :
102- # handle response
103- pass
100+ res = clerk.email_addresses.get(email_address_id = " email_address_id_example" )
101+
102+ assert res is not None
103+
104+ # Handle response
105+ print (res)
104106```
105107
106108</br >
@@ -114,12 +116,14 @@ from clerk_backend_api import Clerk
114116async def main ():
115117 async with Clerk(
116118 bearer_auth = " <YOUR_BEARER_TOKEN_HERE>" ,
117- ) as s:
118- res = await s.email_addresses.get_async(email_address_id = " email_address_id_example" )
119+ ) as clerk:
120+
121+ res = await clerk.email_addresses.get_async(email_address_id = " email_address_id_example" )
119122
120- if res is not None :
121- # handle response
122- pass
123+ assert res is not None
124+
125+ # Handle response
126+ print (res)
123127
124128asyncio.run(main())
125129```
@@ -142,8 +146,9 @@ from clerk_backend_api import Clerk
142146
143147with Clerk(
144148 bearer_auth = " <YOUR_BEARER_TOKEN_HERE>" ,
145- ) as s:
146- s.miscellaneous.get_interstitial(frontend_api = " frontend-api_1a2b3c4d" , publishable_key = " pub_1a2b3c4d" )
149+ ) as clerk:
150+
151+ clerk.miscellaneous.get_interstitial(frontend_api = " frontend-api_1a2b3c4d" , publishable_key = " pub_1a2b3c4d" )
147152
148153 # Use the SDK ...
149154
@@ -420,16 +425,18 @@ from clerk_backend_api import Clerk
420425
421426with Clerk(
422427 bearer_auth = " <YOUR_BEARER_TOKEN_HERE>" ,
423- ) as s:
424- res = s.users.set_profile_image(user_id = " usr_test123" , file = {
428+ ) as clerk:
429+
430+ res = clerk.users.set_profile_image(user_id = " usr_test123" , file = {
425431 " file_name" : " example.file" ,
426432 " content" : open (" example.file" , " rb" ),
427433 " content_type" : " <value>" ,
428434 })
429435
430- if res is not None :
431- # handle response
432- pass
436+ assert res is not None
437+
438+ # Handle response
439+ print (res)
433440
434441```
435442<!-- End File uploads [file-upload] -->
@@ -441,11 +448,12 @@ Some of the endpoints in this SDK support retries. If you use the SDK without an
441448
442449To change the default retry strategy for a single API call, simply provide a ` RetryConfig ` object to the call:
443450``` python
444- from clerk.utils import BackoffStrategy, RetryConfig
445451from clerk_backend_api import Clerk
452+ from clerk_backend_api.utils import BackoffStrategy, RetryConfig
453+
454+ with Clerk() as clerk:
446455
447- with Clerk() as s:
448- s.miscellaneous.get_interstitial(frontend_api = " frontend-api_1a2b3c4d" , publishable_key = " pub_1a2b3c4d" ,
456+ clerk.miscellaneous.get_interstitial(frontend_api = " frontend-api_1a2b3c4d" , publishable_key = " pub_1a2b3c4d" ,
449457 RetryConfig(" backoff" , BackoffStrategy(1 , 50 , 1.1 , 100 ), False ))
450458
451459 # Use the SDK ...
@@ -454,13 +462,14 @@ with Clerk() as s:
454462
455463If 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:
456464``` python
457- from clerk.utils import BackoffStrategy, RetryConfig
458465from clerk_backend_api import Clerk
466+ from clerk_backend_api.utils import BackoffStrategy, RetryConfig
459467
460468with Clerk(
461469 retry_config = RetryConfig(" backoff" , BackoffStrategy(1 , 50 , 1.1 , 100 ), False ),
462- ) as s:
463- s.miscellaneous.get_interstitial(frontend_api = " frontend-api_1a2b3c4d" , publishable_key = " pub_1a2b3c4d" )
470+ ) as clerk:
471+
472+ clerk.miscellaneous.get_interstitial(frontend_api = " frontend-api_1a2b3c4d" , publishable_key = " pub_1a2b3c4d" )
464473
465474 # Use the SDK ...
466475
@@ -495,16 +504,18 @@ from clerk_backend_api import Clerk, models
495504
496505with Clerk(
497506 bearer_auth = " <YOUR_BEARER_TOKEN_HERE>" ,
498- ) as s :
507+ ) as clerk :
499508 res = None
500509 try :
501- res = s.clients.verify(request = {
510+
511+ res = clerk.clients.verify(request = {
502512 " token" : " jwt_token_example" ,
503513 })
504514
505- if res is not None :
506- # handle response
507- pass
515+ assert res is not None
516+
517+ # Handle response
518+ print (res)
508519
509520 except models.ClerkErrors as e:
510521 # handle e.data: models.ClerkErrorsData
@@ -526,8 +537,9 @@ from clerk_backend_api import Clerk
526537
527538with Clerk(
528539 server_url = " https://api.clerk.com/v1" ,
529- ) as s:
530- s.miscellaneous.get_interstitial(frontend_api = " frontend-api_1a2b3c4d" , publishable_key = " pub_1a2b3c4d" )
540+ ) as clerk:
541+
542+ clerk.miscellaneous.get_interstitial(frontend_api = " frontend-api_1a2b3c4d" , publishable_key = " pub_1a2b3c4d" )
531543
532544 # Use the SDK ...
533545
0 commit comments