Skip to content

Commit a846e90

Browse files
committed
ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.468.9
1 parent ec7a0bf commit a846e90

File tree

17 files changed

+250
-86
lines changed

17 files changed

+250
-86
lines changed

.speakeasy/gen.lock

Lines changed: 64 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: 2858c6d9-f946-4185-ae68-3b8e708830fb
33
management:
4-
docChecksum: 53c59e9888ffa48d7fef9b0017efc602
4+
docChecksum: 37a13cf25882217bb6883efc4407294c
55
docVersion: 0.4.0
6-
speakeasyVersion: 1.468.6
7-
generationVersion: 2.493.13
8-
releaseVersion: 3.19.3
9-
configChecksum: ada2ccd6c17dbe4a381e8e643b9e8e8a
6+
speakeasyVersion: 1.468.9
7+
generationVersion: 2.493.21
8+
releaseVersion: 3.19.4
9+
configChecksum: 740e28bc9e9c18688289ea42ad39d30c
1010
repoURL: https://github.com/speakeasy-api/speakeasy-client-sdk-go.git
1111
repoSubDirectory: .
1212
installationURL: https://github.com/speakeasy-api/speakeasy-client-sdk-go
@@ -15,7 +15,7 @@ features:
1515
go:
1616
acceptHeaders: 2.81.2
1717
additionalDependencies: 0.1.0
18-
core: 3.6.5
18+
core: 3.6.6
1919
defaultEnabledRetries: 0.2.0
2020
deprecations: 2.81.2
2121
devContainers: 2.90.0
@@ -34,7 +34,7 @@ features:
3434
retries: 2.83.2
3535
sdkHooks: 0.1.0
3636
serverIDs: 2.81.1
37-
tests: 0.10.3
37+
tests: 0.10.4
3838
uploadStreams: 0.1.0
3939
generatedFiles:
4040
- .devcontainer/README.md
@@ -1746,6 +1746,8 @@ examples:
17461746
"200":
17471747
application/json: "x-file: example.file"
17481748
application/x-yaml: "x-file: example.file"
1749+
5XX:
1750+
application/json: {"message": "<value>", "status_code": 569513}
17491751
generateCodeSamplePreviewAsync:
17501752
speakeasy-default-generate-code-sample-preview-async:
17511753
requestBody:
@@ -1755,6 +1757,8 @@ examples:
17551757
application/json: {"job_id": "<id>", "status": "running"}
17561758
4XX:
17571759
application/json: {"message": "<value>", "status_code": 242219}
1760+
5XX:
1761+
application/json: {"message": "<value>", "status_code": 933708}
17581762
getCodeSamplePreviewAsync:
17591763
speakeasy-default-get-code-sample-preview-async:
17601764
parameters:
@@ -1768,6 +1772,8 @@ examples:
17681772
"200":
17691773
application/json: "x-file: example.file"
17701774
application/x-yaml: "x-file: example.file"
1775+
5XX:
1776+
application/json: {"message": "<value>", "status_code": 91014}
17711777
getGithubSetupState:
17721778
speakeasy-default-get-github-setup-state:
17731779
parameters:
@@ -1816,6 +1822,57 @@ examples:
18161822
application/json: {"snippets": [{"code": "<value>", "language": "<value>", "operationId": "<id>"}, {"code": "<value>", "language": "<value>", "operationId": "<id>"}, {"code": "<value>", "language": "<value>", "operationId": "<id>"}]}
18171823
4XX:
18181824
application/json: {"message": "<value>", "status_code": 458049}
1825+
"":
1826+
parameters:
1827+
query:
1828+
registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source"
1829+
operation_ids: ["getPetById"]
1830+
responses:
1831+
2XX:
1832+
application/json: {"snippets": [{"code": "<value>", "language": "<value>", "operationId": "<id>"}, {"code": "<value>", "language": "<value>", "operationId": "<id>"}]}
1833+
4XX:
1834+
application/json: {"message": "<value>", "status_code": 558834}
1835+
python:
1836+
parameters:
1837+
query:
1838+
registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source"
1839+
operation_ids: ["getPetById"]
1840+
languages: ["python"]
1841+
responses:
1842+
2XX:
1843+
application/json: {"snippets": [{"code": "<value>", "language": "<value>", "operationId": "<id>"}, {"code": "<value>", "language": "<value>", "operationId": "<id>"}]}
1844+
4XX:
1845+
application/json: {"message": "<value>", "status_code": 521235}
1846+
typescript:
1847+
parameters:
1848+
query:
1849+
registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source"
1850+
operation_ids: ["getPetById"]
1851+
languages: ["typescript"]
1852+
responses:
1853+
2XX:
1854+
application/json: {"snippets": [{"code": "<value>", "language": "<value>", "operationId": "<id>"}, {"code": "<value>", "language": "<value>", "operationId": "<id>"}, {"code": "<value>", "language": "<value>", "operationId": "<id>"}]}
1855+
4XX:
1856+
application/json: {"message": "<value>", "status_code": 458049}
1857+
java:
1858+
parameters:
1859+
query:
1860+
registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source"
1861+
operation_ids: ["getPetById"]
1862+
languages: ["java"]
1863+
responses:
1864+
2XX:
1865+
application/json: {"snippets": [{"code": "<value>", "language": "<value>", "operationId": "<id>"}]}
1866+
4XX:
1867+
application/json: {"message": "<value>", "status_code": 262795}
1868+
default:
1869+
parameters:
1870+
query:
1871+
registry_url: "https://spec.speakeasy.com/my-org/my-workspace/my-source"
1872+
operation_ids: ["getPetById"]
1873+
responses:
1874+
2XX:
1875+
application/json: {"snippets": [{"code": "import { Petstore } from \"petstore-sdk\";\n\nconst petstore = new Petstore({\n apiKey: \"<YOUR_API_KEY_HERE>\",\n});\n\nasync function run() {\n const result = await petstore.pet.getById({\n id: 137396,\n });\n\n // Handle the result\n console.log(result);\n}\n\nrun();", "language": "typescript", "operationId": "getPetById"}]}
18191876
setWorkspaceFeatureFlags:
18201877
speakeasy-default-set-workspace-feature-flags:
18211878
requestBody:

