Skip to content

Commit

Permalink
Merge pull request #4 from speakeasy-sdks/speakeasy-sdk-regen-1698872191
Browse files Browse the repository at this point in the history
chore: speakeasy sdk regeneration - Generate
  • Loading branch information
ryan-timothy-albert authored Nov 1, 2023
2 parents fa69df4 + 394e354 commit 4bcd2d6
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 20 deletions.
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,14 @@ Based on:
### Generated
- [go v0.3.0] .
### Releases
- [Go v0.3.0] https://github.com/speakeasy-sdks/template-speakeasy-bar/releases/tag/v0.3.0 - .
- [Go v0.3.0] https://github.com/speakeasy-sdks/template-speakeasy-bar/releases/tag/v0.3.0 - .

## 2023-11-01 20:56:29
### Changes
Based on:
- OpenAPI Doc 1.0.0
- Speakeasy CLI 1.110.0 (2.175.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.4.0] .
### Releases
- [Go v0.4.0] https://github.com/speakeasy-sdks/template-speakeasy-bar/releases/tag/v0.4.0 - .
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SpeakeasyBar SDK
# Speakeasy SDK


## Overview
Expand Down
4 changes: 2 additions & 2 deletions files.gen
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ config.go
drinks.go
ingredients.go
orders.go
speakeasybar.go
speakeasy.go
go.mod
go.sum
pkg/models/sdkerrors/sdkerror.go
Expand Down Expand Up @@ -72,7 +72,7 @@ docs/models/callbacks/createorderorderupdateresponse.md
docs/models/callbacks/createorderorderupdaterequestbody.md
docs/models/webhooks/stockupdateresponse.md
docs/models/webhooks/stockupdaterequestbody.md
docs/sdks/speakeasybar/README.md
docs/sdks/speakeasy/README.md
docs/sdks/authentication/README.md
docs/sdks/config/README.md
docs/sdks/drinks/README.md
Expand Down
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ features:
inputOutputModels: 2.81.1
serverIDs: 2.81.1
go:
version: 0.3.0
version: 0.4.0
clientServerStatusCodesAsErrors: true
flattenGlobalSecurity: true
installationURL: https://github.com/speakeasy-sdks/template-speakeasy-bar
Expand Down
30 changes: 15 additions & 15 deletions speakeasybar.go → speakeasy.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ func (c *sdkConfiguration) GetServerDetails() (string, map[string]string) {
return ServerList[c.Server], c.ServerDefaults[c.Server]
}

// SpeakeasyBar - The Speakeasy Bar: A bar that serves drinks.
// The Speakeasy Bar: A bar that serves drinks.
// A secret underground bar that serves drinks to those in the know.
//
// https://docs.speakeasy.bar - The Speakeasy Bar Documentation.
type SpeakeasyBar struct {
type Speakeasy struct {
// The authentication endpoints.
Authentication *Authentication
Config *Config
Expand All @@ -96,18 +96,18 @@ type SpeakeasyBar struct {
sdkConfiguration sdkConfiguration
}

type SDKOption func(*SpeakeasyBar)
type SDKOption func(*Speakeasy)

// WithServerURL allows the overriding of the default server URL
func WithServerURL(serverURL string) SDKOption {
return func(sdk *SpeakeasyBar) {
return func(sdk *Speakeasy) {
sdk.sdkConfiguration.ServerURL = serverURL
}
}

// WithTemplatedServerURL allows the overriding of the default server URL with a templated URL populated with the provided parameters
func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOption {
return func(sdk *SpeakeasyBar) {
return func(sdk *Speakeasy) {
if params != nil {
serverURL = utils.ReplaceParameters(serverURL, params)
}
Expand All @@ -118,7 +118,7 @@ func WithTemplatedServerURL(serverURL string, params map[string]string) SDKOptio

// WithServer allows the overriding of the default server by name
func WithServer(server string) SDKOption {
return func(sdk *SpeakeasyBar) {
return func(sdk *Speakeasy) {
_, ok := ServerList[server]
if !ok {
panic(fmt.Errorf("server %s not found", server))
Expand Down Expand Up @@ -161,7 +161,7 @@ func (e *ServerEnvironment) UnmarshalJSON(data []byte) error {

// WithEnvironment allows setting the environment variable for url substitution
func WithEnvironment(environment ServerEnvironment) SDKOption {
return func(sdk *SpeakeasyBar) {
return func(sdk *Speakeasy) {
for server := range sdk.sdkConfiguration.ServerDefaults {
if _, ok := sdk.sdkConfiguration.ServerDefaults[server]["environment"]; !ok {
continue
Expand All @@ -174,7 +174,7 @@ func WithEnvironment(environment ServerEnvironment) SDKOption {

// WithOrganization allows setting the organization variable for url substitution
func WithOrganization(organization string) SDKOption {
return func(sdk *SpeakeasyBar) {
return func(sdk *Speakeasy) {
for server := range sdk.sdkConfiguration.ServerDefaults {
if _, ok := sdk.sdkConfiguration.ServerDefaults[server]["organization"]; !ok {
continue
Expand All @@ -187,7 +187,7 @@ func WithOrganization(organization string) SDKOption {

// WithClient allows the overriding of the default HTTP client used by the SDK
func WithClient(client HTTPClient) SDKOption {
return func(sdk *SpeakeasyBar) {
return func(sdk *Speakeasy) {
sdk.sdkConfiguration.DefaultClient = client
}
}
Expand All @@ -201,27 +201,27 @@ func withSecurity(security interface{}) func(context.Context) (interface{}, erro
// WithSecurity configures the SDK to use the provided security details

func WithSecurity(apiKey string) SDKOption {
return func(sdk *SpeakeasyBar) {
return func(sdk *Speakeasy) {
security := shared.Security{APIKey: apiKey}
sdk.sdkConfiguration.Security = withSecurity(&security)
}
}

func WithRetryConfig(retryConfig utils.RetryConfig) SDKOption {
return func(sdk *SpeakeasyBar) {
return func(sdk *Speakeasy) {
sdk.sdkConfiguration.RetryConfig = &retryConfig
}
}

// New creates a new instance of the SDK with the provided options
func New(opts ...SDKOption) *SpeakeasyBar {
sdk := &SpeakeasyBar{
func New(opts ...SDKOption) *Speakeasy {
sdk := &Speakeasy{
sdkConfiguration: sdkConfiguration{
Language: "go",
OpenAPIDocVersion: "1.0.0",
SDKVersion: "0.3.0",
SDKVersion: "0.4.0",
GenVersion: "2.175.0",
UserAgent: "speakeasy-sdk/go 0.3.0 2.175.0 1.0.0 github.com/speakeasy-sdks/template-speakeasy-bar",
UserAgent: "speakeasy-sdk/go 0.4.0 2.175.0 1.0.0 github.com/speakeasy-sdks/template-speakeasy-bar",
ServerDefaults: map[string]map[string]string{
"prod": {},
"staging": {},
Expand Down

0 comments on commit 4bcd2d6

Please sign in to comment.