Skip to content

Commit

Permalink
Merge pull request #19 from unkeyed/speakeasy-sdk-regen-1719850769
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate
  • Loading branch information
chronark committed Jul 1, 2024
2 parents bc5bb3c + f05c1d0 commit 8a954f1
Show file tree
Hide file tree
Showing 25 changed files with 1,250 additions and 299 deletions.
14 changes: 9 additions & 5 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 4fc4737a-135f-4840-8e6d-42a2b2a2884b
management:
docChecksum: fe738a5ae7ac1f5b839fd5d2041aa653
docChecksum: 547602f40f6ad29534bfdf081cab8873
docVersion: 1.0.0
speakeasyVersion: 1.322.1
generationVersion: 2.354.2
releaseVersion: 0.4.2
configChecksum: 63387c72449e54938b6817c5e1c104c1
speakeasyVersion: 1.323.0
generationVersion: 2.356.0
releaseVersion: 0.5.0
configChecksum: c40e320661f7800a66c6e3a1a4f1848e
repoURL: https://github.com/unkeyed/unkey-go.git
installationURL: https://github.com/unkeyed/unkey-go
features:
Expand All @@ -23,6 +23,7 @@ features:
intellisenseMarkdownSupport: 0.1.0
nullables: 0.1.0
responseFormat: 0.1.2
retries: 2.82.3
sdkHooks: 0.1.0
unions: 2.85.8
generatedFiles:
Expand Down Expand Up @@ -159,6 +160,7 @@ generatedFiles:
- docs/models/components/v1keysverifykeyresponse.md
- docs/models/components/authorization.md
- docs/models/components/v1keysverifykeyrequestratelimit.md
- docs/models/components/ratelimits.md
- docs/models/components/v1keysverifykeyrequest.md
- docs/models/components/or.md
- docs/models/components/and.md
Expand All @@ -185,12 +187,14 @@ generatedFiles:
- docs/models/sdkerrors/errinternalservererrorcode.md
- docs/models/sdkerrors/errinternalservererrorerror.md
- docs/models/sdkerrors/errinternalservererror.md
- docs/models/operations/option.md
- docs/sdks/unkey/README.md
- docs/sdks/liveness/README.md
- docs/sdks/keys/README.md
- docs/sdks/apis/README.md
- docs/sdks/ratelimits/README.md
- docs/sdks/migrations/README.md
- USAGE.md
- models/operations/options.go
- .gitattributes
- internal/hooks/hooks.go
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
go:
version: 0.4.2
version: 0.5.0
additionalDependencies: {}
allowUnknownFieldsInWeakUnions: false
clientServerStatusCodesAsErrors: true
Expand Down
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
speakeasyVersion: 1.322.1
speakeasyVersion: 1.323.0
sources:
openapi.json:
sourceNamespace: openapi-json
sourceRevisionDigest: sha256:04eb226f459dd58578b0e1d3777efdb91fd4af832df4bfe1a0838f5e553065ce
sourceBlobDigest: sha256:16b16e8fbdcd48ca93a62acfc710f15f399f6d2217b4b6583dfd0cc34fc5a255
sourceRevisionDigest: sha256:daa279be1b2180ce5cf7921e155470a69575ec657399a60954d3dc35fa06c240
sourceBlobDigest: sha256:786c8a969b1dea1edf088eb35e0a33aee288802e4b9ce4e3deffb9a2489357b9
tags:
- latest
- main
targets:
go:
source: openapi.json
sourceNamespace: openapi-json
sourceRevisionDigest: sha256:04eb226f459dd58578b0e1d3777efdb91fd4af832df4bfe1a0838f5e553065ce
sourceBlobDigest: sha256:16b16e8fbdcd48ca93a62acfc710f15f399f6d2217b4b6583dfd0cc34fc5a255
sourceRevisionDigest: sha256:daa279be1b2180ce5cf7921e155470a69575ec657399a60954d3dc35fa06c240
sourceBlobDigest: sha256:786c8a969b1dea1edf088eb35e0a33aee288802e4b9ce4e3deffb9a2489357b9
outLocation: /github/workspace/repo
workflow:
workflowVersion: 1.0.0
Expand Down
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,96 @@ 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 `RetryConfig` object to the call by using the `WithRetries` option:
```go
package main

import (
"context"
unkeygo "github.com/unkeyed/unkey-go"
"github.com/unkeyed/unkey-go/internal/utils"
"github.com/unkeyed/unkey-go/models/operations"
"log"
"models/operations"
)

func main() {
s := unkeygo.New(
unkeygo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
request := operations.CreateAPIRequestBody{
Name: "my-api",
}
ctx := context.Background()
res, err := s.CreateAPI(ctx, request, operations.WithRetries(
utils.RetryConfig{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
InitialInterval: 1,
MaxInterval: 50,
Exponent: 1.1,
MaxElapsedTime: 100,
},
RetryConnectionErrors: false,
}))
if err != nil {
log.Fatal(err)
}
if res.Object != 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"
unkeygo "github.com/unkeyed/unkey-go"
"github.com/unkeyed/unkey-go/internal/utils"
"github.com/unkeyed/unkey-go/models/operations"
"log"
)

func main() {
s := unkeygo.New(
unkeygo.WithRetryConfig(
utils.RetryConfig{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
InitialInterval: 1,
MaxInterval: 50,
Exponent: 1.1,
MaxElapsedTime: 100,
},
RetryConnectionErrors: false,
}),
unkeygo.WithSecurity("<YOUR_BEARER_TOKEN_HERE>"),
)
request := operations.CreateAPIRequestBody{
Name: "my-api",
}
ctx := context.Background()
res, err := s.CreateAPI(ctx, request)
if err != nil {
log.Fatal(err)
}
if res.Object != nil {
// handle response
}
}

```
<!-- End Retries [retries] -->

<!-- Placeholder for Future Speakeasy SDK Sections -->

# Development
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,14 @@ Based on:
### Generated
- [go v0.4.2] .
### Releases
- [Go v0.4.2] https://github.com/unkeyed/unkey-go/releases/tag/v0.4.2 - .
- [Go v0.4.2] https://github.com/unkeyed/unkey-go/releases/tag/v0.4.2 - .

## 2024-07-01 16:19:26
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.323.0 (2.356.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.5.0] .
### Releases
- [Go v0.5.0] https://github.com/unkeyed/unkey-go/releases/tag/v0.5.0 - .
Loading

0 comments on commit 8a954f1

Please sign in to comment.