Skip to content

Commit

Permalink
Support System fields in tax patch request
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishu Goel committed Oct 25, 2024
1 parent ba92b19 commit 2829fdc
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 30 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: fdec2a87622dada6eb26dd0b357315a7
docChecksum: f768395a9fa298a197a83c0f2bfa8f30
docVersion: 1.0.0
speakeasyVersion: 1.420.0
generationVersion: 2.438.15
releaseVersion: 0.11.0
configChecksum: b72aef552739dc67ea5c8e6f5b63de59
releaseVersion: 0.11.1
configChecksum: 5f00bde36e6138a840e495cd3ac9beed
repoURL: https://github.com/epilot-dev/terraform-provider-epilot-product.git
repoSubDirectory: .
published: true
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ terraform {
required_providers {
epilot-product = {
source = "epilot-dev/epilot-product"
version = "0.11.0"
version = "0.11.1"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ terraform {
required_providers {
epilot-product = {
source = "epilot-dev/epilot-product"
version = "0.11.0"
version = "0.11.1"
}
}
}
Expand Down
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 {
epilot-product = {
source = "epilot-dev/epilot-product"
version = "0.11.0"
version = "0.11.1"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ go:
outputModelSuffix: output
packageName: openapi
terraform:
version: 0.11.0
version: 0.11.1
additionalDataSources: []
additionalDependencies: {}
additionalResources: []
Expand Down
34 changes: 24 additions & 10 deletions internal/provider/tax_resource_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,22 +223,36 @@ func (r *TaxResourceModel) ToSharedTaxPatch() *shared.TaxPatch {
for _, tagsItem1 := range r.Tags {
tags1 = append(tags1, tagsItem1.ValueString())
}
var active bool
active = r.Active.ValueBool()

active := new(bool)
if !r.Active.IsUnknown() && !r.Active.IsNull() {
*active = r.Active.ValueBool()
} else {
active = nil
}
description := new(string)
if !r.Description.IsUnknown() && !r.Description.IsNull() {
*description = r.Description.ValueString()
} else {
description = nil
}
var rate string
rate = r.Rate.ValueString()

var region string
region = r.Region.ValueString()

typeVar := shared.TaxPatchType(r.Type.ValueString())
rate := new(string)
if !r.Rate.IsUnknown() && !r.Rate.IsNull() {
*rate = r.Rate.ValueString()
} else {
rate = nil
}
region := new(string)
if !r.Region.IsUnknown() && !r.Region.IsNull() {
*region = r.Region.ValueString()
} else {
region = nil
}
typeVar := new(shared.TaxPatchType)
if !r.Type.IsUnknown() && !r.Type.IsNull() {
*typeVar = shared.TaxPatchType(r.Type.ValueString())
} else {
typeVar = nil
}
out := shared.TaxPatch{
Additional: additional,
Files: files,
Expand Down
24 changes: 12 additions & 12 deletions internal/sdk/models/shared/taxpatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,11 @@ type TaxPatch struct {
Manifest []string `json:"_manifest,omitempty"`
Schema *TaxPatchSchema `json:"_schema,omitempty"`
Tags []string `json:"_tags,omitempty"`
Active bool `json:"active"`
Active *bool `json:"active,omitempty"`
Description *string `json:"description,omitempty"`
Rate string `json:"rate"`
Region string `json:"region"`
Type TaxPatchType `json:"type"`
Rate *string `json:"rate,omitempty"`
Region *string `json:"region,omitempty"`
Type *TaxPatchType `json:"type,omitempty"`
}

func (o *TaxPatch) GetAdditional() map[string]any {
Expand Down Expand Up @@ -106,9 +106,9 @@ func (o *TaxPatch) GetTags() []string {
return o.Tags
}

func (o *TaxPatch) GetActive() bool {
func (o *TaxPatch) GetActive() *bool {
if o == nil {
return false
return nil
}
return o.Active
}
Expand All @@ -120,23 +120,23 @@ func (o *TaxPatch) GetDescription() *string {
return o.Description
}

func (o *TaxPatch) GetRate() string {
func (o *TaxPatch) GetRate() *string {
if o == nil {
return ""
return nil
}
return o.Rate
}

func (o *TaxPatch) GetRegion() string {
func (o *TaxPatch) GetRegion() *string {
if o == nil {
return ""
return nil
}
return o.Region
}

func (o *TaxPatch) GetType() TaxPatchType {
func (o *TaxPatch) GetType() *TaxPatchType {
if o == nil {
return TaxPatchType("")
return nil
}
return o.Type
}
1 change: 0 additions & 1 deletion openapi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -451,7 +451,6 @@ components:
TaxPatch:
allOf:
- $ref: "#/components/schemas/BaseTax"
- $ref: "#/components/schemas/BaseTaxRequired"
- $ref: "#/components/schemas/BaseSystemFields"
BasePrice:
type: object
Expand Down

0 comments on commit 2829fdc

Please sign in to comment.