Skip to content

Commit

Permalink
Merge pull request #22 from unkeyed/speakeasy-sdk-regen-1719938182
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate
  • Loading branch information
chronark committed Jul 2, 2024
2 parents 9340625 + ba96ef0 commit 4c84d7b
Show file tree
Hide file tree
Showing 15 changed files with 101 additions and 75 deletions.
11 changes: 6 additions & 5 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ id: 4fc4737a-135f-4840-8e6d-42a2b2a2884b
management:
docChecksum: 547602f40f6ad29534bfdf081cab8873
docVersion: 1.0.0
speakeasyVersion: 1.323.0
generationVersion: 2.356.0
releaseVersion: 0.5.0
configChecksum: c40e320661f7800a66c6e3a1a4f1848e
speakeasyVersion: 1.326.0
generationVersion: 2.359.0
releaseVersion: 0.6.0
configChecksum: 2a6062478c58c77a364cffd8940a8f10
repoURL: https://github.com/unkeyed/unkey-go.git
installationURL: https://github.com/unkeyed/unkey-go
features:
Expand All @@ -23,7 +23,7 @@ features:
intellisenseMarkdownSupport: 0.1.0
nullables: 0.1.0
responseFormat: 0.1.2
retries: 2.82.3
retries: 2.83.0
sdkHooks: 0.1.0
unions: 2.85.8
generatedFiles:
Expand All @@ -35,6 +35,7 @@ generatedFiles:
- unkey.go
- go.mod
- models/sdkerrors/sdkerror.go
- retry/config.go
- types/bigint.go
- types/date.go
- types/datetime.go
Expand Down
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.5.0
version: 0.6.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.323.0
speakeasyVersion: 1.326.0
sources:
openapi.json:
sourceNamespace: openapi-json
sourceRevisionDigest: sha256:daa279be1b2180ce5cf7921e155470a69575ec657399a60954d3dc35fa06c240
sourceBlobDigest: sha256:786c8a969b1dea1edf088eb35e0a33aee288802e4b9ce4e3deffb9a2489357b9
sourceRevisionDigest: sha256:5755e12422b9cd83ab813c9d2ffd43a55d73bbbf981cbee7da4d4da7a0380903
sourceBlobDigest: sha256:ef83f05349e97390bd3543fff7b29fb47c0067e347d53e75922e5e1c52d2b721
tags:
- latest
- main
targets:
go:
source: openapi.json
sourceNamespace: openapi-json
sourceRevisionDigest: sha256:daa279be1b2180ce5cf7921e155470a69575ec657399a60954d3dc35fa06c240
sourceBlobDigest: sha256:786c8a969b1dea1edf088eb35e0a33aee288802e4b9ce4e3deffb9a2489357b9
sourceRevisionDigest: sha256:5755e12422b9cd83ab813c9d2ffd43a55d73bbbf981cbee7da4d4da7a0380903
sourceBlobDigest: sha256:ef83f05349e97390bd3543fff7b29fb47c0067e347d53e75922e5e1c52d2b721
outLocation: /github/workspace/repo
workflow:
workflowVersion: 1.0.0
Expand Down
15 changes: 7 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
</div>!

<!-- Start SDK Installation [installation] -->

## SDK Installation

