Skip to content

Commit

Permalink
chore: regenerate using reapply-go-sdk branch from platform-api
Browse files Browse the repository at this point in the history
  • Loading branch information
pmalek committed Sep 23, 2024
1 parent 5ec69f2 commit 077efc6
Show file tree
Hide file tree
Showing 345 changed files with 1,597 additions and 2,739 deletions.
191 changes: 141 additions & 50 deletions .speakeasy/gen.lock

Large diffs are not rendered by default.

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: false
go:
version: 0.0.13
version: 0.0.14
additionalDependencies: {}
allowUnknownFieldsInWeakUnions: false
clientServerStatusCodesAsErrors: true
Expand Down
156 changes: 116 additions & 40 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ This is a prototype and should not be used. See [CONTRIBUTING.md](https://github

Handling errors in this SDK should largely match your expectations. All operations return a response object or an error, they will never return both. When specified by the OpenAPI spec document, the SDK will return the appropriate subclass.

| Error Object | Status Code | Content Type |
| --------------------------- | --------------------------- | --------------------------- |
| sdkerrors.UnauthorizedError | 401 | application/problem+json |
| sdkerrors.ForbiddenError | 403 | application/problem+json |
| sdkerrors.SDKError | 4xx-5xx | */* |
| Error Object | Status Code | Content Type |
| ---------------------------- | ---------------------------- | ---------------------------- |
| sdkerrors.BadRequestError | 400 | application/problem+json |
| sdkerrors.UnauthorizedError | 401 | application/problem+json |
| sdkerrors.ForbiddenError | 403 | application/problem+json |
| sdkerrors.ServiceUnavailable | 503 | application/problem+json |
| sdkerrors.SDKError | 4xx-5xx | */* |

### Example

Expand All @@ -39,13 +41,30 @@ func main() {
)

ctx := context.Background()
res, err := s.ServerlessCloudGateways.ListServerlessCloudGateway(ctx, operations.ListServerlessCloudGatewayRequest{
PageSize: sdkkonnectgo.Int64(10),
PageNumber: sdkkonnectgo.Int64(1),
Labels: sdkkonnectgo.String("filter[labels][eq]=env:prod"),
res, err := s.ControlPlanes.ListControlPlanes(ctx, operations.ListControlPlanesRequest{
PageSize: sdkkonnectgo.Int64(10),
PageNumber: sdkkonnectgo.Int64(1),
FilterNameEq: sdkkonnectgo.String("test"),
FilterName: sdkkonnectgo.String("test"),
FilterNameContains: sdkkonnectgo.String("test"),
FilterNameNeq: sdkkonnectgo.String("test"),
FilterIDEq: sdkkonnectgo.String("7f9fd312-a987-4628-b4c5-bb4f4fddd5f7"),
FilterID: sdkkonnectgo.String("7f9fd312-a987-4628-b4c5-bb4f4fddd5f7"),
FilterIDOeq: sdkkonnectgo.String("some-value,some-other-value"),
FilterClusterTypeEq: sdkkonnectgo.String("CLUSTER_TYPE_CONTROL_PLANE"),
FilterClusterType: sdkkonnectgo.String("CLUSTER_TYPE_CONTROL_PLANE"),
FilterClusterTypeNeq: sdkkonnectgo.String("test"),
Labels: sdkkonnectgo.String("key:value,existCheck"),
Sort: sdkkonnectgo.String("name,created_at desc"),
})
if err != nil {

var e *sdkerrors.BadRequestError
if errors.As(err, &e) {
// handle error
log.Fatal(e.Error())
}

var e *sdkerrors.UnauthorizedError
if errors.As(err, &e) {
// handle error
Expand All @@ -58,6 +77,12 @@ func main() {
log.Fatal(e.Error())
}

var e *sdkerrors.ServiceUnavailable
if errors.As(err, &e) {
// handle error
log.Fatal(e.Error())
}

var e *sdkerrors.SDKError
if errors.As(err, &e) {
// handle error
Expand Down Expand Up @@ -105,15 +130,26 @@ func main() {
)

ctx := context.Background()
res, err := s.ServerlessCloudGateways.ListServerlessCloudGateway(ctx, operations.ListServerlessCloudGatewayRequest{
PageSize: sdkkonnectgo.Int64(10),
PageNumber: sdkkonnectgo.Int64(1),
Labels: sdkkonnectgo.String("filter[labels][eq]=env:prod"),
res, err := s.ControlPlanes.ListControlPlanes(ctx, operations.ListControlPlanesRequest{
PageSize: sdkkonnectgo.Int64(10),
PageNumber: sdkkonnectgo.Int64(1),
FilterNameEq: sdkkonnectgo.String("test"),
FilterName: sdkkonnectgo.String("test"),
FilterNameContains: sdkkonnectgo.String("test"),
FilterNameNeq: sdkkonnectgo.String("test"),
FilterIDEq: sdkkonnectgo.String("7f9fd312-a987-4628-b4c5-bb4f4fddd5f7"),
FilterID: sdkkonnectgo.String("7f9fd312-a987-4628-b4c5-bb4f4fddd5f7"),
FilterIDOeq: sdkkonnectgo.String("some-value,some-other-value"),
FilterClusterTypeEq: sdkkonnectgo.String("CLUSTER_TYPE_CONTROL_PLANE"),
FilterClusterType: sdkkonnectgo.String("CLUSTER_TYPE_CONTROL_PLANE"),
FilterClusterTypeNeq: sdkkonnectgo.String("test"),
Labels: sdkkonnectgo.String("key:value,existCheck"),
Sort: sdkkonnectgo.String("name,created_at desc"),
})
if err != nil {
log.Fatal(err)
}
if res.ListServerlessCloudGatewaysResponse != nil {
if res.ListControlPlanesResponse != nil {
// handle response
}
}
Expand Down Expand Up @@ -144,15 +180,26 @@ func main() {
)

ctx := context.Background()
res, err := s.ServerlessCloudGateways.ListServerlessCloudGateway(ctx, operations.ListServerlessCloudGatewayRequest{
PageSize: sdkkonnectgo.Int64(10),
PageNumber: sdkkonnectgo.Int64(1),
Labels: sdkkonnectgo.String("filter[labels][eq]=env:prod"),
res, err := s.ControlPlanes.ListControlPlanes(ctx, operations.ListControlPlanesRequest{
PageSize: sdkkonnectgo.Int64(10),
PageNumber: sdkkonnectgo.Int64(1),
FilterNameEq: sdkkonnectgo.String("test"),
FilterName: sdkkonnectgo.String("test"),
FilterNameContains: sdkkonnectgo.String("test"),
FilterNameNeq: sdkkonnectgo.String("test"),
FilterIDEq: sdkkonnectgo.String("7f9fd312-a987-4628-b4c5-bb4f4fddd5f7"),
FilterID: sdkkonnectgo.String("7f9fd312-a987-4628-b4c5-bb4f4fddd5f7"),
FilterIDOeq: sdkkonnectgo.String("some-value,some-other-value"),
FilterClusterTypeEq: sdkkonnectgo.String("CLUSTER_TYPE_CONTROL_PLANE"),
FilterClusterType: sdkkonnectgo.String("CLUSTER_TYPE_CONTROL_PLANE"),
FilterClusterTypeNeq: sdkkonnectgo.String("test"),
Labels: sdkkonnectgo.String("key:value,existCheck"),
Sort: sdkkonnectgo.String("name,created_at desc"),
})
if err != nil {
log.Fatal(err)
}
if res.ListServerlessCloudGatewaysResponse != nil {
if res.ListControlPlanesResponse != nil {
// handle response
}
}
Expand Down Expand Up @@ -181,15 +228,11 @@ func main() {
)

ctx := context.Background()
res, err := s.ServerlessCloudGateways.ListServerlessCloudGateway(ctx, operations.ListServerlessCloudGatewayRequest{
PageSize: sdkkonnectgo.Int64(10),
PageNumber: sdkkonnectgo.Int64(1),
Labels: sdkkonnectgo.String("filter[labels][eq]=env:prod"),
}, operations.WithServerURL("https://global.api.konghq.com/"))
res, err := s.Authentication.AuthenticateSso(ctx, "<value>", nil, operations.WithServerURL("https://global.api.konghq.com/"))
if err != nil {
log.Fatal(err)
}
if res.ListServerlessCloudGatewaysResponse != nil {
if res != nil {
// handle response
}
}
Expand Down Expand Up @@ -259,15 +302,26 @@ func main() {
)

ctx := context.Background()
res, err := s.ServerlessCloudGateways.ListServerlessCloudGateway(ctx, operations.ListServerlessCloudGatewayRequest{
PageSize: sdkkonnectgo.Int64(10),
PageNumber: sdkkonnectgo.Int64(1),
Labels: sdkkonnectgo.String("filter[labels][eq]=env:prod"),
res, err := s.ControlPlanes.ListControlPlanes(ctx, operations.ListControlPlanesRequest{
PageSize: sdkkonnectgo.Int64(10),
PageNumber: sdkkonnectgo.Int64(1),
FilterNameEq: sdkkonnectgo.String("test"),
FilterName: sdkkonnectgo.String("test"),
FilterNameContains: sdkkonnectgo.String("test"),
FilterNameNeq: sdkkonnectgo.String("test"),
FilterIDEq: sdkkonnectgo.String("7f9fd312-a987-4628-b4c5-bb4f4fddd5f7"),
FilterID: sdkkonnectgo.String("7f9fd312-a987-4628-b4c5-bb4f4fddd5f7"),
FilterIDOeq: sdkkonnectgo.String("some-value,some-other-value"),
FilterClusterTypeEq: sdkkonnectgo.String("CLUSTER_TYPE_CONTROL_PLANE"),
FilterClusterType: sdkkonnectgo.String("CLUSTER_TYPE_CONTROL_PLANE"),
FilterClusterTypeNeq: sdkkonnectgo.String("test"),
Labels: sdkkonnectgo.String("key:value,existCheck"),
Sort: sdkkonnectgo.String("name,created_at desc"),
})
if err != nil {
log.Fatal(err)
}
if res.ListServerlessCloudGatewaysResponse != nil {
if res.ListControlPlanesResponse != nil {
// handle response
}
}
Expand Down Expand Up @@ -330,10 +384,21 @@ func main() {
)

ctx := context.Background()
res, err := s.ServerlessCloudGateways.ListServerlessCloudGateway(ctx, operations.ListServerlessCloudGatewayRequest{
PageSize: sdkkonnectgo.Int64(10),
PageNumber: sdkkonnectgo.Int64(1),
Labels: sdkkonnectgo.String("filter[labels][eq]=env:prod"),
res, err := s.ControlPlanes.ListControlPlanes(ctx, operations.ListControlPlanesRequest{
PageSize: sdkkonnectgo.Int64(10),
PageNumber: sdkkonnectgo.Int64(1),
FilterNameEq: sdkkonnectgo.String("test"),
FilterName: sdkkonnectgo.String("test"),
FilterNameContains: sdkkonnectgo.String("test"),
FilterNameNeq: sdkkonnectgo.String("test"),
FilterIDEq: sdkkonnectgo.String("7f9fd312-a987-4628-b4c5-bb4f4fddd5f7"),
FilterID: sdkkonnectgo.String("7f9fd312-a987-4628-b4c5-bb4f4fddd5f7"),
FilterIDOeq: sdkkonnectgo.String("some-value,some-other-value"),
FilterClusterTypeEq: sdkkonnectgo.String("CLUSTER_TYPE_CONTROL_PLANE"),
FilterClusterType: sdkkonnectgo.String("CLUSTER_TYPE_CONTROL_PLANE"),
FilterClusterTypeNeq: sdkkonnectgo.String("test"),
Labels: sdkkonnectgo.String("key:value,existCheck"),
Sort: sdkkonnectgo.String("name,created_at desc"),
}, operations.WithRetries(
retry.Config{
Strategy: "backoff",
Expand All @@ -348,7 +413,7 @@ func main() {
if err != nil {
log.Fatal(err)
}
if res.ListServerlessCloudGatewaysResponse != nil {
if res.ListControlPlanesResponse != nil {
// handle response
}
}
Expand Down Expand Up @@ -387,15 +452,26 @@ func main() {
)

ctx := context.Background()
res, err := s.ServerlessCloudGateways.ListServerlessCloudGateway(ctx, operations.ListServerlessCloudGatewayRequest{
PageSize: sdkkonnectgo.Int64(10),
PageNumber: sdkkonnectgo.Int64(1),
Labels: sdkkonnectgo.String("filter[labels][eq]=env:prod"),
res, err := s.ControlPlanes.ListControlPlanes(ctx, operations.ListControlPlanesRequest{
PageSize: sdkkonnectgo.Int64(10),
PageNumber: sdkkonnectgo.Int64(1),
FilterNameEq: sdkkonnectgo.String("test"),
FilterName: sdkkonnectgo.String("test"),
FilterNameContains: sdkkonnectgo.String("test"),
FilterNameNeq: sdkkonnectgo.String("test"),
FilterIDEq: sdkkonnectgo.String("7f9fd312-a987-4628-b4c5-bb4f4fddd5f7"),
FilterID: sdkkonnectgo.String("7f9fd312-a987-4628-b4c5-bb4f4fddd5f7"),
FilterIDOeq: sdkkonnectgo.String("some-value,some-other-value"),
FilterClusterTypeEq: sdkkonnectgo.String("CLUSTER_TYPE_CONTROL_PLANE"),
FilterClusterType: sdkkonnectgo.String("CLUSTER_TYPE_CONTROL_PLANE"),
FilterClusterTypeNeq: sdkkonnectgo.String("test"),
Labels: sdkkonnectgo.String("key:value,existCheck"),
Sort: sdkkonnectgo.String("name,created_at desc"),
})
if err != nil {
log.Fatal(err)
}
if res.ListServerlessCloudGatewaysResponse != nil {
if res.ListControlPlanesResponse != nil {
// handle response
}
}
Expand Down
21 changes: 16 additions & 5 deletions USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,26 @@ func main() {
)

ctx := context.Background()
res, err := s.ServerlessCloudGateways.ListServerlessCloudGateway(ctx, operations.ListServerlessCloudGatewayRequest{
PageSize: sdkkonnectgo.Int64(10),
PageNumber: sdkkonnectgo.Int64(1),
Labels: sdkkonnectgo.String("filter[labels][eq]=env:prod"),
res, err := s.ControlPlanes.ListControlPlanes(ctx, operations.ListControlPlanesRequest{
PageSize: sdkkonnectgo.Int64(10),
PageNumber: sdkkonnectgo.Int64(1),
FilterNameEq: sdkkonnectgo.String("test"),
FilterName: sdkkonnectgo.String("test"),
FilterNameContains: sdkkonnectgo.String("test"),
FilterNameNeq: sdkkonnectgo.String("test"),
FilterIDEq: sdkkonnectgo.String("7f9fd312-a987-4628-b4c5-bb4f4fddd5f7"),
FilterID: sdkkonnectgo.String("7f9fd312-a987-4628-b4c5-bb4f4fddd5f7"),
FilterIDOeq: sdkkonnectgo.String("some-value,some-other-value"),
FilterClusterTypeEq: sdkkonnectgo.String("CLUSTER_TYPE_CONTROL_PLANE"),
FilterClusterType: sdkkonnectgo.String("CLUSTER_TYPE_CONTROL_PLANE"),
FilterClusterTypeNeq: sdkkonnectgo.String("test"),
Labels: sdkkonnectgo.String("key:value,existCheck"),
Sort: sdkkonnectgo.String("name,created_at desc"),
})
if err != nil {
log.Fatal(err)
}
if res.ListServerlessCloudGatewaysResponse != nil {
if res.ListControlPlanesResponse != nil {
// handle response
}
}
Expand Down
Loading

0 comments on commit 077efc6

Please sign in to comment.