Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@

<div align="center">
<a href="https://codespaces.new/QuePlatform/GoSDK.git/tree/main"><img src="https://github.com/codespaces/badge.svg" /></a>
</div>
<br>

> **Remember to shutdown a GitHub Codespace when it is not in use!**
# Dev Containers Quick Start
Expand Down
21 changes: 11 additions & 10 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,28 +3,30 @@ id: ddf9e346-bb43-4ccc-aaae-95e233eb6f3f
management:
docChecksum: 5be1033d3fcd17c8b64f613200c1ef01
docVersion: 1.0.0
speakeasyVersion: 1.621.1
generationVersion: 2.708.2
releaseVersion: 0.0.2
configChecksum: 0f69a66bb8df56df0a1727293f910ef9
speakeasyVersion: 1.666.0
generationVersion: 2.768.0
releaseVersion: 0.1.0
configChecksum: 271dbc53435475190d667d13b3793ca3
repoURL: https://github.com/QuePlatform/GoSDK.git
installationURL: https://github.com/QuePlatform/GoSDK
features:
go:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.12
core: 3.11.0
core: 3.13.5
defaultEnabledRetries: 0.2.0
devContainers: 2.90.0
envVarSecurityUsage: 0.3.2
globalSecurity: 2.82.12
globalSecurityCallbacks: 0.1.0
globalSecurityFlattening: 0.1.0
globalServerURLs: 2.82.3
globalServerURLs: 2.83.0
intellisenseMarkdownSupport: 0.1.0
nullables: 0.2.0
nullables: 0.2.1
responseFormat: 0.1.2
retries: 2.84.2
sdkHooks: 0.2.0
unions: 2.85.14
sdkHooks: 0.3.0
unions: 2.87.2
generatedFiles:
- .devcontainer/README.md
- .devcontainer/devcontainer.json
Expand Down Expand Up @@ -122,7 +124,6 @@ generatedFiles:
- types/bigint.go
- types/date.go
- types/datetime.go
- types/decimal.go
- types/pointers.go
- utility.go
examples:
Expand Down
9 changes: 8 additions & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,15 @@ generation:
hoistGlobalSecurity: true
inferSSEOverload: true
sdkHooksConfigAccess: true
schemas:
allOfMergeStrategy: shallowMerge
requestBodyFieldName: ""
tests:
generateTests: false
generateNewTests: true
skipResponseBodyAssertions: false
go:
version: 0.0.2
version: 0.1.0
additionalDependencies: {}
baseErrorName: QueError
clientServerStatusCodesAsErrors: true
Expand All @@ -42,12 +45,16 @@ go:
operations: models/operations
shared: models/components
webhooks: models/webhooks
includeEmptyObjects: false
inferUnionDiscriminators: false
inputModelSuffix: input
maxMethodParams: 4
methodArguments: require-security-and-request
modulePath: github.com/QuePlatform/GoSDK
multipartArrayFormat: legacy
nullableOptionalWrapper: true
outputModelSuffix: output
respectRequiredFields: false
responseFormat: envelope-http
sdkPackageName: Que
unionStrategy: left-to-right
13 changes: 7 additions & 6 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
speakeasyVersion: 1.621.1
speakeasyVersion: 1.666.0
sources:
Que API:
sourceNamespace: que-api
sourceRevisionDigest: sha256:80df4c9999cdc7c286e30ee79425ec574be16294d3b8b890ffba773dce254dc8
sourceBlobDigest: sha256:022738a40948c2fe68b0f5fa760cf5197b333d62458755a7aefcdbb8b02030e3
sourceRevisionDigest: sha256:1d1dac444fb41dee5adefa3de97825285c766cfe0fc1c668895da3d1a71aeac2
sourceBlobDigest: sha256:140578c495d7673e904df7fc110e6485e2382635f23ed86315ddfffdcac9dc7c
tags:
- latest
- speakeasy-sdk-regen-1759801402
- 1.0.0
targets:
que:
source: Que API
sourceNamespace: que-api
sourceRevisionDigest: sha256:80df4c9999cdc7c286e30ee79425ec574be16294d3b8b890ffba773dce254dc8
sourceBlobDigest: sha256:022738a40948c2fe68b0f5fa760cf5197b333d62458755a7aefcdbb8b02030e3
sourceRevisionDigest: sha256:1d1dac444fb41dee5adefa3de97825285c766cfe0fc1c668895da3d1a71aeac2
sourceBlobDigest: sha256:140578c495d7673e904df7fc110e6485e2382635f23ed86315ddfffdcac9dc7c
codeSamplesNamespace: que-api-go-code-samples
codeSamplesRevisionDigest: sha256:f9ee0897034fac1730add87060d92762041043f0d4943dab3ce5d2d2cefd1dff
codeSamplesRevisionDigest: sha256:2b57aad98d03ba4da44a8a7bd4a0f76784cce9dc51e7595793f0f418a246d318
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ func main() {
ctx := context.Background()

s := que.New(
que.WithEnvironment("<value>"),
que.WithServerIndex(0),
que.WithEnvironment("dev-api"),
que.WithSecurity(os.Getenv("QUE_API_KEY_AUTH")),
)

Expand Down
11 changes: 11 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@


## 2025-12-02 01:55:48
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.666.0 (2.768.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.1.0] .
### Releases
- [Go v0.1.0] https://github.com/QuePlatform/GoSDK/releases/tag/v0.1.0 - .
5 changes: 1 addition & 4 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ module github.com/QuePlatform/GoSDK

go 1.22

require (
github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05
github.com/stretchr/testify v1.11.1
)
require github.com/stretchr/testify v1.11.1

require (
github.com/davecgh/go-spew v1.1.1 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05 h1:S92OBrGuLLZsyM5ybUzgc/mPjIYk2AZqufieooe98uw=
github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05/go.mod h1:M9R1FoZ3y//hwwnJtO51ypFGwm8ZfpxPT/ZLtO1mcgQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
Expand Down
43 changes: 33 additions & 10 deletions internal/utils/form.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,19 @@ import (
"strings"
"time"

"github.com/ericlagergren/decimal"

"github.com/QuePlatform/GoSDK/optionalnullable"
"github.com/QuePlatform/GoSDK/types"
)

func populateForm(paramName string, explode bool, objType reflect.Type, objValue reflect.Value, delimiter string, defaultValue *string, getFieldName func(reflect.StructField) string) url.Values {
func populateForm(paramName string, explode bool, objType reflect.Type, objValue reflect.Value, delimiter string, defaultValue *string, allowEmptyValue map[string]struct{}, getFieldName func(reflect.StructField) string) url.Values {

formValues := url.Values{}

if isNil(objType, objValue) {
if defaultValue != nil {
formValues.Add(paramName, *defaultValue)
} else if _, ok := allowEmptyValue[paramName]; ok {
formValues.Add(paramName, "")
}

return formValues
Expand All @@ -42,8 +42,6 @@ func populateForm(paramName string, explode bool, objType reflect.Type, objValue
formValues.Add(paramName, valToString(objValue.Interface()))
case big.Int:
formValues.Add(paramName, valToString(objValue.Interface()))
case decimal.Big:
formValues.Add(paramName, valToString(objValue.Interface()))
default:
var items []string

Expand All @@ -65,7 +63,13 @@ func populateForm(paramName string, explode bool, objType reflect.Type, objValue
}

if explode {
formValues.Add(fieldName, valToString(valType.Interface()))
if valType.Kind() == reflect.Slice || valType.Kind() == reflect.Array {
for i := 0; i < valType.Len(); i++ {
formValues.Add(fieldName, valToString(valType.Index(i).Interface()))
}
} else {
formValues.Add(fieldName, valToString(valType.Interface()))
}
} else {
items = append(items, fmt.Sprintf("%s%s%s", fieldName, delimiter, valToString(valType.Interface())))
}
Expand Down Expand Up @@ -101,12 +105,31 @@ func populateForm(paramName string, explode bool, objType reflect.Type, objValue
formValues.Add(paramName, strings.Join(items, delimiter))
}
case reflect.Slice, reflect.Array:
values := parseDelimitedArray(explode, objValue, delimiter)
for _, v := range values {
formValues.Add(paramName, v)
if objValue.Len() == 0 {
if _, ok := allowEmptyValue[paramName]; ok {
formValues.Add(paramName, "")
}
} else {
values := parseDelimitedArray(explode, objValue, delimiter)
for _, v := range values {
formValues.Add(paramName, v)
}
}
default:
formValues.Add(paramName, valToString(objValue.Interface()))
// For string types, use the value directly without conversion
if objType.Kind() == reflect.String {
stringValue := objValue.String()
formValues.Add(paramName, stringValue)
} else {
stringValue := valToString(objValue.Interface())
if stringValue == "" {
if _, ok := allowEmptyValue[paramName]; ok {
formValues.Add(paramName, "")
}
} else if stringValue != "" {
formValues.Add(paramName, stringValue)
}
}
}

return formValues
Expand Down
Loading