Skip to content

Commit

Permalink
ci: regenerated with OpenAPI Doc 0.0.1, Speakeay CLI 1.109.2
Browse files Browse the repository at this point in the history
  • Loading branch information
speakeasybot committed Nov 1, 2023
1 parent c986367 commit d266a28
Show file tree
Hide file tree
Showing 27 changed files with 1,040 additions and 148 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ terraform {
required_providers {
hashicups = {
source = "speakeasy/hashicups"
version = "0.5.1"
version = "0.6.0"
}
}
}
Expand Down
10 changes: 9 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,12 @@ Based on:
- OpenAPI Doc 0.0.1
- Speakeasy CLI 1.96.1 (2.150.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [terraform v0.5.1] .
- [terraform v0.5.1] .

## 2023-11-01 01:08:14
### Changes
Based on:
- OpenAPI Doc 0.0.1
- Speakeasy CLI 1.109.2 (2.173.0) https://github.com/speakeasy-api/speakeasy
### Generated
- [terraform v0.6.0] .
2 changes: 1 addition & 1 deletion examples/provider/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
hashicups = {
source = "speakeasy/hashicups"
version = "0.5.1"
version = "0.6.0"
}
}
}
Expand Down
4 changes: 4 additions & 0 deletions files.gen
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,16 @@ internal/provider/reflect/primitive.go
internal/provider/reflect/slice.go
internal/provider/reflect/struct.go
internal/provider/utils.go
internal/sdk/pkg/models/sdkerrors/sdkerror.go
internal/sdk/pkg/types/bigint.go
internal/sdk/pkg/types/date.go
internal/sdk/pkg/types/datetime.go
internal/sdk/pkg/types/decimal.go
internal/sdk/pkg/types/pointers.go
internal/sdk/pkg/utils/contenttype.go
internal/sdk/pkg/utils/form.go
internal/sdk/pkg/utils/headers.go
internal/sdk/pkg/utils/json.go
internal/sdk/pkg/utils/pathparams.go
internal/sdk/pkg/utils/queryparams.go
internal/sdk/pkg/utils/requestbody.go
Expand Down
12 changes: 7 additions & 5 deletions gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@ configVersion: 1.0.0
management:
docChecksum: 7b193330bf41e2c47ba62aa354c4a561
docVersion: 0.0.1
speakeasyVersion: 1.96.1
generationVersion: 2.150.0
speakeasyVersion: 1.109.2
generationVersion: 2.173.0
generation:
repoURL: https://github.com/speakeasy-sdks/terraform-provider-hashicups.git
sdkClassName: SDK
sdkFlattening: true
singleTagPerOp: false
telemetryEnabled: false
features:
terraform:
core: 2.92.1
core: 2.93.3
globalSecurity: 2.81.1
globalServerURLs: 2.82.0
includes: 2.81.1
terraform:
version: 0.5.1
version: 0.6.0
author: speakeasy
packageName: hashicups
published: true
repoSubDirectory: .
2 changes: 2 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ go 1.18

require (
github.com/cenkalti/backoff/v4 v4.2.0
github.com/ericlagergren/decimal v0.0.0-20221120152707-495c53812d05
github.com/hashicorp/terraform-plugin-framework v1.3.5
github.com/hashicorp/terraform-plugin-go v0.18.0
github.com/spyzhov/ajson v0.9.0
)

require (
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ 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/emirpasic/gods v1.12.0 h1:QAUIPSaCu4G+POclxeqb3F+WPpdKqFGlw36+yOzGlrg=
github.com/emirpasic/gods v1.12.0/go.mod h1:YfzfFFoVP/catgzJb4IKIqXjX78Ha8FMSDh3ymbK86o=
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/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4=
github.com/fatih/color v1.13.0 h1:8LOYc1KYPPmyKMuN8QV2DNRWNbLo6LZ0iLs8+mlH53w=
github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk=
Expand Down Expand Up @@ -169,6 +171,8 @@ github.com/sirupsen/logrus v1.4.1/go.mod h1:ni0Sbl8bgC9z8RoU9G6nDWqqs/fq4eDPysMB
github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE=
github.com/spf13/cast v1.5.0 h1:rj3WzYc11XZaIZMPKmwP96zkFEnnAmV8s6XbB2aY32w=
github.com/spf13/cast v1.5.0/go.mod h1:SpXXQ5YoyJw6s3/6cMTQuxvgRl3PCJiyaX9p6b155UU=
github.com/spyzhov/ajson v0.9.0 h1:tF46gJGOenYVj+k9K1U1XpCxVWhmiyY5PsVCAs1+OJ0=
github.com/spyzhov/ajson v0.9.0/go.mod h1:a6oSw0MMb7Z5aD2tPoPO+jq11ETKgXUr2XktHdT8Wt8=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
Expand Down
23 changes: 14 additions & 9 deletions internal/sdk/order.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"fmt"
"hashicups/internal/sdk/pkg/models/operations"
"hashicups/internal/sdk/pkg/models/sdkerrors"
"hashicups/internal/sdk/pkg/models/shared"
"hashicups/internal/sdk/pkg/utils"
"io"
Expand Down Expand Up @@ -113,12 +114,14 @@ func (s *order) GetOrder(ctx context.Context, request operations.GetOrderRequest
case httpRes.StatusCode == 200:
switch {
case utils.MatchContentType(contentType, `application/json`):
var out *shared.Order
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil {
return res, err
var out shared.Order
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
return nil, err
}

res.Order = out
res.Order = &out
default:
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes)
}
}

