Skip to content

Commit

Permalink
Merge pull request #25 from ryan-timothy-albert/speakeasy-sdk-regen-1…
Browse files Browse the repository at this point in the history
…718826352

chore: 🐝 Update SDK - Generate All
  • Loading branch information
ryan-timothy-albert authored Jun 19, 2024
2 parents fb71e6d + 105a766 commit 154dc87
Show file tree
Hide file tree
Showing 63 changed files with 926 additions and 569 deletions.
14 changes: 13 additions & 1 deletion .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
speakeasyVersion: 1.293.0
speakeasyVersion: 1.310.0
sources:
petstore:
sourceNamespace: petstore
Expand All @@ -14,6 +14,18 @@ targets:
sourceRevisionDigest: sha256:22dea4fa269cfc90ef29c704b6a25e91601d47b45da74b25f6f8550d09740bf7
sourceBlobDigest: sha256:0988cc3ebcf0b14954c082c37c08f8a965b0ec72781ffd459a9d4e105519f1da
outLocation: go
second-target:
source: petstore
sourceNamespace: petstore
sourceRevisionDigest: sha256:22dea4fa269cfc90ef29c704b6a25e91601d47b45da74b25f6f8550d09740bf7
sourceBlobDigest: sha256:0988cc3ebcf0b14954c082c37c08f8a965b0ec72781ffd459a9d4e105519f1da
outLocation: py
third-target:
source: petstore
sourceNamespace: petstore
sourceRevisionDigest: sha256:22dea4fa269cfc90ef29c704b6a25e91601d47b45da74b25f6f8550d09740bf7
sourceBlobDigest: sha256:0988cc3ebcf0b14954c082c37c08f8a965b0ec72781ffd459a9d4e105519f1da
outLocation: ts
workflow:
workflowVersion: 1.0.0
speakeasyVersion: latest
Expand Down
15 changes: 15 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@


