Skip to content

Commit

Permalink
Merge pull request #5 from speakeasy-sdks/speakeasy-sdk-regen-1698874839
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 bbd0946 + 552e5f6 commit 0ecb828
Show file tree
Hide file tree
Showing 36 changed files with 177 additions and 167 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ func main() {
log.Fatal(err)
}

if res.Classes != nil {
if res.Drinks != nil {
// handle response
}
}
Expand All @@ -96,24 +96,24 @@ func main() {
## 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 -->
Expand Down Expand Up @@ -215,7 +215,7 @@ func main() {
log.Fatal(err)
}

if res.Object != nil {
if res.Authenticate200ApplicationJSONObject != nil {
// handle response
}
}
Expand Down Expand Up @@ -251,7 +251,7 @@ func main() {
log.Fatal(err)
}

if res.Object != nil {
if res.Authenticate200ApplicationJSONObject != nil {
// handle response
}
}
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,14 @@ Based on:
### Generated
- [go v0.4.0] .
### Releases
- [Go v0.4.0] https://github.com/speakeasy-sdks/template-speakeasy-bar/releases/tag/v0.4.0 - .
- [Go v0.4.0] https://github.com/speakeasy-sdks/template-speakeasy-bar/releases/tag/v0.4.0 - .

## 2023-11-01 21:40:37
### Changes
Based on:
- OpenAPI Doc 1.0.0
- Speakeasy CLI 1.109.2 (2.173.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [go v0.5.0] .
### Releases
- [Go v0.5.0] https://github.com/speakeasy-sdks/template-speakeasy-bar/releases/tag/v0.5.0 - .
2 changes: 1 addition & 1 deletion USAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ func main() {
log.Fatal(err)
}

if res.Classes != nil {
if res.Drinks != nil {
// handle response
}
}
Expand Down
14 changes: 7 additions & 7 deletions authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ import (
"strings"
)

// Authentication - The authentication endpoints.
type Authentication struct {
// The authentication endpoints.
type authentication struct {
sdkConfiguration sdkConfiguration
}

func newAuthentication(sdkConfig sdkConfiguration) *Authentication {
return &Authentication{
func newAuthentication(sdkConfig sdkConfiguration) *authentication {
return &authentication{
sdkConfiguration: sdkConfig,
}
}

// Authenticate with the API by providing a username and password.
func (s *Authentication) Authenticate(ctx context.Context, request operations.AuthenticateRequestBody) (*operations.AuthenticateResponse, error) {
func (s *authentication) Authenticate(ctx context.Context, request operations.AuthenticateRequestBody) (*operations.AuthenticateResponse, error) {
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
url := strings.TrimSuffix(baseURL, "/") + "/authenticate"

Expand Down Expand Up @@ -76,12 +76,12 @@ func (s *Authentication) Authenticate(ctx context.Context, request operations.Au
case httpRes.StatusCode == 200:
switch {
case utils.MatchContentType(contentType, `application/json`):
var out operations.AuthenticateResponseBody
var out operations.Authenticate200ApplicationJSON
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
return nil, err
}

res.Object = &out
res.Authenticate200ApplicationJSONObject = &out
default:
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes)
}
Expand Down
8 changes: 4 additions & 4 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ import (
"strings"
)

type Config struct {
type config struct {
sdkConfiguration sdkConfiguration
}

func newConfig(sdkConfig sdkConfiguration) *Config {
return &Config{
func newConfig(sdkConfig sdkConfiguration) *config {
return &config{
sdkConfiguration: sdkConfig,
}
}

// SubscribeToWebhooks - Subscribe to webhooks.
// Subscribe to webhooks.
func (s *Config) SubscribeToWebhooks(ctx context.Context, request []operations.RequestBody) (*operations.SubscribeToWebhooksResponse, error) {
func (s *config) SubscribeToWebhooks(ctx context.Context, request []operations.SubscribeToWebhooksRequestBody) (*operations.SubscribeToWebhooksResponse, error) {
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
url := strings.TrimSuffix(baseURL, "/") + "/webhooks/subscribe"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# CreateOrderOrderUpdateRequestBody
# CreateOrderOrderUpdateRequestBodyInput


## Fields
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# AuthenticateResponseBody
# Authenticate200ApplicationJSON

The api key to use for authenticated endpoints.

Expand Down
14 changes: 7 additions & 7 deletions docs/models/operations/authenticateresponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@

## Fields

| Field | Type | Required | Description |
| -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | An unknown error occurred interacting with the API. |
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing |
| `Object` | [*AuthenticateResponseBody](../../models/operations/authenticateresponsebody.md) | :heavy_minus_sign: | The api key to use for authenticated endpoints. |
| Field | Type | Required | Description |
| -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | An unknown error occurred interacting with the API. |
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing |
| `Authenticate200ApplicationJSONObject` | [*Authenticate200ApplicationJSON](../../models/operations/authenticate200applicationjson.md) | :heavy_minus_sign: | The api key to use for authenticated endpoints. |
4 changes: 2 additions & 2 deletions docs/models/operations/listdrinksresponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| Field | Type | Required | Description |
| ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------- |
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
| `Drinks` | [][shared.Drink](../../models/shared/drink.md) | :heavy_minus_sign: | A list of drinks. |
| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | An unknown error occurred interacting with the API. |
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing |
| `Classes` | [][shared.Drink](../../models/shared/drink.md) | :heavy_minus_sign: | A list of drinks. |
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing |
4 changes: 2 additions & 2 deletions docs/models/operations/listingredientsresponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
| `ContentType` | *string* | :heavy_check_mark: | HTTP response content type for this operation |
| `Error` | [*shared.Error](../../models/shared/error.md) | :heavy_minus_sign: | An unknown error occurred interacting with the API. |
| `Ingredients` | [][shared.Ingredient](../../models/shared/ingredient.md) | :heavy_minus_sign: | A list of ingredients. |
| `StatusCode` | *int* | :heavy_check_mark: | HTTP response status code for this operation |
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing |
| `Classes` | [][shared.Ingredient](../../models/shared/ingredient.md) | :heavy_minus_sign: | A list of ingredients. |
| `RawResponse` | [*http.Response](https://pkg.go.dev/net/http#Response) | :heavy_minus_sign: | Raw HTTP response; suitable for custom response parsing |
9 changes: 0 additions & 9 deletions docs/models/operations/requestbody.md

This file was deleted.

9 changes: 9 additions & 0 deletions docs/models/operations/subscribetowebhooksrequestbody.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SubscribeToWebhooksRequestBody


## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------- |
| `URL` | **string* | :heavy_minus_sign: | N/A |
| `Webhook` | [*SubscribeToWebhooksRequestBodyWebhook](../../models/operations/subscribetowebhooksrequestbodywebhook.md) | :heavy_minus_sign: | N/A |
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# SubscribeToWebhooksRequestBodyWebhook


## Values

| Name | Value |
| -------------------------------------------------- | -------------------------------------------------- |
| `SubscribeToWebhooksRequestBodyWebhookStockUpdate` | stockUpdate |
8 changes: 0 additions & 8 deletions docs/models/operations/webhook.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/models/shared/order.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ An order for a drink or ingredient.
| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
| `ProductCode` | *string* | :heavy_check_mark: | The product code of the drink or ingredient. | AC-A2DF3 |
| `Quantity` | *int64* | :heavy_check_mark: | The number of units of the drink or ingredient to order. | |
| `Status` | [Status](../../models/shared/status.md) | :heavy_check_mark: | The status of the order. | |
| `Status` | [OrderStatus](../../models/shared/orderstatus.md) | :heavy_check_mark: | The status of the order. | |
| `Type` | [OrderType](../../models/shared/ordertype.md) | :heavy_check_mark: | The type of order. | |
12 changes: 12 additions & 0 deletions docs/models/shared/orderstatus.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# OrderStatus

The status of the order.


## Values

| Name | Value |
| ----------------------- | ----------------------- |
| `OrderStatusPending` | pending |
| `OrderStatusProcessing` | processing |
| `OrderStatusComplete` | complete |
12 changes: 0 additions & 12 deletions docs/models/shared/status.md

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# StockUpdateRequestBody
# StockUpdateRequestBodyInput


## Fields
Expand Down
Loading

0 comments on commit 0ecb828

Please sign in to comment.