```bash
Expand Down Expand Up @@ -341,15 +340,15 @@ func main() {

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:
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"
unkeygo "github.com/unkeyed/unkey-go"
"github.com/unkeyed/unkey-go/internal/utils"
"github.com/unkeyed/unkey-go/models/operations"
"github.com/unkeyed/unkey-go/retry"
"log"
"models/operations"
)
Expand All @@ -363,9 +362,9 @@ func main() {
}
ctx := context.Background()
res, err := s.CreateAPI(ctx, request, operations.WithRetries(
utils.RetryConfig{
retry.Config{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
Backoff: &retry.BackoffStrategy{
InitialInterval: 1,
MaxInterval: 50,
Exponent: 1.1,
Expand All @@ -390,17 +389,17 @@ package main
import (
"context"
unkeygo "github.com/unkeyed/unkey-go"
"github.com/unkeyed/unkey-go/internal/utils"
"github.com/unkeyed/unkey-go/models/operations"
"github.com/unkeyed/unkey-go/retry"
"log"
)

func main() {
s := unkeygo.New(
unkeygo.WithRetryConfig(
utils.RetryConfig{
retry.Config{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
Backoff: &retry.BackoffStrategy{
InitialInterval: 1,
MaxInterval: 50,
Exponent: 1.1,
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,14 @@ Based on:
### Generated
- [go v0.5.0] .
### Releases
- [Go v0.5.0] https://github.com/unkeyed/unkey-go/releases/tag/v0.5.0 - .
- [Go v0.5.0] https://github.com/unkeyed/unkey-go/releases/tag/v0.5.0 - .

## 2024-07-02 16:36:20
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.326.0 (2.359.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.6.0] .
### Releases
- [Go v0.6.0] https://github.com/unkeyed/unkey-go/releases/tag/v0.6.0 - .
13 changes: 7 additions & 6 deletions apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/unkeyed/unkey-go/models/components"
"github.com/unkeyed/unkey-go/models/operations"
"github.com/unkeyed/unkey-go/models/sdkerrors"
"github.com/unkeyed/unkey-go/retry"
"io"
"net/http"
"net/url"
Expand Down Expand Up @@ -70,9 +71,9 @@ func (s *Apis) GetAPI(ctx context.Context, request operations.GetAPIRequest, opt
retryConfig := o.Retries
if retryConfig == nil {
if globalRetryConfig == nil {
retryConfig = &utils.RetryConfig{
retryConfig = &retry.Config{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
Backoff: &retry.BackoffStrategy{
InitialInterval: 50,
MaxInterval: 1000,
Exponent: 1.5,
Expand Down Expand Up @@ -291,9 +292,9 @@ func (s *Apis) ListKeys(ctx context.Context, request operations.ListKeysRequest,
retryConfig := o.Retries
if retryConfig == nil {
if globalRetryConfig == nil {
retryConfig = &utils.RetryConfig{
retryConfig = &retry.Config{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
Backoff: &retry.BackoffStrategy{
InitialInterval: 50,
MaxInterval: 1000,
Exponent: 1.5,
Expand Down Expand Up @@ -514,9 +515,9 @@ func (s *Apis) DeleteKeys(ctx context.Context, request operations.DeleteKeysRequ
retryConfig := o.Retries
if retryConfig == nil {
if globalRetryConfig == nil {
retryConfig = &utils.RetryConfig{
retryConfig = &retry.Config{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
Backoff: &retry.BackoffStrategy{
InitialInterval: 50,
MaxInterval: 1000,
Exponent: 1.5,
Expand Down
4 changes: 2 additions & 2 deletions docs/models/operations/option.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ operations.WithTemplatedServerURL("http://{host}:{port}", map[string]string{
WithRetries allows customizing the default retry configuration. Only usable with methods that mention they support retries.

```go
operations.WithRetries(utils.RetryConfig{
operations.WithRetries(retry.Config{
Strategy: "backoff",
Backoff: utils.BackoffStrategy{
Backoff: retry.BackoffStrategy{
InitialInterval: 500 * time.Millisecond,
MaxInterval: 60 * time.Second,
Exponent: 1.5,
Expand Down
21 changes: 7 additions & 14 deletions internal/utils/retries.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,25 @@ import (
"context"
"errors"
"fmt"
"github.com/cenkalti/backoff/v4"
"github.com/unkeyed/unkey-go/retry"
"net/http"
"net/url"
"strconv"
"strings"
"time"

"github.com/cenkalti/backoff/v4"
)

var errRequestFailed = errors.New("request failed")

type BackoffStrategy struct {
InitialInterval int
MaxInterval int
Exponent float64
MaxElapsedTime int
}
// Deprecated: Use retry.BackoffStrategy instead.
type BackoffStrategy = retry.BackoffStrategy

type RetryConfig struct {
Strategy string
Backoff *BackoffStrategy
RetryConnectionErrors bool
}
// Deprecated: Use retry.Config instead.
type RetryConfig = retry.Config

type Retries struct {
Config *RetryConfig
Config *retry.Config
StatusCodes []string
}

Expand Down
29 changes: 15 additions & 14 deletions keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/unkeyed/unkey-go/models/components"
"github.com/unkeyed/unkey-go/models/operations"
"github.com/unkeyed/unkey-go/models/sdkerrors"
"github.com/unkeyed/unkey-go/retry"
"io"
"net/http"
"net/url"
Expand Down Expand Up @@ -70,9 +71,9 @@ func (s *Keys) GetKey(ctx context.Context, request operations.GetKeyRequest, opt
retryConfig := o.Retries
if retryConfig == nil {
if globalRetryConfig == nil {
retryConfig = &utils.RetryConfig{
retryConfig = &retry.Config{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
Backoff: &retry.BackoffStrategy{
InitialInterval: 50,
MaxInterval: 1000,
Exponent: 1.5,
Expand Down Expand Up @@ -293,9 +294,9 @@ func (s *Keys) DeleteKey(ctx context.Context, request operations.DeleteKeyReques
retryConfig := o.Retries
if retryConfig == nil {
if globalRetryConfig == nil {
retryConfig = &utils.RetryConfig{
retryConfig = &retry.Config{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
Backoff: &retry.BackoffStrategy{
InitialInterval: 50,
MaxInterval: 1000,
Exponent: 1.5,
Expand Down Expand Up @@ -516,9 +517,9 @@ func (s *Keys) CreateKey(ctx context.Context, request operations.CreateKeyReques
retryConfig := o.Retries
if retryConfig == nil {
if globalRetryConfig == nil {
retryConfig = &utils.RetryConfig{
retryConfig = &retry.Config{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
Backoff: &retry.BackoffStrategy{
InitialInterval: 50,
MaxInterval: 1000,
Exponent: 1.5,
Expand Down Expand Up @@ -739,9 +740,9 @@ func (s *Keys) VerifyKey(ctx context.Context, request components.V1KeysVerifyKey
retryConfig := o.Retries
if retryConfig == nil {
if globalRetryConfig == nil {
retryConfig = &utils.RetryConfig{
retryConfig = &retry.Config{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
Backoff: &retry.BackoffStrategy{
InitialInterval: 50,
MaxInterval: 1000,
Exponent: 1.5,
Expand Down Expand Up @@ -962,9 +963,9 @@ func (s *Keys) UpdateKey(ctx context.Context, request operations.UpdateKeyReques
retryConfig := o.Retries
if retryConfig == nil {
if globalRetryConfig == nil {
retryConfig = &utils.RetryConfig{
retryConfig = &retry.Config{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
Backoff: &retry.BackoffStrategy{
InitialInterval: 50,
MaxInterval: 1000,
Exponent: 1.5,
Expand Down Expand Up @@ -1185,9 +1186,9 @@ func (s *Keys) UpdateRemaining(ctx context.Context, request operations.UpdateRem
retryConfig := o.Retries
if retryConfig == nil {
if globalRetryConfig == nil {
retryConfig = &utils.RetryConfig{
retryConfig = &retry.Config{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
Backoff: &retry.BackoffStrategy{
InitialInterval: 50,
MaxInterval: 1000,
Exponent: 1.5,
Expand Down Expand Up @@ -1406,9 +1407,9 @@ func (s *Keys) GetVerifications(ctx context.Context, request operations.GetVerif
retryConfig := o.Retries
if retryConfig == nil {
if globalRetryConfig == nil {
retryConfig = &utils.RetryConfig{
retryConfig = &retry.Config{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
Backoff: &retry.BackoffStrategy{
InitialInterval: 50,
MaxInterval: 1000,
Exponent: 1.5,
Expand Down
5 changes: 3 additions & 2 deletions liveness.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/unkeyed/unkey-go/models/components"
"github.com/unkeyed/unkey-go/models/operations"
"github.com/unkeyed/unkey-go/models/sdkerrors"
"github.com/unkeyed/unkey-go/retry"
"io"
"net/http"
"net/url"
Expand Down Expand Up @@ -66,9 +67,9 @@ func (s *Liveness) V1Liveness(ctx context.Context, opts ...operations.Option) (*
retryConfig := o.Retries
if retryConfig == nil {
if globalRetryConfig == nil {
retryConfig = &utils.RetryConfig{
retryConfig = &retry.Config{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
Backoff: &retry.BackoffStrategy{
InitialInterval: 50,
MaxInterval: 1000,
Exponent: 1.5,
Expand Down
9 changes: 5 additions & 4 deletions migrations.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/unkeyed/unkey-go/models/components"
"github.com/unkeyed/unkey-go/models/operations"
"github.com/unkeyed/unkey-go/models/sdkerrors"
"github.com/unkeyed/unkey-go/retry"
"io"
"net/http"
"net/url"
Expand Down Expand Up @@ -72,9 +73,9 @@ func (s *Migrations) V1MigrationsCreateKeys(ctx context.Context, request []opera
retryConfig := o.Retries
if retryConfig == nil {
if globalRetryConfig == nil {
retryConfig = &utils.RetryConfig{
retryConfig = &retry.Config{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
Backoff: &retry.BackoffStrategy{
InitialInterval: 50,
MaxInterval: 1000,
Exponent: 1.5,
Expand Down Expand Up @@ -295,9 +296,9 @@ func (s *Migrations) V1MigrationsEnqueueKeys(ctx context.Context, request operat
retryConfig := o.Retries
if retryConfig == nil {
if globalRetryConfig == nil {
retryConfig = &utils.RetryConfig{
retryConfig = &retry.Config{
Strategy: "backoff",
Backoff: &utils.BackoffStrategy{
Backoff: &retry.BackoffStrategy{
InitialInterval: 50,
MaxInterval: 1000,
Exponent: 1.5,
Expand Down
Loading

0 comments on commit 4c84d7b

Please sign in to comment.