Skip to content

Commit 0b387d2

Browse files
github-actions[bot]speakeasybotspeakeasy-github[bot]
authored
chore: 🐝 Update SDK - Generate 0.27.5 (#85)
* ci: regenerated with OpenAPI Doc , Speakeasy CLI 1.761.0 * empty commit to trigger [run-tests] workflow --------- Co-authored-by: speakeasybot <bot@speakeasyapi.dev> Co-authored-by: speakeasy-github[bot] <128539517+speakeasy-github[bot]@users.noreply.github.com>
1 parent a528391 commit 0b387d2

File tree

7 files changed

+136
-74
lines changed

7 files changed

+136
-74
lines changed

.speakeasy/gen.lock

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
lockVersion: 2.0.0
22
id: a6dcebe4-2c17-41e4-82d6-4019bcec33d5
33
management:
4-
docChecksum: aaccfaf769a5ef00ecc6f004f8f0a38e
5-
docVersion: 10.24.10
6-
speakeasyVersion: 1.759.3
7-
generationVersion: 2.869.25
8-
releaseVersion: 0.27.4
9-
configChecksum: ca88a7871e1b85f33f99f194c9ad0a7e
4+
docChecksum: 97d22df53affc8a9a7ca8183172d67d7
5+
docVersion: 10.24.12
6+
speakeasyVersion: 1.761.0
7+
generationVersion: 2.879.1
8+
releaseVersion: 0.27.5
9+
configChecksum: 92a53c8c7ddd8d7946f8558d79f2b02e
1010
repoURL: https://github.com/apideck-libraries/sdk-go.git
1111
installationURL: https://github.com/apideck-libraries/sdk-go
1212
persistentEdits:
13-
generation_id: 1fb3b23c-5426-4bb2-bb1f-068ec46feb27
14-
pristine_commit_hash: 17cf8bca9c67051dd832e6c830840f6487bd10b5
15-
pristine_tree_hash: 032d29c5f6518853b33ca11c19e5422a7598ca23
13+
generation_id: b7a96c18-864c-4ef6-87df-cc55ceb38d53
14+
pristine_commit_hash: 245f50cbc8242f26cca7818b144fa9553a27431f
15+
pristine_tree_hash: dd3c12b1cbbf631e27813a385dd4508e1721190e
1616
features:
1717
go:
1818
acceptHeaders: 2.81.2
@@ -28,7 +28,7 @@ features:
2828
envVarSecurityUsage: 0.3.2
2929
errors: 2.83.0
3030
flattening: 2.81.2
31-
globalSecurity: 2.82.13
31+
globalSecurity: 2.82.15
3232
globalSecurityCallbacks: 0.1.0
3333
globalSecurityFlattening: 0.1.0
3434
globalServerURLs: 2.83.1
@@ -86,8 +86,8 @@ trackedFiles:
8686
pristine_git_object: ce84829a51c57e1d83e2c215f2c0ca88a78f1f68
8787
apideck.go:
8888
id: 6038e194b5d6
89-
last_write_checksum: sha1:d6a44c9eefa28d63b2e7c87de6c2d5885a5d4836
90-
pristine_git_object: 990724ab539ddaa08c37a1140830eec420c7f3e1
89+
last_write_checksum: sha1:3989271bd5f9b35b42596f16a31c5889d6e50772
90+
pristine_git_object: 540abc8af5832764c557245ad94cd75b816a92e0
9191
apideckcompanies.go:
9292
id: db9db2359d33
9393
last_write_checksum: sha1:37ce1c349557c6a3037bec2905140054be4f2a96
@@ -8698,8 +8698,8 @@ trackedFiles:
86988698
pristine_git_object: a6ed643b3736dea5930adf1e084a8db7a6e27acf
86998699
internal/utils/json.go:
87008700
id: ad03e3c502d8
8701-
last_write_checksum: sha1:95e0003c5d43a5fd0e5aa63f6b9b3288264f0f2b
8702-
pristine_git_object: c99c40234579312dd57f4dabcb92ab24f2bb01c0
8701+
last_write_checksum: sha1:9a4851b23d72a178cb1ad4b4f79f461953259dd5
8702+
pristine_git_object: 797c3bbdc3ee4f16e1b0a0b2fcefacbed6fcd10f
87038703
internal/utils/pathparams.go:
87048704
id: 1f3e0c30fd90
87058705
last_write_checksum: sha1:82b2e0fe1d1600642e4f2ad7a32b4f8f73174913
@@ -8718,8 +8718,8 @@ trackedFiles:
87188718
pristine_git_object: c9b298f3407207c120fb1017dbaf54bd26ce7720
87198719
internal/utils/security.go:
87208720
id: eeb54c55241b
8721-
last_write_checksum: sha1:52cefded5223c60fcac5bd56574370e27a4bc3d5
8722-
pristine_git_object: ce2e1c0cffe3bbd3f111eace502f895175daad22
8721+
last_write_checksum: sha1:1c0b332b3cf0fa405df0c5bf4e03f335139566b6
8722+
pristine_git_object: 7c1a372ae314a9d82ab82c3db610e7ffe67ecfab
87238723
internal/utils/union.go:
87248724
id: db86c85746b6
87258725
last_write_checksum: sha1:8c996d904c2aa2a23f17ca09f3188d885673cbe3
@@ -29209,7 +29209,6 @@ examples:
2920929209
application/json: {"status_code": 400, "error": "Bad Request", "type_name": "RequestHeadersValidationError", "message": "Invalid Params", "detail": "Missing Header: x-apideck-consumer-id", "ref": "https://developers.apideck.com/errors#unauthorizederror"}
2921029210
examplesVersion: 1.0.2
2921129211
generatedTests: {}
29212-
releaseNotes: "## Go SDK Changes:\n* `Apideck.Vault.Consumers.Create()`: `response.Data.Connections[]` **Changed**\n* `Apideck.Vault.Consumers.Get()`: `response.Data.Connections[]` **Changed**\n* `Apideck.Vault.Consumers.Update()`: `response.Data.Connections[]` **Changed**\n* `Apideck.Webhook.Webhooks.List()`: `response.Data[].Events[]` **Changed**\n* `Apideck.Webhook.Webhooks.Create()`: \n * `request.CreateWebhookRequest.Events[]` **Changed**\n * `response.Data.Events[]` **Changed**\n* `Apideck.Webhook.Webhooks.Get()`: `response.Data.Events[]` **Changed**\n* `Apideck.Webhook.Webhooks.Update()`: \n * `request.UpdateWebhookRequest.Events[]` **Changed**\n * `response.Data.Events[]` **Changed**\n* `Apideck.Webhook.Webhooks.Delete()`: `response.Data.Events[]` **Changed**\n"
2921329212
generatedFiles:
2921429213
- .devcontainer/README.md
2921529214
- .devcontainer/devcontainer.json

.speakeasy/gen.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ generation:
3232
generateNewTests: false
3333
skipResponseBodyAssertions: false
3434
go:
35-
version: 0.27.4
35+
version: 0.27.5
3636
additionalDependencies: {}
3737
allowUnknownFieldsInWeakUnions: false
3838
baseErrorName: ApideckError

.speakeasy/workflow.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
speakeasyVersion: 1.759.3
1+
speakeasyVersion: 1.761.0
22
sources:
33
Apideck:
44
sourceNamespace: apideck
5-
sourceRevisionDigest: sha256:9cc947f672385844e7820088f0c3a0f3731fa4787794924e283e9664d8d9bf1f
6-
sourceBlobDigest: sha256:70cb93b4c7f545f28797f710d48cd4e693d30cf2b0cbdb62a20bdf8e8035ab99
5+
sourceRevisionDigest: sha256:eabb393ddca0f17ec496800535f1fb58c1fd4b04e2c069efe375e0ef35f2db59
6+
sourceBlobDigest: sha256:ee838a970e427ea2963adc125cb65f656f9264f5dc2344adcc692154eecbc423
77
tags:
88
- latest
9-
- 10.24.10
9+
- 10.24.12
1010
targets:
1111
apideck:
1212
source: Apideck
1313
sourceNamespace: apideck
14-
sourceRevisionDigest: sha256:9cc947f672385844e7820088f0c3a0f3731fa4787794924e283e9664d8d9bf1f
15-
sourceBlobDigest: sha256:70cb93b4c7f545f28797f710d48cd4e693d30cf2b0cbdb62a20bdf8e8035ab99
14+
sourceRevisionDigest: sha256:eabb393ddca0f17ec496800535f1fb58c1fd4b04e2c069efe375e0ef35f2db59
15+
sourceBlobDigest: sha256:ee838a970e427ea2963adc125cb65f656f9264f5dc2344adcc692154eecbc423
1616
codeSamplesNamespace: apideck-go-code-samples
17-
codeSamplesRevisionDigest: sha256:4273253c4296bf9d636cb2224711126115133316e7ea9c099f7b503565e9c1b5
17+
codeSamplesRevisionDigest: sha256:cf5d69543dc44e72b1fdf8ff0e28045dffa00d0e6c8253cd9e1b0df5f75d5d8c
1818
workflow:
1919
workflowVersion: 1.0.0
2020
speakeasyVersion: latest

RELEASES.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,4 +718,14 @@ Based on:
718718
### Generated
719719
- [go v0.27.4] .
720720
### Releases
721-
- [Go v0.27.4] https://github.com/apideck-libraries/sdk-go/releases/tag/v0.27.4 - .
721+
- [Go v0.27.4] https://github.com/apideck-libraries/sdk-go/releases/tag/v0.27.4 - .
722+
723+
## 2026-03-31 12:37:22
724+
### Changes
725+
Based on:
726+
- OpenAPI Doc
727+
- Speakeasy CLI 1.761.0 (2.879.1) https://github.com/speakeasy-api/speakeasy
728+
### Generated
729+
- [go v0.27.5] .
730+
### Releases
731+
- [Go v0.27.5] https://github.com/apideck-libraries/sdk-go/releases/tag/v0.27.5 - .

apideck.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
package sdkgo
44

5-
// Generated from OpenAPI doc version 10.24.10 and generator version 2.869.25
5+
// Generated from OpenAPI doc version 10.24.12 and generator version 2.879.1
66

77
import (
88
"context"
@@ -155,9 +155,9 @@ func WithTimeout(timeout time.Duration) SDKOption {
155155
// New creates a new instance of the SDK with the provided options
156156
func New(opts ...SDKOption) *Apideck {
157157
sdk := &Apideck{
158-
SDKVersion: "0.27.4",
158+
SDKVersion: "0.27.5",
159159
sdkConfiguration: config.SDKConfiguration{
160-
UserAgent: "speakeasy-sdk/go 0.27.4 2.869.25 10.24.10 github.com/apideck-libraries/sdk-go",
160+
UserAgent: "speakeasy-sdk/go 0.27.5 2.879.1 10.24.12 github.com/apideck-libraries/sdk-go",
161161
Globals: globals.Globals{},
162162
ServerList: ServerList,
163163
},

internal/utils/json.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,12 @@ func marshalValue(v interface{}, tag reflect.StructTag) (json.RawMessage, error)
348348
return []byte("null"), nil
349349
}
350350

351+
// []byte is special-cased by encoding/json to use base64 encoding.
352+
// Delegate directly to avoid treating individual bytes as array elements.
353+
if typ.Elem().Kind() == reflect.Uint8 {
354+
return json.Marshal(val.Interface())
355+
}
356+
351357
out := []json.RawMessage{}
352358

353359
for i := 0; i < val.Len(); i++ {
@@ -540,6 +546,15 @@ func unmarshalValue(value json.RawMessage, v reflect.Value, tag reflect.StructTa
540546
v.Set(m)
541547
return nil
542548
case reflect.Slice, reflect.Array:
549+
// []byte is special-cased by encoding/json to use base64 encoding.
550+
// Delegate directly to avoid treating the base64 string as a JSON array.
551+
if typ.Elem().Kind() == reflect.Uint8 {
552+
if v.CanAddr() {
553+
return json.Unmarshal(value, v.Addr().Interface())
554+
}
555+
return json.Unmarshal(value, v.Interface())
556+
}
557+
543558
var unmarshaled []json.RawMessage
544559

545560
if err := json.Unmarshal(value, &unmarshaled); err != nil {

internal/utils/security.go

Lines changed: 83 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,16 @@ const (
1616
)
1717

1818
type securityTag struct {
19-
Option bool
20-
Scheme bool
21-
Name string
22-
Type string
23-
SubType string
24-
Env string
19+
Option bool
20+
Scheme bool
21+
Composite bool
22+
Name string
23+
Type string
24+
SubType string
25+
Env string
2526
}
2627

27-
func PopulateSecurity(ctx context.Context, req *http.Request, securitySource func(context.Context) (interface{}, error)) error {
28+
func PopulateSecurity(ctx context.Context, req *http.Request, securitySource func(context.Context) (interface{}, error), allowedFields ...string) error {
2829
if securitySource == nil {
2930
return nil
3031
}
@@ -49,34 +50,7 @@ func PopulateSecurity(ctx context.Context, req *http.Request, securitySource fun
4950
securityValType = securityValType.Elem()
5051
}
5152

52-
for i := 0; i < securityStructType.NumField(); i++ {
53-
fieldType := securityStructType.Field(i)
54-
valType := securityValType.Field(i)
55-
56-
kind := valType.Kind()
57-
58-
if isNil(fieldType.Type, valType) {
59-
continue
60-
}
61-
62-
if fieldType.Type.Kind() == reflect.Pointer {
63-
kind = valType.Elem().Kind()
64-
}
65-
66-
secTag := parseSecurityTag(fieldType)
67-
if secTag != nil {
68-
if secTag.Option {
69-
handleSecurityOption(headers, queryParams, valType.Interface())
70-
} else if secTag.Scheme {
71-
// Special case for basic auth which could be a flattened struct
72-
if secTag.SubType == "basic" && kind != reflect.Struct {
73-
parseSecurityScheme(headers, queryParams, secTag, security)
74-
} else {
75-
parseSecurityScheme(headers, queryParams, secTag, valType.Interface())
76-
}
77-
}
78-
}
79-
}
53+
populateSecurityFields(headers, queryParams, securityStructType, securityValType, security, allowedFields)
8054

8155
for key, value := range headers {
8256
req.Header.Add(key, value)
@@ -91,6 +65,61 @@ func PopulateSecurity(ctx context.Context, req *http.Request, securitySource fun
9165
return nil
9266
}
9367

68+
func populateSecurityFields(headers, queryParams map[string]string, securityStructType reflect.Type, securityValType reflect.Value, security interface{}, allowedFields []string) {
69+
type fieldPair struct {
70+
fieldType reflect.StructField
71+
valType reflect.Value
72+
}
73+
74+
var fields []fieldPair
75+
if len(allowedFields) > 0 {
76+
for _, name := range allowedFields {
77+
ft, ok := securityStructType.FieldByName(name)
78+
if !ok {
79+
continue
80+
}
81+
fields = append(fields, fieldPair{ft, securityValType.FieldByName(name)})
82+
}
83+
} else {
84+
for i := 0; i < securityStructType.NumField(); i++ {
85+
fields = append(fields, fieldPair{securityStructType.Field(i), securityValType.Field(i)})
86+
}
87+
}
88+
89+
for _, f := range fields {
90+
kind := f.valType.Kind()
91+
92+
if isNil(f.fieldType.Type, f.valType) {
93+
continue
94+
}
95+
96+
if f.fieldType.Type.Kind() == reflect.Pointer {
97+
kind = f.valType.Elem().Kind()
98+
}
99+
100+
secTag := parseSecurityTag(f.fieldType)
101+
if secTag == nil {
102+
continue
103+
}
104+
105+
if secTag.Option {
106+
handleSecurityOption(headers, queryParams, f.valType.Interface())
107+
return
108+
} else if secTag.Scheme {
109+
// Special case for basic auth which could be a flattened struct
110+
if secTag.SubType == "basic" && kind != reflect.Struct {
111+
parseSecurityScheme(headers, queryParams, secTag, security)
112+
} else {
113+
parseSecurityScheme(headers, queryParams, secTag, f.valType.Interface())
114+
}
115+
116+
if !secTag.Composite {
117+
return
118+
}
119+
}
120+
}
121+
}
122+
94123
func PopulateSecurityFromEnv(security interface{}) bool {
95124
securityValType := trueReflectValue(reflect.ValueOf(security))
96125
securityStructType := securityValType.Type()
@@ -194,9 +223,16 @@ func handleSecurityOption(headers, queryParams map[string]string, option interfa
194223
valType := optionValType.Field(i)
195224

196225
secTag := parseSecurityTag(fieldType)
197-
if secTag != nil && secTag.Scheme {
198-
parseSecurityScheme(headers, queryParams, secTag, valType.Interface())
226+
if secTag == nil || !secTag.Scheme {
227+
continue
228+
}
229+
230+
if secTag.Type == "http" && secTag.SubType == "basic" && valType.Kind() != reflect.Struct {
231+
handleBasicAuthScheme(headers, optionValType.Interface())
232+
return
199233
}
234+
235+
parseSecurityScheme(headers, queryParams, secTag, valType.Interface())
200236
}
201237
}
202238

@@ -323,6 +359,7 @@ func parseSecurityTag(field reflect.StructField) *securityTag {
323359

324360
option := false
325361
scheme := false
362+
composite := false
326363
name := ""
327364
securityType := ""
328365
securitySubType := ""
@@ -346,20 +383,21 @@ func parseSecurityTag(field reflect.StructField) *securityTag {
346383
option = true
347384
case "scheme":
348385
scheme = true
386+
case "composite":
387+
composite = true
349388
case "env":
350389
env = parts[1]
351390
}
352391
}
353392

354-
// TODO: validate tag?
355-
356393
return &securityTag{
357-
Option: option,
358-
Scheme: scheme,
359-
Name: name,
360-
Type: securityType,
361-
SubType: securitySubType,
362-
Env: env,
394+
Option: option,
395+
Scheme: scheme,
396+
Composite: composite,
397+
Name: name,
398+
Type: securityType,
399+
SubType: securitySubType,
400+
Env: env,
363401
}
364402
}
365403

0 commit comments

Comments
 (0)