.speakeasy/workflow.lock

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
speakeasyVersion: 1.468.6
1+
speakeasyVersion: 1.468.9
22
sources:
33
my-source:
44
sourceNamespace: my-source
5-
sourceRevisionDigest: sha256:ab9c77eb5a55b25ab8eb3326a3896003a09af3f28d0bba771f6e502366f58025
6-
sourceBlobDigest: sha256:c4bc148bd2df6e1b53fee2228938cbb11d43111425e73c01ba58df9ba77bd4a0
5+
sourceRevisionDigest: sha256:dcfd0e20cf07a7c4a0a7dda16ceb197a596551c82ff66118822aaa0d0c8694fb
6+
sourceBlobDigest: sha256:8f42a23c071ea4583fdaac6d8f79bd01e9162d8ac53fe951400456d9773591a3
77
tags:
88
- latest
99
- main
@@ -12,10 +12,10 @@ targets:
1212
speakeasy-client-sdk-go:
1313
source: my-source
1414
sourceNamespace: my-source
15-
sourceRevisionDigest: sha256:ab9c77eb5a55b25ab8eb3326a3896003a09af3f28d0bba771f6e502366f58025
16-
sourceBlobDigest: sha256:c4bc148bd2df6e1b53fee2228938cbb11d43111425e73c01ba58df9ba77bd4a0
15+
sourceRevisionDigest: sha256:dcfd0e20cf07a7c4a0a7dda16ceb197a596551c82ff66118822aaa0d0c8694fb
16+
sourceBlobDigest: sha256:8f42a23c071ea4583fdaac6d8f79bd01e9162d8ac53fe951400456d9773591a3
1717
codeSamplesNamespace: code-samples-go-speakeasy-client-sdk-go
18-
codeSamplesRevisionDigest: sha256:6c29d4ecc1637e4102e7482a76fab425ebc4261b842bfd562da89ac31e2341f3
18+
codeSamplesRevisionDigest: sha256:032898a9fef0da1e9fda2f8a69d84a901a271de88891310ebb6cd59255786a71
1919
workflow:
2020
workflowVersion: 1.0.0
2121
speakeasyVersion: latest

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func main() {
110110

111111
* [GenerateCodeSamplePreview](docs/sdks/codesamples/README.md#generatecodesamplepreview) - Generate Code Sample previews from a file and configuration parameters.
112112
* [GenerateCodeSamplePreviewAsync](docs/sdks/codesamples/README.md#generatecodesamplepreviewasync) - Initiate asynchronous Code Sample preview generation from a file and configuration parameters, receiving an async JobID response for polling.
113-
* [Get](docs/sdks/codesamples/README.md#get) - Retrieve usage snippets from document stored in the registry
113+
* [Get](docs/sdks/codesamples/README.md#get) - Retrieve usage snippets
114114
* [GetCodeSamplePreviewAsync](docs/sdks/codesamples/README.md#getcodesamplepreviewasync) - Poll for the result of an asynchronous Code Sample preview generation.
115115

116116
### [Events](docs/sdks/events/README.md)

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1556,4 +1556,14 @@ Based on:
15561556
### Generated
15571557
- [go v3.19.3] .
15581558
### Releases
1559-
- [Go v3.19.3] https://github.com/speakeasy-api/speakeasy-client-sdk-go/releases/tag/v3.19.3 - .
1559+
- [Go v3.19.3] https://github.com/speakeasy-api/speakeasy-client-sdk-go/releases/tag/v3.19.3 - .
1560+
1561+
## 2025-01-16 22:02:27
1562+
### Changes
1563+
Based on:
1564+
- OpenAPI Doc
1565+
- Speakeasy CLI 1.468.9 (2.493.21) https://github.com/speakeasy-api/speakeasy
1566+
### Generated
1567+
- [go v3.19.4] .
1568+
### Releases
1569+
- [Go v3.19.4] https://github.com/speakeasy-api/speakeasy-client-sdk-go/releases/tag/v3.19.4 - .

auth.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,11 @@ func (s *Auth) GetAccess(ctx context.Context, request operations.GetWorkspaceAcc
217217
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
218218
}
219219
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
220-
fallthrough
220+
rawBody, err := utils.ConsumeRawBody(httpRes)
221+
if err != nil {
222+
return nil, err
223+
}
224+
return nil, sdkerrors.NewSDKError("API error occurred", httpRes.StatusCode, string(rawBody), httpRes)
221225
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
222226
rawBody, err := utils.ConsumeRawBody(httpRes)
223227
if err != nil {

codeSamples.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ actions:
6868
x-codeSamples:
6969
- lang: go
7070
label: getCodeSamples
71-
source: "package main\n\nimport(\n\t\"context\"\n\tspeakeasyclientsdkgo \"github.com/speakeasy-api/speakeasy-client-sdk-go/v3\"\n\t\"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared\"\n\t\"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := speakeasyclientsdkgo.New(\n speakeasyclientsdkgo.WithSecurity(shared.Security{\n APIKey: speakeasyclientsdkgo.String(\"<YOUR_API_KEY_HERE>\"),\n }),\n )\n\n res, err := s.CodeSamples.Get(ctx, operations.GetCodeSamplesRequest{\n RegistryURL: \"https://normal-making.name\",\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.UsageSnippets != nil {\n // handle response\n }\n}"
71+
source: "package main\n\nimport(\n\t\"context\"\n\tspeakeasyclientsdkgo \"github.com/speakeasy-api/speakeasy-client-sdk-go/v3\"\n\t\"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/shared\"\n\t\"github.com/speakeasy-api/speakeasy-client-sdk-go/v3/pkg/models/operations\"\n\t\"log\"\n)\n\nfunc main() {\n ctx := context.Background()\n \n s := speakeasyclientsdkgo.New(\n speakeasyclientsdkgo.WithSecurity(shared.Security{\n APIKey: speakeasyclientsdkgo.String(\"<YOUR_API_KEY_HERE>\"),\n }),\n )\n\n res, err := s.CodeSamples.Get(ctx, operations.GetCodeSamplesRequest{\n RegistryURL: \"https://spec.speakeasy.com/my-org/my-workspace/my-source\",\n OperationIds: []string{\n \"getPetById\",\n },\n Languages: []string{\n \"python\",\n },\n })\n if err != nil {\n log.Fatal(err)\n }\n if res.UsageSnippets != nil {\n // handle response\n }\n}"
7272
- target: $["paths"]["/v1/code_sample/preview"]["post"]
7373
update:
7474
x-codeSamples:

codesamples.go

Lines changed: 62 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,26 @@ func (s *CodeSamples) GenerateCodeSamplePreview(ctx context.Context, request sha
214214
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
215215
}
216216
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
217-
fallthrough
217+
switch {
218+
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
219+
rawBody, err := utils.ConsumeRawBody(httpRes)
220+
if err != nil {
221+
return nil, err
222+
}
223+
224+
var out sdkerrors.Error
225+
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
226+
return nil, err
227+
}
228+
229+
return nil, &out
230+
default:
231+
rawBody, err := utils.ConsumeRawBody(httpRes)
232+
if err != nil {
233+
return nil, err
234+
}
235+
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
236+
}
218237
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
219238
switch {
220239
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
@@ -433,7 +452,26 @@ func (s *CodeSamples) GenerateCodeSamplePreviewAsync(ctx context.Context, reques
433452
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
434453
}
435454
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
436-
fallthrough
455+
switch {
456+
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
457+
rawBody, err := utils.ConsumeRawBody(httpRes)
458+
if err != nil {
459+
return nil, err
460+
}
461+
462+
var out sdkerrors.Error
463+
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
464+
return nil, err
465+
}
466+
467+
return nil, &out
468+
default:
469+
rawBody, err := utils.ConsumeRawBody(httpRes)
470+
if err != nil {
471+
return nil, err
472+
}
473+
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
474+
}
437475
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
438476
switch {
439477
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
@@ -467,8 +505,8 @@ func (s *CodeSamples) GenerateCodeSamplePreviewAsync(ctx context.Context, reques
467505

468506
}
469507

470-
// Get - Retrieve usage snippets from document stored in the registry
471-
// Retrieve usage snippets from document stored in the registry. Supports filtering by language and operation ID.
508+
// Get - Retrieve usage snippets
509+
// Retrieve usage snippets from an OpenAPI document stored in the registry. Supports filtering by language and operation ID.
472510
func (s *CodeSamples) Get(ctx context.Context, request operations.GetCodeSamplesRequest, opts ...operations.Option) (*operations.GetCodeSamplesResponse, error) {
473511
hookCtx := hooks.HookContext{
474512
Context: ctx,
@@ -886,7 +924,26 @@ func (s *CodeSamples) GetCodeSamplePreviewAsync(ctx context.Context, request ope
886924
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
887925
}
888926
case httpRes.StatusCode >= 400 && httpRes.StatusCode < 500:
889-
fallthrough
927+
switch {
928+
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):
929+
rawBody, err := utils.ConsumeRawBody(httpRes)
930+
if err != nil {
931+
return nil, err
932+
}
933+
934+
var out sdkerrors.Error
935+
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
936+
return nil, err
937+
}
938+
939+
return nil, &out
940+
default:
941+
rawBody, err := utils.ConsumeRawBody(httpRes)
942+
if err != nil {
943+
return nil, err
944+
}
945+
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", httpRes.Header.Get("Content-Type")), httpRes.StatusCode, string(rawBody), httpRes)
946+
}
890947
case httpRes.StatusCode >= 500 && httpRes.StatusCode < 600:
891948
switch {
892949
case utils.MatchContentType(httpRes.Header.Get("Content-Type"), `application/json`):

docs/pkg/models/operations/getcodesamplesrequest.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
## Fields
55

6-
| Field | Type | Required | Description |
7-
| ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------ |
8-
| `Languages` | []*string* | :heavy_minus_sign: | N/A |
9-
| `OperationIds` | []*string* | :heavy_minus_sign: | N/A |
10-
| `RegistryURL` | *string* | :heavy_check_mark: | The registry URL from which to retrieve the snippets. E.g. https://spec.speakeasy.com/org/ws/my-source |
6+
| Field | Type | Required | Description | Example |
7+
| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
8+
| `Languages` | []*string* | :heavy_minus_sign: | The languages to retrieve snippets for. | |
9+
| `OperationIds` | []*string* | :heavy_minus_sign: | The operation IDs to retrieve snippets for. | getPetById |
10+
| `RegistryURL` | *string* | :heavy_check_mark: | The registry URL from which to retrieve the snippets. | https://spec.speakeasy.com/my-org/my-workspace/my-source |

0 commit comments

Comments
 (0)