Skip to content

Commit

Permalink
Merge pull request #2 from speakeasy-sdks/speakeasy-sdk-regen-1698870875
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 8595828 + d8f1fee commit d218db6
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 18 deletions.
35 changes: 35 additions & 0 deletions .devcontainer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

<div align="center">
<a href="https://codespaces.new/speakeasy-sdks/template-speakeasy-bar.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

The default location for usage snippets is the `samples` directory.

## Running a Usage Sample

A sample usage example has been provided in a `root.go` file. As you work with the SDK, it's expected that you will modify these samples to fit your needs. To execute this particular snippet, use the command below.

```
go run root.go
```

## Generating Additional Usage Samples

The speakeasy CLI allows you to generate more usage snippets. Here's how:

- To generate a sample for a specific operation by providing an operation ID, use:

```
speakeasy generate usage -s ./openapi.yaml -l go -i {INPUT_OPERATION_ID} -o ./samples
```

- To generate samples for an entire namespace (like a tag or group name), use:

```
speakeasy generate usage -s ./openapi.yaml -l go -n {INPUT_TAG_NAME} -o ./samples
```
59 changes: 59 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/go
{
"name": "Go",
"image": "mcr.microsoft.com/devcontainers/go:1-1.20-bullseye",
// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "sudo chmod +x ./.devcontainer/setup.sh && ./.devcontainer/setup.sh",
"customizations": {
"vscode": {
"extensions": [
"golang.go",
"github.vscode-pull-request-github" // Github interaction
],
"settings": {
"files.eol": "\n",
"editor.formatOnSave": true,
"go.buildTags": "",
"go.toolsEnvVars": {
"CGO_ENABLED": "0"
},
"go.useLanguageServer": true,
"go.testEnvVars": {
"CGO_ENABLED": "1"
},
"go.testFlags": [
"-v",
"-race"
],
"go.testTimeout": "60s",
"go.coverOnSingleTest": true,
"go.coverOnSingleTestFile": true,
"go.coverOnTestPackage": true,
"go.lintTool": "golangci-lint",
"go.lintOnSave": "package",
"[go]": {
"editor.codeActionsOnSave": {
"source.organizeImports": true
}
},
"gopls": {
"usePlaceholders": false,
"staticcheck": true,
"vulncheck": "Imports"
}
}
},
"codespaces": {
"openFiles": [
".devcontainer/README.md"
]
}
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
15 changes: 15 additions & 0 deletions .devcontainer/setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash

# Install the speakeasy CLI
curl -fsSL https://raw.githubusercontent.com/speakeasy-api/speakeasy/main/install.sh | sh

# Setup samples directory
rmdir samples || true
mkdir samples

# Go module commands
go mod download
go mod tidy

# Generate starter usage sample with speakeasy
speakeasy generate usage -s ./openapi.yaml -l go -o samples/root.go
24 changes: 14 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ It has been generated successfully based on your OpenAPI spec. However, it is no
- [ ] 🎁 Publish your SDK to package managers by [configuring automatic publishing](https://www.speakeasyapi.dev/docs/productionize-sdks/publish-sdks)
- [ ] ✨ When ready to productionize, delete this section from the README
<!-- Start SDK Installation -->
# SDK Installation
## SDK Installation

```bash
go get github.com/speakeasy-sdks/template-speakeasy-bar
Expand All @@ -23,8 +23,6 @@ go get github.com/speakeasy-sdks/template-speakeasy-bar

## SDK Example Usage
<!-- Start SDK Example Usage -->


```go
package main

Expand Down Expand Up @@ -57,35 +55,41 @@ func main() {
<!-- End SDK Example Usage -->

<!-- Start SDK Available Operations -->
# Available Resources and Operations
## Available Resources and Operations


## [.Authentication](docs/sdks/authentication/README.md)
### [.Authentication](docs/sdks/authentication/README.md)

* [Authenticate](docs/sdks/authentication/README.md#authenticate) - Authenticate with the API by providing a username and password.

## [.Config](docs/sdks/config/README.md)
### [.Config](docs/sdks/config/README.md)

* [SubscribeToWebhooks](docs/sdks/config/README.md#subscribetowebhooks) - Subscribe to webhooks.

## [.Drinks](docs/sdks/drinks/README.md)
### [.Drinks](docs/sdks/drinks/README.md)

* [GetDrink](docs/sdks/drinks/README.md#getdrink) - Get a drink.
* [ListDrinks](docs/sdks/drinks/README.md#listdrinks) - Get a list of drinks.

## [.Ingredients](docs/sdks/ingredients/README.md)
### [.Ingredients](docs/sdks/ingredients/README.md)

* [ListIngredients](docs/sdks/ingredients/README.md#listingredients) - Get a list of ingredients.

## [.Orders](docs/sdks/orders/README.md)
### [.Orders](docs/sdks/orders/README.md)

* [CreateOrder](docs/sdks/orders/README.md#createorder) - Create an order.
<!-- End SDK Available Operations -->

<!-- Start Dev Containers -->
# Dev Containers
<div align="left">
<a href="https://codespaces.new/speakeasy-sdks/template-speakeasy-bar.git/tree/main"><img src="https://github.com/codespaces/badge.svg" /></a>

</div>

Experience our SDK in an enhanced sandbox environment. Try it now in **GitHub Codespaces**!


* [Explore Dev Containers](.devcontainer/README.md)
<!-- End Dev Containers -->

<!-- Start Error Handling -->
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,14 @@ Based on:
### Generated
- [go v0.1.0] .
### Releases
- [Go v0.1.0] https://github.com/speakeasy-sdks/template-speakeasy-bar/releases/tag/v0.1.0 - .
- [Go v0.1.0] https://github.com/speakeasy-sdks/template-speakeasy-bar/releases/tag/v0.1.0 - .

## 2023-11-01 20:34:33
### 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.2.0] .
### Releases
- [Go v0.2.0] https://github.com/speakeasy-sdks/template-speakeasy-bar/releases/tag/v0.2.0 - .
5 changes: 4 additions & 1 deletion files.gen
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,7 @@ docs/sdks/config/README.md
docs/sdks/drinks/README.md
docs/sdks/ingredients/README.md
docs/sdks/orders/README.md
.gitattributes
.gitattributes
.devcontainer/README.md
.devcontainer/devcontainer.json
.devcontainer/setup.sh
9 changes: 5 additions & 4 deletions gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@ generation:
disableComments: false
omitDescriptionIfSummaryPresent: false
baseServerURL: ""
devContainers:
enabled: true
schemaPath: ./openapi.yaml
repoURL: https://github.com/speakeasy-sdks/template-speakeasy-bar.git
sdkClassName: SpeakeasyBar
singleTagPerOp: false
tagNamespacingDisabled: false
telemetryEnabled: false
devContainers:
enabled: true
schemaPath: ./openapi.yaml
features:
go:
core: 3.0.1
devContainers: 2.90.0
errors: 2.81.7
examples: 2.81.3
flattening: 2.81.1
Expand All @@ -28,7 +29,7 @@ features:
inputOutputModels: 2.81.1
serverIDs: 2.81.1
go:
version: 0.1.0
version: 0.2.0
clientServerStatusCodesAsErrors: true
description: Go Client SDK Generated by Speakeasy
flattenGlobalSecurity: true
Expand Down
4 changes: 2 additions & 2 deletions speakeasybar.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,9 +219,9 @@ func New(opts ...SDKOption) *SpeakeasyBar {
sdkConfiguration: sdkConfiguration{
Language: "go",
OpenAPIDocVersion: "1.0.0",
SDKVersion: "0.1.0",
SDKVersion: "0.2.0",
GenVersion: "2.175.0",
UserAgent: "speakeasy-sdk/go 0.1.0 2.175.0 1.0.0 github.com/speakeasy-sdks/template-speakeasy-bar",
UserAgent: "speakeasy-sdk/go 0.2.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 d218db6

Please sign in to comment.