8
8
9
9
``` csharp
10
10
using Clerk .BackendAPI ;
11
- using Clerk .BackendAPI .Models .Components ;
11
+ using Clerk .BackendAPI .Models .Operations ;
12
12
13
- var sdk = new ClerkBackendApi (bearerAuth : " <YOUR_BEARER_TOKEN_HERE> " );
13
+ var sdk = new ClerkBackendApi ();
14
14
15
- var res = await sdk .EmailAddresses .GetAsync (emailAddressId : " email_address_id_example" );
15
+ GetPublicInterstitialRequest req = new GetPublicInterstitialRequest () {
16
+ FrontendApiQueryParameter1 = " pub_1a2b3c4d" ,
17
+ };
18
+
19
+ var res = await sdk .Miscellaneous .GetPublicInterstitialAsync (req );
16
20
17
21
// handle response
18
22
```
@@ -33,17 +37,78 @@ To authenticate with the API the `BearerAuth` parameter must be set when initial
33
37
``` csharp
34
38
using Clerk .BackendAPI ;
35
39
using Clerk .BackendAPI .Models .Components ;
40
+ using Clerk .BackendAPI .Models .Operations ;
36
41
37
42
var sdk = new ClerkBackendApi (bearerAuth : " <YOUR_BEARER_TOKEN_HERE>" );
38
43
44
+ GetPublicInterstitialRequest req = new GetPublicInterstitialRequest () {
45
+ FrontendApiQueryParameter1 = " pub_1a2b3c4d" ,
46
+ };
47
+
48
+ var res = await sdk .Miscellaneous .GetPublicInterstitialAsync (req );
49
+
50
+ // handle response
51
+ ```
52
+ <!-- End Authentication [security] -->
53
+
54
+ <!-- Start Retries [retries] -->
55
+ ## Retries
56
+
57
+ Some of the endpoints in this SDK support retries. If you use the SDK without any configuration, it will fall back to the default retry strategy provided by the API. However, the default retry strategy can be overridden on a per-operation basis, or across the entire SDK.
58
+
59
+ To change the default retry strategy for a single API call, simply pass a ` RetryConfig ` to the call:
60
+ ``` csharp
61
+ using Clerk .BackendAPI ;
62
+ using Clerk .BackendAPI .Models .Operations ;
63
+
64
+ var sdk = new ClerkBackendApi ();
65
+
66
+ GetPublicInterstitialRequest req = new GetPublicInterstitialRequest () {
67
+ FrontendApiQueryParameter1 = " pub_1a2b3c4d" ,
68
+ };
69
+
39
70
var res = await sdk .Miscellaneous .GetPublicInterstitialAsync (
40
- frontendApi : " frontend-api_1a2b3c4d" ,
41
- publishableKey : " pub_1a2b3c4d"
71
+ retryConfig : new RetryConfig (
72
+ strategy : RetryConfig .RetryStrategy .BACKOFF ,
73
+ backoff : new BackoffStrategy (
74
+ initialIntervalMs : 1 L ,
75
+ maxIntervalMs : 50 L ,
76
+ maxElapsedTimeMs : 100 L ,
77
+ exponent : 1 . 1
78
+ ),
79
+ retryConnectionErrors : false
80
+ ),
81
+ request : req
42
82
);
43
83
44
84
// handle response
45
85
```
46
- <!-- End Authentication [security] -->
86
+
87
+ If you'd like to override the default retry strategy for all operations that support retries, you can use the ` RetryConfig ` optional parameter when intitializing the SDK:
88
+ ``` csharp
89
+ using Clerk .BackendAPI ;
90
+ using Clerk .BackendAPI .Models .Operations ;
91
+
92
+ var sdk = new ClerkBackendApi (retryConfig : new RetryConfig (
93
+ strategy : RetryConfig .RetryStrategy .BACKOFF ,
94
+ backoff : new BackoffStrategy (
95
+ initialIntervalMs : 1 L ,
96
+ maxIntervalMs : 50 L ,
97
+ maxElapsedTimeMs : 100 L ,
98
+ exponent : 1 . 1
99
+ ),
100
+ retryConnectionErrors : false
101
+ ));
102
+
103
+ GetPublicInterstitialRequest req = new GetPublicInterstitialRequest () {
104
+ FrontendApiQueryParameter1 = " pub_1a2b3c4d" ,
105
+ };
106
+
107
+ var res = await sdk .Miscellaneous .GetPublicInterstitialAsync (req );
108
+
109
+ // handle response
110
+ ```
111
+ <!-- End Retries [retries] -->
47
112
48
113
<!-- Start Error Handling [errors] -->
49
114
## Error Handling
@@ -109,13 +174,15 @@ catch (Exception ex)
109
174
The default server can be overridden globally by passing a URL to the ` serverUrl: string ` optional parameter when initializing the SDK client instance. For example:
110
175
``` csharp
111
176
using Clerk .BackendAPI ;
177
+ using Clerk .BackendAPI .Models .Operations ;
112
178
113
179
var sdk = new ClerkBackendApi (serverUrl : " https://api.clerk.com/v1" );
114
180
115
- var res = await sdk .Miscellaneous .GetPublicInterstitialAsync (
116
- frontendApi : " frontend-api_1a2b3c4d" ,
117
- publishableKey : " pub_1a2b3c4d"
118
- );
181
+ GetPublicInterstitialRequest req = new GetPublicInterstitialRequest () {
182
+ FrontendApiQueryParameter1 = " pub_1a2b3c4d" ,
183
+ };
184
+
185
+ var res = await sdk .Miscellaneous .GetPublicInterstitialAsync (req );
119
186
120
187
// handle response
121
188
```
0 commit comments