Skip to content

Commit

Permalink
Merge pull request #14 from unkeyed/speakeasy-sdk-regen-1717533248
Browse files Browse the repository at this point in the history
chore: 🐝 Update SDK - Generate
  • Loading branch information
chronark committed Jun 4, 2024
2 parents 9f429ff + 6226c22 commit 971393f
Show file tree
Hide file tree
Showing 13 changed files with 191 additions and 35 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: 3188b1c3a0851732a5d0f06231f3b62d
docChecksum: 9de89c451e8671005cab21ac38d9b3db
docVersion: 1.0.0
speakeasyVersion: 1.299.6
speakeasyVersion: 1.299.7
generationVersion: 2.338.12
releaseVersion: 0.3.1
configChecksum: a9aa36dc0f0b5fa4a5fd7a8b4424246b
releaseVersion: 0.4.0
configChecksum: 8eb61f55e2b56ff6181a4780ec9f63c4
repoURL: https://github.com/unkeyed/unkey-go.git
installationURL: https://github.com/unkeyed/unkey-go
features:
Expand All @@ -24,6 +24,7 @@ features:
nullables: 0.1.0
responseFormat: 0.1.2
sdkHooks: 0.1.0
unions: 2.85.8
generatedFiles:
- liveness.go
- keys.go
Expand Down Expand Up @@ -68,6 +69,7 @@ generatedFiles:
- /models/components/key.go
- /models/components/v1keysverifykeyresponse.go
- /models/components/v1keysverifykeyrequest.go
- /models/components/permissionquery.go
- /models/components/security.go
- /models/sdkerrors/errbadrequest.go
- /models/sdkerrors/errunauthorized.go
Expand Down Expand Up @@ -155,10 +157,12 @@ generatedFiles:
- docs/models/components/v1keysverifykeyresponseratelimit.md
- docs/models/components/code.md
- docs/models/components/v1keysverifykeyresponse.md
- docs/models/components/permissions.md
- docs/models/components/authorization.md
- docs/models/components/v1keysverifykeyrequestratelimit.md
- docs/models/components/v1keysverifykeyrequest.md
- docs/models/components/or.md
- docs/models/components/and.md
- docs/models/components/permissionquery.md
- docs/models/components/security.md
- docs/models/sdkerrors/code.md
- docs/models/sdkerrors/error.md
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.3.1
version: 0.4.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.299.6
speakeasyVersion: 1.299.7
sources:
openapi.json:
sourceNamespace: openapi-json
sourceRevisionDigest: sha256:a2b5ad618b785ff72011e1081eedc6c8a8790b3447a31ad5ebad20c72acb2220
sourceBlobDigest: sha256:ba213955d102f59e4c11f384d41944a4d09ab26aea94f8bfb5cee29e0156e7f5
sourceRevisionDigest: sha256:1ff66fb7de69bdbce405cf9068cde2274e026dd7ef4ac631ebd415e1d6d40dab
sourceBlobDigest: sha256:b91be605a0ba5ed3c5414df48293072f345501d2df156802d24880a8c7bee650
tags:
- latest
- main
targets:
go:
source: openapi.json
sourceNamespace: openapi-json
sourceRevisionDigest: sha256:a2b5ad618b785ff72011e1081eedc6c8a8790b3447a31ad5ebad20c72acb2220
sourceBlobDigest: sha256:ba213955d102f59e4c11f384d41944a4d09ab26aea94f8bfb5cee29e0156e7f5
sourceRevisionDigest: sha256:1ff66fb7de69bdbce405cf9068cde2274e026dd7ef4ac631ebd415e1d6d40dab
sourceBlobDigest: sha256:b91be605a0ba5ed3c5414df48293072f345501d2df156802d24880a8c7bee650
outLocation: /github/workspace/repo
workflow:
workflowVersion: 1.0.0
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,14 @@ Based on:
### Generated
- [go v0.3.1] .
### Releases
- [Go v0.3.1] https://github.com/unkeyed/unkey-go/releases/tag/v0.3.1 - .
- [Go v0.3.1] https://github.com/unkeyed/unkey-go/releases/tag/v0.3.1 - .

## 2024-06-04 20:34:05
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.299.7 (2.338.12) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.4.0] .
### Releases
- [Go v0.4.0] https://github.com/unkeyed/unkey-go/releases/tag/v0.4.0 - .
8 changes: 8 additions & 0 deletions docs/models/components/and.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# And


## Fields

| Field | Type | Required | Description |
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
| `And` | [][PermissionQuery](../../permissionquery.md) | :heavy_check_mark: | N/A |
6 changes: 3 additions & 3 deletions docs/models/components/authorization.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@ Perform RBAC checks

## Fields

| Field | Type | Required | Description | Example |
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| `Permissions` | [*components.Permissions](../../models/components/permissions.md) | :heavy_minus_sign: | A query for which permissions you require | {<br/>"or": [<br/>{<br/>"and": [<br/>"dns.record.read",<br/>"dns.record.update"<br/>]<br/>},<br/>"admin"<br/>]<br/>} |
| Field | Type | Required | Description |
| ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------- |
| `Permissions` | [*components.PermissionQuery](../../models/components/permissionquery.md) | :heavy_minus_sign: | A query for which permissions you require |
8 changes: 8 additions & 0 deletions docs/models/components/or.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Or


