-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from speakeasy-sdks/speakeasy-sdk-regen-1720802802
chore: 🐝 Update SDK - Generate
- Loading branch information
Showing
21 changed files
with
1,141 additions
and
206 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
workflowVersion: 1.0.0 | ||
speakeasyVersion: latest | ||
sources: | ||
loops-oas: | ||
inputs: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -298,6 +298,98 @@ func main() { | |
|
||
<!-- End Special Types [types] --> | ||
|
||
<!-- Start Retries [retries] --> | ||
## Retries | ||
|
||
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. | ||
|
||
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: | ||
```go | ||
package main | ||
|
||
import ( | ||
"context" | ||
loopsgo "github.com/speakeasy-sdks/loops-go" | ||
"github.com/speakeasy-sdks/loops-go/models/components" | ||
"github.com/speakeasy-sdks/loops-go/retry" | ||
"log" | ||
"models/operations" | ||
) | ||
|
||
func main() { | ||
s := loopsgo.New( | ||
loopsgo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"), | ||
) | ||
request := components.ContactRequest{ | ||
Email: "[email protected]", | ||
MailingLists: &components.MailingLists{}, | ||
} | ||
ctx := context.Background() | ||
res, err := s.Contacts.PostContactsCreate(ctx, request, operations.WithRetries( | ||
retry.Config{ | ||
Strategy: "backoff", | ||
Backoff: &retry.BackoffStrategy{ | ||
InitialInterval: 1, | ||
MaxInterval: 50, | ||
Exponent: 1.1, | ||
MaxElapsedTime: 100, | ||
}, | ||
RetryConnectionErrors: false, | ||
})) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
if res.ContactSuccessResponse != nil { | ||
// handle response | ||
} | ||
} | ||
|
||
``` | ||
|
||
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: | ||
```go | ||
package main | ||
|
||
import ( | ||
"context" | ||
loopsgo "github.com/speakeasy-sdks/loops-go" | ||
"github.com/speakeasy-sdks/loops-go/models/components" | ||
"github.com/speakeasy-sdks/loops-go/retry" | ||
"log" | ||
) | ||
|
||
func main() { | ||
s := loopsgo.New( | ||
loopsgo.WithRetryConfig( | ||
retry.Config{ | ||
Strategy: "backoff", | ||
Backoff: &retry.BackoffStrategy{ | ||
InitialInterval: 1, | ||
MaxInterval: 50, | ||
Exponent: 1.1, | ||
MaxElapsedTime: 100, | ||
}, | ||
RetryConnectionErrors: false, | ||
}), | ||
loopsgo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"), | ||
) | ||
request := components.ContactRequest{ | ||
Email: "[email protected]", | ||
MailingLists: &components.MailingLists{}, | ||
} | ||
ctx := context.Background() | ||
res, err := s.Contacts.PostContactsCreate(ctx, request) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
if res.ContactSuccessResponse != nil { | ||
// handle response | ||
} | ||
} | ||
|
||
``` | ||
<!-- End Retries [retries] --> | ||
|
||
<!-- Placeholder for Future Speakeasy SDK Sections --> | ||
|
||
# Development | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
|
||
|
||
## 2024-07-12 16:46:40 | ||
### Changes | ||
Based on: | ||
- OpenAPI Doc | ||
- Speakeasy CLI 1.334.1 (2.370.1) https://github.com/speakeasy-api/speakeasy | ||
### Generated | ||
- [go v0.1.0] . | ||
### Releases | ||
- [Go v0.1.0] https://github.com/speakeasy-sdks/loops-go/releases/tag/v0.1.0 - . |
Oops, something went wrong.