Expand All @@ -130,7 +133,7 @@ func (s *order) UpsertOrder(ctx context.Context, request shared.CreateOrderInput
baseURL := utils.ReplaceParameters(s.sdkConfiguration.GetServerDetails())
url := strings.TrimSuffix(baseURL, "/") + "/v1/order"

bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, "Request", "json")
bodyReader, reqContentType, err := utils.SerializeRequestBody(ctx, request, false, false, "Request", "json", `request:"mediaType=application/json"`)
if err != nil {
return nil, fmt.Errorf("error serializing request body: %w", err)
}
Expand Down Expand Up @@ -179,12 +182,14 @@ func (s *order) UpsertOrder(ctx context.Context, request shared.CreateOrderInput
case httpRes.StatusCode == 200:
switch {
case utils.MatchContentType(contentType, `application/json`):
var out *shared.Order
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out); err != nil {
return res, err
var out shared.Order
if err := utils.UnmarshalJsonFromResponseBody(bytes.NewBuffer(rawBody), &out, ""); err != nil {
return nil, err
}

res.Order = out
res.Order = &out
default:
return nil, sdkerrors.NewSDKError(fmt.Sprintf("unknown content-type received: %s", contentType), httpRes.StatusCode, string(rawBody), httpRes)
}
}

Expand Down
28 changes: 28 additions & 0 deletions internal/sdk/pkg/models/operations/deleteorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@ type DeleteOrderRequest struct {
OrderID int64 `pathParam:"style=simple,explode=false,name=orderID"`
}

func (o *DeleteOrderRequest) GetOrderID() int64 {
if o == nil {
return 0
}
return o.OrderID
}

type DeleteOrderResponse struct {
// HTTP response content type for this operation
ContentType string
Expand All @@ -19,3 +26,24 @@ type DeleteOrderResponse struct {
// Raw HTTP response; suitable for custom response parsing
RawResponse *http.Response
}

func (o *DeleteOrderResponse) GetContentType() string {
if o == nil {
return ""
}
return o.ContentType
}

func (o *DeleteOrderResponse) GetStatusCode() int {
if o == nil {
return 0
}
return o.StatusCode
}

func (o *DeleteOrderResponse) GetRawResponse() *http.Response {
if o == nil {
return nil
}
return o.RawResponse
}
35 changes: 35 additions & 0 deletions internal/sdk/pkg/models/operations/getorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ type GetOrderRequest struct {
OrderID int64 `pathParam:"style=simple,explode=false,name=orderID"`
}

func (o *GetOrderRequest) GetOrderID() int64 {
if o == nil {
return 0
}
return o.OrderID
}

type GetOrderResponse struct {
// HTTP response content type for this operation
ContentType string
Expand All @@ -22,3 +29,31 @@ type GetOrderResponse struct {
// Raw HTTP response; suitable for custom response parsing
RawResponse *http.Response
}

func (o *GetOrderResponse) GetContentType() string {
if o == nil {
return ""
}
return o.ContentType
}

func (o *GetOrderResponse) GetOrder() *shared.Order {
if o == nil {
return nil
}
return o.Order
}

func (o *GetOrderResponse) GetStatusCode() int {
if o == nil {
return 0
}
return o.StatusCode
}

func (o *GetOrderResponse) GetRawResponse() *http.Response {
if o == nil {
return nil
}
return o.RawResponse
}
28 changes: 28 additions & 0 deletions internal/sdk/pkg/models/operations/upsertorder.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,31 @@ type UpsertOrderResponse struct {
// Raw HTTP response; suitable for custom response parsing
RawResponse *http.Response
}

func (o *UpsertOrderResponse) GetContentType() string {
if o == nil {
return ""
}
return o.ContentType
}

func (o *UpsertOrderResponse) GetOrder() *shared.Order {
if o == nil {
return nil
}
return o.Order
}

func (o *UpsertOrderResponse) GetStatusCode() int {
if o == nil {
return 0
}
return o.StatusCode
}

func (o *UpsertOrderResponse) GetRawResponse() *http.Response {
if o == nil {
return nil
}
return o.RawResponse
}
35 changes: 35 additions & 0 deletions internal/sdk/pkg/models/sdkerrors/sdkerror.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
// Code generated by Speakeasy (https://speakeasyapi.dev). DO NOT EDIT.

package sdkerrors

import (
"fmt"
"net/http"
)

type SDKError struct {
Message string
StatusCode int
Body string
RawResponse *http.Response
}

var _ error = &SDKError{}

func NewSDKError(message string, statusCode int, body string, httpRes *http.Response) *SDKError {
return &SDKError{
Message: message,
StatusCode: statusCode,
Body: body,
RawResponse: httpRes,
}
}

func (e *SDKError) Error() string {
body := ""
if len(e.Body) > 0 {
body = fmt.Sprintf("\n%s", e.Body)
}

return fmt.Sprintf("%s: Status %d%s", e.Message, e.StatusCode, body)
}
35 changes: 35 additions & 0 deletions internal/sdk/pkg/models/shared/createorderinput.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,38 @@ type CreateOrderInput struct {
// Fun tagline for the coffee.
Teaser string `json:"teaser"`
}

func (o *CreateOrderInput) GetDescription() *string {
if o == nil {
return nil
}
return o.Description
}

func (o *CreateOrderInput) GetImage() string {
if o == nil {
return ""
}
return o.Image
}

func (o *CreateOrderInput) GetName() string {
if o == nil {
return ""
}
return o.Name
}

func (o *CreateOrderInput) GetPrice() float64 {
if o == nil {
return 0.0
}
return o.Price
}

func (o *CreateOrderInput) GetTeaser() string {
if o == nil {
return ""
}
return o.Teaser
}
Loading

0 comments on commit d266a28

Please sign in to comment.