## Fields

| Field | Type | Required | Description |
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- |
| `Or` | [][PermissionQuery](../../permissionquery.md) | :heavy_check_mark: | N/A |
25 changes: 25 additions & 0 deletions docs/models/components/permissionquery.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# PermissionQuery

A query for which permissions you require


## Supported Types

###

```go
permissionQuery := components.CreatePermissionQueryStr(string{/* values here */})
```

### And

```go
permissionQuery := components.CreatePermissionQueryAnd(components.And{/* values here */})
```

### Or

```go
permissionQuery := components.CreatePermissionQueryOr(components.Or{/* values here */})
```

9 changes: 0 additions & 9 deletions docs/models/components/permissions.md

This file was deleted.

3 changes: 0 additions & 3 deletions docs/sdks/keys/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,6 @@ func main() {
request := components.V1KeysVerifyKeyRequest{
APIID: unkeygo.String("api_1234"),
Key: "sk_1234",
Authorization: &components.Authorization{
Permissions: &components.Permissions{},
},
}
ctx := context.Background()
res, err := s.Keys.VerifyKey(ctx, request)
Expand Down
117 changes: 117 additions & 0 deletions models/components/permissionquery.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.

package components

import (
"errors"
"fmt"
"github.com/unkeyed/unkey-go/internal/utils"
)

type Or struct {
Or []PermissionQuery `json:"or"`
}

func (o *Or) GetOr() []PermissionQuery {
if o == nil {
return []PermissionQuery{}
}
return o.Or
}

type And struct {
And []PermissionQuery `json:"and"`
}

func (o *And) GetAnd() []PermissionQuery {
if o == nil {
return []PermissionQuery{}
}
return o.And
}

type PermissionQueryType string

const (
PermissionQueryTypeStr PermissionQueryType = "str"
PermissionQueryTypeAnd PermissionQueryType = "And"
PermissionQueryTypeOr PermissionQueryType = "Or"
)

// PermissionQuery - A query for which permissions you require
type PermissionQuery struct {
Str *string
And *And
Or *Or

Type PermissionQueryType
}

func CreatePermissionQueryStr(str string) PermissionQuery {
typ := PermissionQueryTypeStr

return PermissionQuery{
Str: &str,
Type: typ,
}
}

func CreatePermissionQueryAnd(and And) PermissionQuery {
typ := PermissionQueryTypeAnd

return PermissionQuery{
And: &and,
Type: typ,
}
}

func CreatePermissionQueryOr(or Or) PermissionQuery {
typ := PermissionQueryTypeOr

return PermissionQuery{
Or: &or,
Type: typ,
}
}

func (u *PermissionQuery) UnmarshalJSON(data []byte) error {

var and And = And{}
if err := utils.UnmarshalJSON(data, &and, "", true, true); err == nil {
u.And = &and
u.Type = PermissionQueryTypeAnd
return nil
}

var or Or = Or{}
if err := utils.UnmarshalJSON(data, &or, "", true, true); err == nil {
u.Or = &or
u.Type = PermissionQueryTypeOr
return nil
}

var str string = ""
if err := utils.UnmarshalJSON(data, &str, "", true, true); err == nil {
u.Str = &str
u.Type = PermissionQueryTypeStr
return nil
}

return fmt.Errorf("could not unmarshal `%s` into any supported union types for PermissionQuery", string(data))
}

func (u PermissionQuery) MarshalJSON() ([]byte, error) {
if u.Str != nil {
return utils.MarshalJSON(u.Str, "", true)
}

if u.And != nil {
return utils.MarshalJSON(u.And, "", true)
}

if u.Or != nil {
return utils.MarshalJSON(u.Or, "", true)
}

return nil, errors.New("could not marshal union type PermissionQuery: all fields are null")
}
8 changes: 2 additions & 6 deletions models/components/v1keysverifykeyrequest.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,13 @@ import (
"github.com/unkeyed/unkey-go/internal/utils"
)

// Permissions - A query for which permissions you require
type Permissions struct {
}

// Authorization - Perform RBAC checks
type Authorization struct {
// A query for which permissions you require
Permissions *Permissions `json:"permissions,omitempty"`
Permissions *PermissionQuery `json:"permissions,omitempty"`
}

func (o *Authorization) GetPermissions() *Permissions {
func (o *Authorization) GetPermissions() *PermissionQuery {
if o == nil {
return nil
}
Expand Down
4 changes: 2 additions & 2 deletions unkey.go
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ func New(opts ...SDKOption) *Unkey {
sdkConfiguration: sdkConfiguration{
Language: "go",
OpenAPIDocVersion: "1.0.0",
SDKVersion: "0.3.1",
SDKVersion: "0.4.0",
GenVersion: "2.338.12",
UserAgent: "speakeasy-sdk/go 0.3.1 2.338.12 1.0.0 github.com/unkeyed/unkey-go",
UserAgent: "speakeasy-sdk/go 0.4.0 2.338.12 1.0.0 github.com/unkeyed/unkey-go",
Hooks: hooks.New(),
},
}
Expand Down

0 comments on commit 971393f

Please sign in to comment.