## 2024-06-19 19:45:49
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.310.0 (2.347.4) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.0.7] go
- [python v0.0.9] py
- [typescript v0.1.0] ts
### Releases
- [NPM v0.1.0] https://www.npmjs.com/package/openapi/v/0.1.0 - ts
- [Go v0.0.7] https://github.com/ryan-timothy-albert/multi-sdk-sample/releases/tag/go/v0.0.7 - go
- [PyPI v0.0.9] https://pypi.org/project/openapi/0.0.9 - py
12 changes: 6 additions & 6 deletions go/.speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ id: aa3cba97-ebdd-4d31-b4e4-c95d045e0ba8
management:
docChecksum: 1bdb7a6f8bf3995d4b40475228403253
docVersion: 1.0.0
speakeasyVersion: 1.293.0
generationVersion: 2.332.4
releaseVersion: 0.0.6
configChecksum: 99d3992ca4187d9ee6b95e96cb7d9368
speakeasyVersion: 1.310.0
generationVersion: 2.347.4
releaseVersion: 0.0.7
configChecksum: 2f8dfd14b4051f7456709c345d0a27dd
repoURL: https://github.com/ryan-timothy-albert/multi-sdk-sample.git
repoSubDirectory: go
installationURL: https://github.com/ryan-timothy-albert/multi-sdk-sample/go
features:
go:
additionalDependencies: 0.1.0
core: 3.4.8
core: 3.4.12
flattening: 2.81.1
globalSecurityCallbacks: 0.1.0
globalServerURLs: 2.82.2
intellisenseMarkdownSupport: 0.1.0
responseFormat: 0.1.1
responseFormat: 0.1.2
sdkHooks: 0.1.0
generatedFiles:
- pets.go
Expand Down
3 changes: 2 additions & 1 deletion go/.speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
go:
version: 0.0.6
version: 0.0.7
additionalDependencies: {}
allowUnknownFieldsInWeakUnions: false
clientServerStatusCodesAsErrors: true
flattenGlobalSecurity: true
imports:
Expand Down
8 changes: 0 additions & 8 deletions go/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,7 @@ import (

func main() {
s := openapi.New()

var limit *int = openapi.Int(21453)

ctx := context.Background()
res, err := s.Pets.ListPets(ctx, limit)
if err != nil {
Expand Down Expand Up @@ -90,9 +88,7 @@ import (

func main() {
s := openapi.New()

var limit *int = openapi.Int(21453)

ctx := context.Background()
res, err := s.Pets.ListPets(ctx, limit)
if err != nil {
Expand Down Expand Up @@ -134,9 +130,7 @@ func main() {
s := openapi.New(
openapi.WithServerIndex(0),
)

var limit *int = openapi.Int(21453)

ctx := context.Background()
res, err := s.Pets.ListPets(ctx, limit)
if err != nil {
Expand Down Expand Up @@ -166,9 +160,7 @@ func main() {
s := openapi.New(
openapi.WithServerURL("http://petstore.swagger.io/v1"),
)

var limit *int = openapi.Int(21453)

ctx := context.Background()
res, err := s.Pets.ListPets(ctx, limit)
if err != nil {
Expand Down
2 changes: 0 additions & 2 deletions go/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@ import (

func main() {
s := openapi.New()

var limit *int = openapi.Int(21453)

ctx := context.Background()
res, err := s.Pets.ListPets(ctx, limit)
if err != nil {
Expand Down
6 changes: 0 additions & 6 deletions go/docs/sdks/pets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,7 @@ import(

func main() {
s := openapi.New()

var limit *int = openapi.Int(21453)

ctx := context.Background()
res, err := s.Pets.ListPets(ctx, limit)
if err != nil {
Expand Down Expand Up @@ -71,12 +69,10 @@ import(

func main() {
s := openapi.New()

request := components.Pet{
ID: 596804,
Name: "<value>",
}

ctx := context.Background()
res, err := s.Pets.CreatePets(ctx, request)
if err != nil {
Expand Down Expand Up @@ -120,9 +116,7 @@ import(

func main() {
s := openapi.New()

var petID string = "<value>"

ctx := context.Background()
res, err := s.Pets.ShowPetByID(ctx, petID)
if err != nil {
Expand Down
4 changes: 4 additions & 0 deletions go/internal/utils/contenttype.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ import (
)

func MatchContentType(contentType string, pattern string) bool {
if contentType == "" {
contentType = "application/octet-stream"
}

if contentType == pattern || pattern == "*" || pattern == "*/*" {
return true
}
Expand Down
3 changes: 1 addition & 2 deletions go/internal/utils/headers.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ func PopulateHeaders(_ context.Context, req *http.Request, headers interface{},
}

func populateHeaders(headers interface{}, globals interface{}, reqHeaders http.Header, skipFields []string) []string {
headerParamsStructType := reflect.TypeOf(headers)
headerParamsValType := reflect.ValueOf(headers)
headerParamsStructType, headerParamsValType := dereferencePointers(reflect.TypeOf(headers), reflect.ValueOf(headers))

globalsAlreadyPopulated := []string{}

Expand Down
3 changes: 1 addition & 2 deletions go/internal/utils/pathparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ func GenerateURL(_ context.Context, serverURL, path string, pathParams interface
}

func populateParsedParameters(pathParams interface{}, globals interface{}, parsedParameters map[string]string, skipFields []string) ([]string, error) {
pathParamsStructType := reflect.TypeOf(pathParams)
pathParamsValType := reflect.ValueOf(pathParams)
pathParamsStructType, pathParamsValType := dereferencePointers(reflect.TypeOf(pathParams), reflect.ValueOf(pathParams))

globalsAlreadyPopulated := []string{}

Expand Down
3 changes: 1 addition & 2 deletions go/internal/utils/queryparams.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,7 @@ func PopulateQueryParams(_ context.Context, req *http.Request, queryParams inter
}

func populateQueryParams(queryParams interface{}, globals interface{}, values url.Values, skipFields []string) ([]string, error) {
queryParamsStructType := reflect.TypeOf(queryParams)
queryParamsValType := reflect.ValueOf(queryParams)
queryParamsStructType, queryParamsValType := dereferencePointers(reflect.TypeOf(queryParams), reflect.ValueOf(queryParams))

globalsAlreadyPopulated := []string{}

Expand Down
4 changes: 4 additions & 0 deletions go/internal/utils/security.go
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,10 @@ func handleBasicAuthScheme(headers map[string]string, scheme interface{}) {
fieldType := schemeStructType.Field(i)
valType := schemeValType.Field(i)

if fieldType.Type.Kind() == reflect.Ptr {
valType = valType.Elem()
}

secTag := parseSecurityTag(fieldType)
if secTag == nil || secTag.Name == "" {
continue
Expand Down
7 changes: 7 additions & 0 deletions go/internal/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
package utils

import (
"context"
"fmt"
"io"
"math/big"
Expand Down Expand Up @@ -87,6 +88,12 @@ func MatchStatusCodes(expectedCodes []string, statusCode int) bool {
return false
}

func AsSecuritySource(security interface{}) func(context.Context) (interface{}, error) {
return func(context.Context) (interface{}, error) {
return security, nil
}
}

func parseStructTag(tagKey string, field reflect.StructField) map[string]string {
tag := field.Tag.Get(tagKey)
if tag == "" {
Expand Down
2 changes: 1 addition & 1 deletion go/models/operations/createpets.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
)

type CreatePetsResponse struct {
HTTPMeta components.HTTPMetadata
HTTPMeta components.HTTPMetadata `json:"-"`
// unexpected error
Error *components.Error
}
Expand Down
2 changes: 1 addition & 1 deletion go/models/operations/listpets.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (o *ListPetsRequest) GetLimit() *int {
}

type ListPetsResponse struct {
HTTPMeta components.HTTPMetadata
HTTPMeta components.HTTPMetadata `json:"-"`
// A paged array of pets
Pets []components.Pet
// unexpected error
Expand Down
2 changes: 1 addition & 1 deletion go/models/operations/showpetbyid.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (o *ShowPetByIDRequest) GetPetID() string {
}

type ShowPetByIDResponse struct {
HTTPMeta components.HTTPMetadata
HTTPMeta components.HTTPMetadata `json:"-"`
// Expected response to a valid request
Pet *components.Pet
// unexpected error
Expand Down
3 changes: 3 additions & 0 deletions go/pets.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ func (s *Pets) ListPets(ctx context.Context, limit *int) (*operations.ListPetsRe
}

return res, nil

}

// CreatePets - Create a pet
Expand Down Expand Up @@ -227,6 +228,7 @@ func (s *Pets) CreatePets(ctx context.Context, request components.Pet) (*operati
}

return res, nil

}

// ShowPetByID - Info for a specific pet
Expand Down Expand Up @@ -330,4 +332,5 @@ func (s *Pets) ShowPetByID(ctx context.Context, petID string) (*operations.ShowP
}

return res, nil

}
6 changes: 3 additions & 3 deletions go/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,9 @@ func New(opts ...SDKOption) *SDK {
sdkConfiguration: sdkConfiguration{
Language: "go",
OpenAPIDocVersion: "1.0.0",
SDKVersion: "0.0.6",
GenVersion: "2.332.4",
UserAgent: "speakeasy-sdk/go 0.0.6 2.332.4 1.0.0 openapi",
SDKVersion: "0.0.7",
GenVersion: "2.347.4",
UserAgent: "speakeasy-sdk/go 0.0.7 2.347.4 1.0.0 openapi",
Hooks: hooks.New(),
},
}
Expand Down
11 changes: 6 additions & 5 deletions py/.speakeasy/gen.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@ id: bec1a8ce-6d87-480a-87e4-4d5233eefa3b
management:
docChecksum: 1bdb7a6f8bf3995d4b40475228403253
docVersion: 1.0.0
speakeasyVersion: 1.286.3
generationVersion: 2.329.0
releaseVersion: 0.0.8
configChecksum: 9f69fd665003be48b2c452ce669d6d7b
speakeasyVersion: 1.310.0
generationVersion: 2.347.4
releaseVersion: 0.0.9
configChecksum: 327bc8eaca7e71f36849e86622fcaf39
repoURL: https://github.com/ryan-timothy-albert/multi-sdk-sample.git
repoSubDirectory: py
installationURL: https://github.com/ryan-timothy-albert/multi-sdk-sample.git#subdirectory=py
published: true
features:
python:
additionalDependencies: 0.1.0
core: 4.6.7
core: 4.6.11
flattening: 2.81.1
globalSecurityCallbacks: 0.1.0
globalServerURLs: 2.82.2
Expand All @@ -26,6 +26,7 @@ generatedFiles:
- src/sdk/sdk.py
- py.typed
- pylintrc
- scripts/publish.sh
- setup.py
- src/sdk/__init__.py
- src/sdk/utils/__init__.py
Expand Down
3 changes: 2 additions & 1 deletion py/.speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ generation:
auth:
oAuth2ClientCredentialsEnabled: true
python:
version: 0.0.8
version: 0.0.9
additionalDependencies:
dependencies: {}
extraDependencies:
Expand All @@ -36,3 +36,4 @@ python:
packageName: openapi
projectUrls: {}
responseFormat: envelope-http
templateVersion: v1
4 changes: 4 additions & 0 deletions py/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import sdk

s = sdk.SDK()


res = s.pets.list_pets(limit=21453)

if res.pets is not None:
Expand Down Expand Up @@ -73,6 +74,7 @@ s = sdk.SDK()
res = None
try:
res = s.pets.list_pets(limit=21453)

except errors.SDKError as e:
# handle exception
raise(e)
Expand Down Expand Up @@ -104,6 +106,7 @@ s = sdk.SDK(
server_idx=0,
)


res = s.pets.list_pets(limit=21453)

if res.pets is not None:
Expand All @@ -123,6 +126,7 @@ s = sdk.SDK(
server_url="http://petstore.swagger.io/v1",
)


res = s.pets.list_pets(limit=21453)

if res.pets is not None:
Expand Down
1 change: 1 addition & 0 deletions py/USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import sdk

s = sdk.SDK()


res = s.pets.list_pets(limit=21453)

if res.pets is not None:
Expand Down
Loading

0 comments on commit 154dc87

Please sign in to comment.