-
Notifications
You must be signed in to change notification settings - Fork 1
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 #14 from unkeyed/speakeasy-sdk-regen-1717533248
chore: 🐝 Update SDK - Generate
- Loading branch information
Showing
13 changed files
with
191 additions
and
35 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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# And | ||
|
||
|
||
## Fields | ||
|
||
| Field | Type | Required | Description | | ||
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | | ||
| `And` | [][PermissionQuery](../../permissionquery.md) | :heavy_check_mark: | N/A | |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Or | ||
|
||
|
||
## Fields | ||
|
||
| Field | Type | Required | Description | | ||
| --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | --------------------------------------------- | | ||
| `Or` | [][PermissionQuery](../../permissionquery.md) | :heavy_check_mark: | N/A | |
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,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 */}) | ||
``` | ||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -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") | ||
} |
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