Skip to content

Commit

Permalink
chore: regenerate provider & fix import
Browse files Browse the repository at this point in the history
  • Loading branch information
Nishu Goel committed Feb 20, 2024
1 parent d3ff63a commit 230398b
Show file tree
Hide file tree
Showing 28 changed files with 941 additions and 455 deletions.
30 changes: 0 additions & 30 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,34 +1,4 @@
# .gitignore
.terraform
.terraform*
*.tfstate*
# Local .terraform directories
**/.terraform/*
# .tfstate files
*.tfstate
*.tfstate.*
# Crash log files
crash.log
crash.*.log
# Exclude all .tfvars files, which are likely to contain sensitive data, such as
# password, private keys, and other secrets. These should not be part of version
# control as they are data points which are potentially sensitive and subject
# to change depending on the environment.
*.tfvars
*.tfvars.json
# Ignore override files as they are usually used to override resources locally and so
# are not checked in
override.tf
override.tf.json
*_override.tf
*_override.tf.json
# Include override files you do wish to add to version control using negated pattern
# !example_override.tf
# Include tfplan files to ignore the plan output of command: terraform plan -out=tfplan
# example: *tfplan*
# Ignore CLI configuration files
.terraformrc
terraform.rc
.DS_Store

terraform-provider-epilot-product
12 changes: 4 additions & 8 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: 3d8d7ad246815548d5cd25ffa19bd1d4
docChecksum: 4c3c0d4b4e71f2da074bb4aecb29344f
docVersion: 1.0.0
speakeasyVersion: internal
generationVersion: 2.230.1
releaseVersion: 0.5.1
configChecksum: 92bf74bf8697a7599e23ce46c541f3d7
releaseVersion: 0.5.4
configChecksum: 8b07a760ba1642282d9fef4cd162b6ef
repoURL: https://github.com/epilot-dev/terraform-provider-epilot-product.git
repoSubDirectory: .
published: true
Expand Down Expand Up @@ -117,7 +117,6 @@ generatedFiles:
- internal/sdk/pkg/models/shared/pricecreate.go
- internal/sdk/pkg/models/shared/pricepatch.go
- internal/sdk/pkg/models/shared/product.go
- internal/sdk/pkg/models/shared/baseimage.go
- internal/sdk/pkg/models/shared/productcreate.go
- internal/sdk/pkg/models/shared/productpatch.go
- internal/sdk/pkg/models/shared/tax.go
Expand All @@ -126,13 +125,10 @@ generatedFiles:
- internal/sdk/pkg/models/shared/security.go
- internal/provider/type_base_entity_acl.go
- internal/provider/type_base_entity_owner.go
- internal/provider/type_base_relation_dollar_relation.go
- internal/provider/type_dollar_relation.go
- internal/provider/type_base_relation.go
- internal/provider/type_price_tier.go
- internal/provider/type_price_create_unit.go
- internal/provider/type_feature.go
- internal/provider/type_dollar_relation.go
- internal/provider/type_base_image.go
- USAGE.md
- internal/provider/provider.go
- examples/provider/provider.tf
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
all: docs speakeasy

speakeasy:
speakeasy generate sdk --lang terraform -o . -s https://docs.api.epilot.io/product.yaml
speakeasy generate sdk --lang terraform -o . -s product.yaml

docs:
go generate ./...
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.5.1"
version = "0.5.4"
}
}
}
Expand Down
30 changes: 2 additions & 28 deletions docs/data-sources/product.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,13 @@ data "epilot-product_product" "my_product" {
- `code` (String) The product code
- `created_at` (String)
- `description` (String) A description of the product. Multi-line supported.
- `feature` (Attributes List) (see [below for nested schema](#nestedatt--feature))
- `feature` (List of String)
- `internal_name` (String) Not visible to customers, only in internal tables
- `name` (String) The description for the product
- `org` (String) Organization Id the entity belongs to
- `owners` (Attributes List) (see [below for nested schema](#nestedatt--owners))
- `price_options` (Attributes) (see [below for nested schema](#nestedatt--price_options))
- `product_images` (Attributes) (see [below for nested schema](#nestedatt--product_images))
- `product_images` (String) Parsed as JSON.
- `schema` (String)
- `tags` (List of String)
- `title` (String)
Expand All @@ -68,16 +68,6 @@ Read-Only:
- `view` (List of String)


<a id="nestedatt--feature"></a>
### Nested Schema for `feature`

Read-Only:

- `feature` (String)
- `id` (String)
- `tags` (List of String)


<a id="nestedatt--owners"></a>
### Nested Schema for `owners`

Expand All @@ -103,19 +93,3 @@ Read-Only:
- `tags` (List of String)



<a id="nestedatt--product_images"></a>
### Nested Schema for `product_images`

Read-Only:

- `dollar_relation` (Attributes List) (see [below for nested schema](#nestedatt--product_images--dollar_relation))

<a id="nestedatt--product_images--dollar_relation"></a>
### Nested Schema for `product_images.dollar_relation`

Read-Only:

- `entity_id` (String)


6 changes: 4 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,21 @@
page_title: "epilot-product Provider"
subcategory: ""
description: |-
---

# epilot-product Provider



## Example Usage

```terraform
terraform {
required_providers {
epilot-product = {
source = "epilot-dev/epilot-product"
version = "0.5.2"
version = "0.5.4"
}
}
}
Expand All @@ -25,7 +28,6 @@ provider "epilot-product" {
```

<!-- schema generated by tfplugindocs -->

## Schema

### Optional
Expand Down
43 changes: 9 additions & 34 deletions docs/resources/product.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,13 @@ Product Resource

```terraform
resource "epilot-product_product" "my_product" {
active = true
code = "...my_code..."
description = "...my_description..."
internal_name = "...my_internal_name..."
name = "Juan Morar Jr."
type = "product"
active = true
code = "...my_code..."
description = "...my_description..."
internal_name = "...my_internal_name..."
name = "Juan Morar Jr."
product_images = "{ \"see\": \"documentation\" }"
type = "product"
}
```

Expand All @@ -35,10 +36,10 @@ resource "epilot-product_product" "my_product" {

- `code` (String) The product code
- `description` (String) A description of the product. Multi-line supported.
- `feature` (Attributes List) (see [below for nested schema](#nestedatt--feature))
- `feature` (List of String)
- `internal_name` (String) Not visible to customers, only in internal tables
- `price_options` (Attributes) (see [below for nested schema](#nestedatt--price_options))
- `product_images` (Attributes) (see [below for nested schema](#nestedatt--product_images))
- `product_images` (String) Parsed as JSON.
- `type` (String) The type of Product:

| type | description |
Expand All @@ -60,16 +61,6 @@ must be one of ["product", "service"]; Default: "product"
- `title` (String)
- `updated_at` (String)

<a id="nestedatt--feature"></a>
### Nested Schema for `feature`

Optional:

- `feature` (String)
- `id` (String)
- `tags` (List of String)


<a id="nestedatt--price_options"></a>
### Nested Schema for `price_options`

Expand All @@ -87,22 +78,6 @@ Optional:



<a id="nestedatt--product_images"></a>
### Nested Schema for `product_images`

Optional:

- `dollar_relation` (Attributes List) (see [below for nested schema](#nestedatt--product_images--dollar_relation))

<a id="nestedatt--product_images--dollar_relation"></a>
### Nested Schema for `product_images.dollar_relation`

Optional:

- `entity_id` (String)



<a id="nestedatt--acl"></a>
### Nested Schema for `acl`

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.5.1"
version = "0.5.4"
}
}
}
Expand Down
13 changes: 7 additions & 6 deletions examples/resources/epilot-product_product/resource.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
resource "epilot-product_product" "my_product" {
active = true
code = "...my_code..."
description = "...my_description..."
internal_name = "...my_internal_name..."
name = "Juan Morar Jr."
type = "product"
active = true
code = "...my_code..."
description = "...my_description..."
internal_name = "...my_internal_name..."
name = "Juan Morar Jr."
product_images = "{ \"see\": \"documentation\" }"
type = "product"
}
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.5.1
version: 0.5.4
author: epilot-dev
imports:
option: openapi
Expand Down
2 changes: 1 addition & 1 deletion internal/provider/price_data_source_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (r *PriceDataSourceModel) RefreshFromSharedPrice(resp *shared.Price) {
r.Tax.DollarRelation = r.Tax.DollarRelation[:len(resp.Tax.DollarRelation)]
}
for dollarRelationCount, dollarRelationItem := range resp.Tax.DollarRelation {
var dollarRelation1 BaseRelationDollarRelation
var dollarRelation1 DollarRelation
dollarRelation1.Tags = nil
for _, v := range dollarRelationItem.Tags {
dollarRelation1.Tags = append(dollarRelation1.Tags, types.StringValue(v))
Expand Down
6 changes: 3 additions & 3 deletions internal/provider/price_resource_sdk.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ func (r *PriceResourceModel) ToSharedPriceCreate() *shared.PriceCreate {
}
var tax *shared.BaseRelation
if r.Tax != nil {
var dollarRelation []shared.BaseRelationDollarRelation = nil
var dollarRelation []shared.DollarRelation = nil
for _, dollarRelationItem := range r.Tax.DollarRelation {
var tags []string = nil
for _, tagsItem := range dollarRelationItem.Tags {
Expand All @@ -93,7 +93,7 @@ func (r *PriceResourceModel) ToSharedPriceCreate() *shared.PriceCreate {
} else {
entityID = nil
}
dollarRelation = append(dollarRelation, shared.BaseRelationDollarRelation{
dollarRelation = append(dollarRelation, shared.DollarRelation{
Tags: tags,
EntityID: entityID,
})
Expand Down Expand Up @@ -340,7 +340,7 @@ func (r *PriceResourceModel) RefreshFromSharedPrice(resp *shared.Price) {
r.Tax.DollarRelation = r.Tax.DollarRelation[:len(resp.Tax.DollarRelation)]
}
for dollarRelationCount, dollarRelationItem := range resp.Tax.DollarRelation {
var dollarRelation1 BaseRelationDollarRelation
var dollarRelation1 DollarRelation
dollarRelation1.Tags = nil
for _, v := range dollarRelationItem.Tags {
dollarRelation1.Tags = append(dollarRelation1.Tags, types.StringValue(v))
Expand Down
40 changes: 8 additions & 32 deletions internal/provider/product_data_source.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ type ProductDataSourceModel struct {
Active types.Bool `tfsdk:"active"`
Code types.String `tfsdk:"code"`
Description types.String `tfsdk:"description"`
Feature []Feature `tfsdk:"feature"`
Feature []types.String `tfsdk:"feature"`
Hydrate types.Bool `tfsdk:"hydrate"`
ID types.String `tfsdk:"id"`
InternalName types.String `tfsdk:"internal_name"`
Name types.String `tfsdk:"name"`
PriceOptions *BaseRelation `tfsdk:"price_options"`
ProductImages *BaseImage `tfsdk:"product_images"`
ProductImages types.String `tfsdk:"product_images"`
Type types.String `tfsdk:"type"`
}

Expand Down Expand Up @@ -126,22 +126,9 @@ func (r *ProductDataSource) Schema(ctx context.Context, req datasource.SchemaReq
Computed: true,
Description: `A description of the product. Multi-line supported.`,
},
"feature": schema.ListNestedAttribute{
Computed: true,
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"id": schema.StringAttribute{
Computed: true,
},
"tags": schema.ListAttribute{
Computed: true,
ElementType: types.StringType,
},
"feature": schema.StringAttribute{
Computed: true,
},
},
},
"feature": schema.ListAttribute{
Computed: true,
ElementType: types.StringType,
},
"hydrate": schema.BoolAttribute{
Optional: true,
Expand Down Expand Up @@ -178,20 +165,9 @@ func (r *ProductDataSource) Schema(ctx context.Context, req datasource.SchemaReq
},
},
},
"product_images": schema.SingleNestedAttribute{
Computed: true,
Attributes: map[string]schema.Attribute{
"dollar_relation": schema.ListNestedAttribute{
Computed: true,
NestedObject: schema.NestedAttributeObject{
Attributes: map[string]schema.Attribute{
"entity_id": schema.StringAttribute{
Computed: true,
},
},
},
},
},
"product_images": schema.StringAttribute{
Computed: true,
Description: `Parsed as JSON.`,
},
"type": schema.StringAttribute{
Computed: true,
Expand Down
Loading

0 comments on commit 230398b

Please sign in to comment.