Skip to content

Commit

Permalink
chore: regenerate
Browse files Browse the repository at this point in the history
  • Loading branch information
Hans Weber committed Jan 17, 2024
1 parent c34ca40 commit cdf0e3b
Show file tree
Hide file tree
Showing 16 changed files with 54 additions and 18 deletions.
6 changes: 3 additions & 3 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 5a857039-7f4b-42d5-86fd-449767242ed2
management:
docChecksum: 6037ef09203af9f9491610a411a63353
docChecksum: 2696596b3b897fdb6e6502ca7ba77dcb
docVersion: 1.0.0
speakeasyVersion: internal
generationVersion: 2.231.0
releaseVersion: 0.4.1
configChecksum: 6a68c10a26d34e28604613ae9f6592cc
releaseVersion: 0.4.2
configChecksum: f2fd9dba3ebff05a23a38bdd725b1fb8
features:
go:
additionalProperties: 0.1.1
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ terraform {
required_providers {
epilot-product = {
source = "epilot-dev/epilot-product"
version = "0.4.1"
version = "0.4.2"
}
}
}
Expand Down
5 changes: 5 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,13 @@ terraform {
}
}
variable epilot_auth {
type = string
}
provider "epilot-product" {
# Configuration options
epilot_auth = var.epilot_auth
}
```

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
data "epilot-product_product" "my_product" {
hydrate = false
hydrate = true
id = "123e4567-e89b-12d3-a456-426614174000"
}
7 changes: 1 addition & 6 deletions examples/provider/provider.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@ terraform {
required_providers {
epilot-product = {
source = "epilot-dev/epilot-product"
version = "0.4.1"
version = "0.4.2"
}
}
}

variable epilot_auth {
type = string
}

provider "epilot-product" {
# Configuration options
epilot_auth = var.epilot_auth
}
3 changes: 2 additions & 1 deletion examples/resources/epilot-product_product/resource.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
resource "epilot-product_product" "my_product" {
active = true
code = "...my_code..."
description = "...my_description..."
internal_name = "...my_internal_name..."
name = "Rogelio Brakus"
name = "Juan Morar Jr."
type = "product"
}
4 changes: 2 additions & 2 deletions examples/resources/epilot-product_tax/resource.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
resource "epilot-product_tax" "my_tax" {
active = false
active = true
description = "...my_description..."
rate = "...my_rate..."
region = "DE"
region = "AT"
type = "VAT"
}
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ go:
outputModelSuffix: output
packageName: openapi
terraform:
version: 0.4.1
version: 0.4.2
author: epilot-dev
imports:
option: openapi
Expand Down
4 changes: 4 additions & 0 deletions internal/provider/product_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type ProductDataSourceModel struct {
Tags []types.String `tfsdk:"tags"`
Title types.String `tfsdk:"title"`
UpdatedAt types.String `tfsdk:"updated_at"`
Active types.Bool `tfsdk:"active"`
Code types.String `tfsdk:"code"`
Description types.String `tfsdk:"description"`
Feature []Feature `tfsdk:"feature"`
Expand Down Expand Up @@ -113,6 +114,9 @@ func (r *ProductDataSource) Schema(ctx context.Context, req datasource.SchemaReq
"updated_at": schema.StringAttribute{
Computed: true,
},
"active": schema.BoolAttribute{
Computed: true,
},
"code": schema.StringAttribute{
Computed: true,
Description: `The product code`,
Expand Down
1 change: 1 addition & 0 deletions internal/provider/product_data_source_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func (r *ProductDataSourceModel) RefreshFromSharedProduct(resp *shared.Product)
}
r.Title = types.StringValue(resp.Title)
r.UpdatedAt = types.StringValue(resp.UpdatedAt.Format(time.RFC3339Nano))
r.Active = types.BoolValue(resp.Active)
r.Code = types.StringPointerValue(resp.Code)
r.Description = types.StringPointerValue(resp.Description)
if len(r.Feature) > len(resp.Feature) {
Expand Down
4 changes: 4 additions & 0 deletions internal/provider/product_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ type ProductResourceModel struct {
Tags []types.String `tfsdk:"tags"`
Title types.String `tfsdk:"title"`
UpdatedAt types.String `tfsdk:"updated_at"`
Active types.Bool `tfsdk:"active"`
Code types.String `tfsdk:"code"`
Description types.String `tfsdk:"description"`
Feature []Feature `tfsdk:"feature"`
Expand Down Expand Up @@ -127,6 +128,9 @@ func (r *ProductResource) Schema(ctx context.Context, req resource.SchemaRequest
validators.IsRFC3339(),
},
},
"active": schema.BoolAttribute{
Required: true,
},
"code": schema.StringAttribute{
Computed: true,
Optional: true,
Expand Down
3 changes: 3 additions & 0 deletions internal/provider/product_resource_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
)

func (r *ProductResourceModel) ToSharedProductCreate() *shared.ProductCreate {
active := r.Active.ValueBool()
code := new(string)
if !r.Code.IsUnknown() && !r.Code.IsNull() {
*code = r.Code.ValueString()
Expand Down Expand Up @@ -83,6 +84,7 @@ func (r *ProductResourceModel) ToSharedProductCreate() *shared.ProductCreate {
typeVar = nil
}
out := shared.ProductCreate{
Active: active,
Code: code,
Description: description,
Feature: feature,
Expand Down Expand Up @@ -137,6 +139,7 @@ func (r *ProductResourceModel) RefreshFromSharedProduct(resp *shared.Product) {
}
r.Title = types.StringValue(resp.Title)
r.UpdatedAt = types.StringValue(resp.UpdatedAt.Format(time.RFC3339Nano))
r.Active = types.BoolValue(resp.Active)
r.Code = types.StringPointerValue(resp.Code)
r.Description = types.StringPointerValue(resp.Description)
if len(r.Feature) > len(resp.Feature) {
Expand Down
8 changes: 8 additions & 0 deletions internal/sdk/pkg/models/shared/product.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ type Product struct {
Tags []string `json:"_tags"`
Title string `json:"_title"`
UpdatedAt time.Time `json:"_updated_at"`
Active bool `json:"active"`
// The product code
Code *string `json:"code,omitempty"`
// A description of the product. Multi-line supported.
Expand Down Expand Up @@ -175,6 +176,13 @@ func (o *Product) GetUpdatedAt() time.Time {
return o.UpdatedAt
}

func (o *Product) GetActive() bool {
if o == nil {
return false
}
return o.Active
}

func (o *Product) GetCode() *string {
if o == nil {
return nil
Expand Down
8 changes: 8 additions & 0 deletions internal/sdk/pkg/models/shared/productcreate.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func (e *ProductCreateType) UnmarshalJSON(data []byte) error {
}

type ProductCreate struct {
Active bool `json:"active"`
// The product code
Code *string `json:"code,omitempty"`
// A description of the product. Multi-line supported.
Expand Down Expand Up @@ -100,6 +101,13 @@ func (p *ProductCreate) UnmarshalJSON(data []byte) error {
return nil
}

func (o *ProductCreate) GetActive() bool {
if o == nil {
return false
}
return o.Active
}

func (o *ProductCreate) GetCode() *string {
if o == nil {
return nil
Expand Down
8 changes: 8 additions & 0 deletions internal/sdk/pkg/models/shared/productpatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ func (e *ProductPatchType) UnmarshalJSON(data []byte) error {
}

type ProductPatch struct {
Active *bool `json:"active,omitempty"`
// The product code
Code *string `json:"code,omitempty"`
// A description of the product. Multi-line supported.
Expand Down Expand Up @@ -100,6 +101,13 @@ func (p *ProductPatch) UnmarshalJSON(data []byte) error {
return nil
}

func (o *ProductPatch) GetActive() *bool {
if o == nil {
return nil
}
return o.Active
}

func (o *ProductPatch) GetCode() *string {
if o == nil {
return nil
Expand Down
5 changes: 2 additions & 3 deletions internal/sdk/sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (

// ServerList contains the list of servers available to the SDK
var ServerList = []string{
"https://product.sls.epilot.io",
// Production server
"https://product.sls.epilot.io",
}
Expand Down Expand Up @@ -146,9 +145,9 @@ func New(opts ...SDKOption) *SDK {
sdkConfiguration: sdkConfiguration{
Language: "go",
OpenAPIDocVersion: "1.0.0",
SDKVersion: "0.4.1",
SDKVersion: "0.4.2",
GenVersion: "2.231.0",
UserAgent: "speakeasy-sdk/go 0.4.1 2.231.0 1.0.0 epilot-product",
UserAgent: "speakeasy-sdk/go 0.4.2 2.231.0 1.0.0 epilot-product",
},
}
for _, opt := range opts {
Expand Down

0 comments on commit cdf0e3b

Please sign in to comment.