@@ -36,8 +36,10 @@ func main() {
3636 }),
3737 )
3838 var xPublishableKey string = " <value>"
39+
40+ var xMerchantClientID string = " <value>"
3941 ctx := context.Background ()
40- res , err := s.Account .GetDetails (ctx, xPublishableKey)
42+ res , err := s.Account .GetDetails (ctx, xPublishableKey, xMerchantClientID )
4143 if err != nil {
4244 log.Fatal (err)
4345 }
@@ -120,8 +122,10 @@ func main() {
120122 }),
121123 )
122124 var xPublishableKey string = " <value>"
125+
126+ var xMerchantClientID string = " <value>"
123127 ctx := context.Background ()
124- res , err := s.Account .GetDetails (ctx, xPublishableKey)
128+ res , err := s.Account .GetDetails (ctx, xPublishableKey, xMerchantClientID )
125129 if err != nil {
126130
127131 var e *sdkerrors.AccountGetResponseBody
@@ -172,8 +176,10 @@ func main() {
172176 }),
173177 )
174178 var xPublishableKey string = " <value>"
179+
180+ var xMerchantClientID string = " <value>"
175181 ctx := context.Background ()
176- res , err := s.Account .GetDetails (ctx, xPublishableKey)
182+ res , err := s.Account .GetDetails (ctx, xPublishableKey, xMerchantClientID )
177183 if err != nil {
178184 log.Fatal (err)
179185 }
@@ -210,8 +216,10 @@ func main() {
210216 }),
211217 )
212218 var xPublishableKey string = " <value>"
219+
220+ var xMerchantClientID string = " <value>"
213221 ctx := context.Background ()
214- res , err := s.Account .GetDetails (ctx, xPublishableKey)
222+ res , err := s.Account .GetDetails (ctx, xPublishableKey, xMerchantClientID )
215223 if err != nil {
216224 log.Fatal (err)
217225 }
@@ -282,8 +290,10 @@ func main() {
282290 }),
283291 )
284292 var xPublishableKey string = " <value>"
293+
294+ var xMerchantClientID string = " <value>"
285295 ctx := context.Background ()
286- res , err := s.Account .GetDetails (ctx, xPublishableKey)
296+ res , err := s.Account .GetDetails (ctx, xPublishableKey, xMerchantClientID )
287297 if err != nil {
288298 log.Fatal (err)
289299 }
@@ -316,6 +326,8 @@ func main() {
316326
317327 var xPublishableKey string = " <value>"
318328
329+ var xMerchantClientID string = " <value>"
330+
319331 guestPaymentInitializeRequest := components.GuestPaymentInitializeRequest {
320332 Profile: components.ProfileCreationData {
321333 CreateAccount: true ,
@@ -394,7 +406,7 @@ func main() {
394406 ),
395407 }
396408 ctx := context.Background ()
397- res , err := s.Payments .Guest .Initialize (ctx, security, xPublishableKey, guestPaymentInitializeRequest)
409+ res , err := s.Payments .Guest .Initialize (ctx, security, xPublishableKey, xMerchantClientID, guestPaymentInitializeRequest)
398410 if err != nil {
399411 log.Fatal (err)
400412 }
@@ -412,6 +424,100 @@ func main() {
412424
413425<!-- End Special Types [types] -->
414426
427+ <!-- Start Retries [retries] -->
428+ ## Retries
429+
430+ 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.
431+
432+ To change the default retry strategy for a single API call, simply provide a ` retry.Config ` object to the call by using the ` WithRetries ` option:
433+ ``` go
434+ package main
435+
436+ import (
437+ " context"
438+ boltgo " github.com/BoltApp/bolt-go"
439+ " github.com/BoltApp/bolt-go/models/components"
440+ " github.com/BoltApp/bolt-go/retry"
441+ " log"
442+ " models/operations"
443+ )
444+
445+ func main () {
446+ s := boltgo.New (
447+ boltgo.WithSecurity (components.Security {
448+ Oauth: boltgo.String (" <YOUR_OAUTH_HERE>" ),
449+ }),
450+ )
451+ var xPublishableKey string = " <value>"
452+
453+ var xMerchantClientID string = " <value>"
454+ ctx := context.Background ()
455+ res , err := s.Account .GetDetails (ctx, xPublishableKey, xMerchantClientID, operations.WithRetries (
456+ retry.Config {
457+ Strategy: " backoff" ,
458+ Backoff: &retry.BackoffStrategy {
459+ InitialInterval: 1 ,
460+ MaxInterval: 50 ,
461+ Exponent: 1.1 ,
462+ MaxElapsedTime: 100 ,
463+ },
464+ RetryConnectionErrors: false ,
465+ }))
466+ if err != nil {
467+ log.Fatal (err)
468+ }
469+ if res.Account != nil {
470+ // handle response
471+ }
472+ }
473+
474+ ```
475+
476+ If you'd like to override the default retry strategy for all operations that support retries, you can use the ` WithRetryConfig ` option at SDK initialization:
477+ ``` go
478+ package main
479+
480+ import (
481+ " context"
482+ boltgo " github.com/BoltApp/bolt-go"
483+ " github.com/BoltApp/bolt-go/models/components"
484+ " github.com/BoltApp/bolt-go/retry"
485+ " log"
486+ )
487+
488+ func main () {
489+ s := boltgo.New (
490+ boltgo.WithRetryConfig (
491+ retry.Config {
492+ Strategy: " backoff" ,
493+ Backoff: &retry.BackoffStrategy {
494+ InitialInterval: 1 ,
495+ MaxInterval: 50 ,
496+ Exponent: 1.1 ,
497+ MaxElapsedTime: 100 ,
498+ },
499+ RetryConnectionErrors: false ,
500+ }),
501+ boltgo.WithSecurity (components.Security {
502+ Oauth: boltgo.String (" <YOUR_OAUTH_HERE>" ),
503+ }),
504+ )
505+ var xPublishableKey string = " <value>"
506+
507+ var xMerchantClientID string = " <value>"
508+ ctx := context.Background ()
509+ res , err := s.Account .GetDetails (ctx, xPublishableKey, xMerchantClientID)
510+ if err != nil {
511+ log.Fatal (err)
512+ }
513+ if res.Account != nil {
514+ // handle response
515+ }
516+ }
517+
518+ ```
519+ <!-- End Retries [retries] -->
520+
415521<!-- Placeholder for Future Speakeasy SDK Sections -->
416522
417523# Development
0 commit comments